onPaint method

  1. @override
void onPaint(
  1. Canvas canvas
)
override

Draws segment in series bounds.

Implementation

@override
void onPaint(Canvas canvas) {
  if (points.isEmpty) {
    return;
  }

  final Paint paint = getStrokePaint();
  if (paint.color != Colors.transparent && paint.strokeWidth > 0) {
    final Offset start =
        Offset.lerp(_oldPoints[0], points[0], animationFactor)!;
    final Offset end =
        Offset.lerp(_oldPoints[1], points[1], animationFactor)!;
    drawDashes(canvas, series.dashArray, paint, start: start, end: end);
  }
}