onPaint method

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

Draws segment in series bounds.

Implementation

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