getFillPaint method

  1. @override
Paint getFillPaint()
override

Gets the color of the series.

Implementation

@override
Paint getFillPaint() {
  final SegmentProperties segmentProperties =
      SegmentHelper.getSegmentProperties(this);

  /// Get and set the paint options for stackedcolumn100 series.
  if (segmentProperties.series.gradient == null) {
    fillPaint = Paint()
      ..color = segmentProperties.currentPoint!.isEmpty != null &&
              segmentProperties.currentPoint!.isEmpty! == true
          ? segmentProperties.series.emptyPointSettings.color
          : (segmentProperties.currentPoint!.pointColorMapper ??
              segmentProperties.color!)
      ..style = PaintingStyle.fill;
  } else {
    fillPaint = getLinearGradientPaint(
        segmentProperties.series.gradient!,
        segmentProperties.currentPoint!.region!,
        segmentProperties.stateProperties.requireInvertedAxis);
  }
  assert(segmentProperties.series.opacity >= 0 == true,
      'The opacity value of the stacked column100 series should be greater than or equal to 0.');
  assert(segmentProperties.series.opacity <= 1 == true,
      'The opacity value of the stacked column100 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!;
}