draw method
void
draw()
override
Implementation
@override
void draw(Canvas canvas, Size size, double scaleX, double scrollX,
double Function(double) getX, double Function(double) getY) {
if (startPoint == null || direction == null) return;
final paint = Paint()
..color = color
..strokeWidth = strokeWidth
..style = PaintingStyle.stroke;
// 绘制水平射线
final endX = (direction! > 0 ? size.width : 0).toDouble();
canvas.drawLine(
startPoint!,
Offset(endX, startPoint!.dy),
paint,
);
}