drawLine method

dynamic drawLine(
  1. Canvas canvas,
  2. Paint paint,
  3. Line line
)

Implementation

drawLine(Canvas canvas, Paint paint, Line line) {
  for (int i = 0; i < line.points.length - 1; i++) {
    if (line.points[i] != null && line.points[i + 1] != null) {
      canvas.drawLine(
          line.points[i].toOffset(), line.points[i + 1].toOffset(), paint);
    }
  }
}