draw method

  1. @override
void draw(
  1. Canvas canvas,
  2. Size size
)
override

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);
}