drawObject method
Draws the line on the provided canvas of size size.
Implementation
@override
void drawObject(Canvas canvas, Size size) {
canvas.drawLine(position.translate(-length / 2 * scale, 0),
position.translate(length / 2 * scale, 0), paint);
}