'Crate custom tail in just_the_tooltip Library
I am using JustTheTooltip library. There is a built in function to create a custom tail, but I can't figure out how to create the path relative to the tooltip. I need a custom triangle to the left.
Docs:
Tail Builder If you'd like a custom tail (the nub on the end dialog bubble) drawn on your tooltip, you can pass through your owntailBuilder. The JustTheInterface.defaultTailBuilder (default) shows how to simply draw and return a path for your custom tails:
Path defaultTailBuilder(Offset tip, Offset point2, Offset point3) { return Path() ..moveTo(tip.dx, tip.dy) ..lineTo(point2.dx, point2.dy) ..lineTo(point3.dx, point3.dy) ..close(); }
I am trying this:
JustTheTooltip(
preferredDirection: AxisDirection.right,
tailBuilder: (_, __, ___) => _customTailBuilder(Offset(100, 100), Offset(170, 150), Offset(170, 50),),
................
);
And _customTailBuilder is the same as above, in the docs.
Path _customTailBuilder(Offset tip, Offset point2, Offset point3) {
return Path()
..moveTo(tip.dx, tip.dy)
..lineTo(point2.dx, point2.dy)
..lineTo(point3.dx, point3.dy)
..close();
}
I need the triangle to be relative to the tooltip, I don't know how to get the postition, thank you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
