onPaint method

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

Draws segment in series bounds.

Implementation

@override
void onPaint(Canvas canvas) {
  _setSegmentProperties();
  final RangeAreaSeries<dynamic, dynamic> series =
      _segmentProperties.series as RangeAreaSeries<dynamic, dynamic>;
  _segmentProperties.pathRect = _segmentProperties.path.getBounds();
  canvas.drawPath(_segmentProperties.path,
      (series.gradient == null) ? fillPaint! : getFillPaint());
  strokePaint = getStrokePaint();
  if (strokePaint!.color != Colors.transparent) {
    drawDashedLine(
        canvas,
        series.dashArray,
        strokePaint!,
        series.borderDrawMode == RangeAreaBorderMode.all
            ? _segmentProperties.path
            : _segmentProperties.borderPath!);
  }
}