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 point1 = worldToScreen(x1, y1);
final point2 = worldToScreen(x2, y2);
final linePaint = Paint()
..color = color
..strokeWidth = strokeWidth
..style = PaintingStyle.stroke
..strokeCap = StrokeCap.round;
if (dashPattern != null) {
drawDashedLine(canvas, point1, point2, linePaint);
} else {
canvas.drawLine(point1, point2, linePaint);
}
if (arrow) {
drawArrowHead(canvas, point1, point2, linePaint);
}
}