The following is a reference.
How can I create a border-only bubble with CustomPainter?
But what I want to achieve is a balloon for the circle. The image will be as follows.
If implemented as follows, they will be separated and drawn as shown in the example.
final path = Path();
// create circle
final center = Offset(size.width / 2, size.height / 2 - 10);
final radius = size.width / 2;
path.addOval(Rect.fromCircle(center: center, radius: radius));
// create tip
path.moveTo(center.dx - 10, center.dy + radius);
path.lineTo(center.dx, center.dy + radius + 12);
path.lineTo(center.dx + 10, center.dy + radius);
path.close();
// draw path
canvas.drawPath(path, paint);
canvas.drawPath(path, borderPaint);
This may be a rudimentary question, but please answer.
2
Answers
I was able to implement it in my own way and share it with you.Better.I'm sure there is a better way.If you have a better way, please let me know.
usage
Try below code with Stack and CustomPainter. Change offset values as your requirement.
Here is the ‘V’ shape CustomPainter class