draw method
Draws the line on the given canvas with the provided size.
Implementation
@override
void draw(Canvas canvas, Size size) {
final paint = Paint()
..color = color
..strokeWidth = lineWidth
..strokeCap = StrokeCap.square;
canvas.drawLine(startOffset, endOffset, paint);
}