getFillPaint method

  1. @override
Paint getFillPaint()
override

Gets the color of the series.

Implementation

@override
Paint getFillPaint() {
  final bool hasPointColor = _series.pointColorMapper != null;

  /// Get and set the paint options for waterfall series.
  if (_series.gradient == null) {
    fillPaint = Paint()
      ..color = ((hasPointColor && _currentPoint!.pointColorMapper != null)
          ? _currentPoint!.pointColorMapper
          : _currentPoint!.isIntermediateSum!
              ? _intermediateSumColor ?? _color!
              : _currentPoint!.isTotalSum!
                  ? _totalSumColor ?? _color!
                  : (_currentPoint!.yValue < 0) == true
                      ? _negativePointsColor ?? _color!
                      : _color!)!
      ..style = PaintingStyle.fill;
  } else {
    fillPaint = _getLinearGradientPaint(
        _series.gradient!,
        _currentPoint!.region!,
        _seriesRenderer._chartState!._requireInvertedAxis);
  }
  assert(_series.opacity >= 0,
      'The opacity value of the waterfall series should be greater than or equal to 0.');
  assert(_series.opacity <= 1,
      'The opacity value of the waterfall series should be less than or equal to 1.');
  fillPaint!.color =
      (_series.opacity < 1 && fillPaint!.color != Colors.transparent)
          ? fillPaint!.color.withOpacity(_series.opacity)
          : fillPaint!.color;
  _defaultFillColor = fillPaint;
  return fillPaint!;
}