getFillPaint method

  1. @override
Paint getFillPaint()
override

Gets the color of the series.

Implementation

@override
Paint getFillPaint() {
  _setSegmentProperties();
  final bool hasPointColor =
      _segmentProperties.series.pointColorMapper != null;
  if (_segmentProperties.series.gradient == null) {
    if (_segmentProperties.color != null) {
      fillPaint = Paint()
        ..color = (_segmentProperties.currentPoint!.isEmpty ?? false)
            ? _segmentProperties.series.emptyPointSettings.color
            : ((hasPointColor &&
                    _segmentProperties.currentPoint!.pointColorMapper != null)
                ? _segmentProperties.currentPoint!.pointColorMapper
                : _segmentProperties.series.markerSettings.isVisible == true
                    ? _segmentProperties.series.markerSettings.color ??
                        SeriesHelper.getSeriesRendererDetails(
                                _segmentProperties.seriesRenderer)
                            .seriesColor!
                    : _segmentProperties.color)!
        ..style = PaintingStyle.fill;
    }
  } else {
    fillPaint = getLinearGradientPaint(
        _segmentProperties.series.gradient!,
        _segmentProperties.currentPoint!.region!,
        _segmentProperties.stateProperties.requireInvertedAxis);
  }
  _segmentProperties.defaultFillColor = fillPaint;
  assert(_segmentProperties.series.opacity >= 0 == true,
      'The opacity value of the the scatter series should be greater than or equal to 0.');
  assert(_segmentProperties.series.opacity <= 1 == true,
      'The opacity value of the the scatter 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;
  setShader(_segmentProperties, fillPaint!);
  return fillPaint!;
}