getFillPaint method

  1. @override
Paint getFillPaint()
override

Gets the color of the series.

Implementation

@override
Paint getFillPaint() {
  _setSegmentProperties();
  fillPaint = Paint();
  if (_segmentProperties.series.gradient == null) {
    if (_segmentProperties.color != null) {
      fillPaint!.color = _segmentProperties.color!;
      fillPaint!.style = PaintingStyle.fill;
    }
  } else {
    fillPaint = (_segmentProperties.pathRect != null)
        ? getLinearGradientPaint(
            _segmentProperties.series.gradient!,
            _segmentProperties.pathRect!,
            _segmentProperties.stateProperties.requireInvertedAxis)
        : fillPaint;
  }
  assert(_segmentProperties.series.opacity >= 0 == true,
      'The opacity value of the range area series should be greater than or equal to 0.');
  assert(_segmentProperties.series.opacity <= 1 == true,
      'The opacity value of the range area series should be less than or equal to 1.');
  fillPaint!.color = (_segmentProperties.series.opacity < 1 == true &&
          fillPaint!.color != Colors.transparent)
      ? fillPaint!.color.withOpacity(_segmentProperties.series.opacity)
      : fillPaint!.color;
  _segmentProperties.defaultFillColor = fillPaint;
  setShader(_segmentProperties, fillPaint!);
  return fillPaint!;
}