onPaint method

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

Draws segment in series bounds.

Implementation

@override
void onPaint(Canvas canvas) {
  if (segmentRect == null ||
      _oldSegmentRect == null ||
      segmentRect!.isEmpty ||
      shape == DataMarkerType.none) {
    return;
  }

  final Rect? paintRect =
      Rect.lerp(_oldSegmentRect, segmentRect, animationFactor);
  if (paintRect == null || paintRect.isEmpty) {
    return;
  }

  paint(
    canvas: canvas,
    rect: paintRect,
    shapeType: toShapeMarkerType(shape),
    paint: fillPaint,
    borderPaint: strokePaint,
  );
}