paint method
void
paint(
- Canvas canvas,
- Size size,
- WorldToScreen worldToScreen,
- ScreenToWorld screenToWorld,
- double scale,
override
Implementation
@override
void paint(
Canvas canvas,
Size size,
WorldToScreen worldToScreen,
ScreenToWorld screenToWorld,
double scale,
) {
final position = worldToScreen(x, y);
canvas.drawCircle(
position + const Offset(0, 2),
radius + 1,
Paint()
..color = Colors.black.withOpacity(0.15)
..maskFilter = const MaskFilter.blur(BlurStyle.normal, 2.0),
);
canvas.drawCircle(position, radius, Paint()..color = color);
canvas.drawCircle(
position,
radius,
Paint()
..color = Colors.white
..style = PaintingStyle.stroke
..strokeWidth = 1.5,
);
if (label != null) {
final textPainter = TextPainter(
text: TextSpan(
text: label,
style: labelStyle ??
TextStyle(
fontSize: 12.5,
color: color,
fontWeight: FontWeight.w700,
),
),
textDirection: TextDirection.ltr,
)..layout();
final labelPos = position + labelOffset;
textPainter.paint(canvas, labelPos);
}
}