getFillPaint method
Gets the color of the series.
Implementation
@override
Paint getFillPaint() {
final SegmentProperties segmentProperties =
SegmentHelper.getSegmentProperties(this);
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 stacked area series should be greater than or equal to 0.');
assert(segmentProperties.series.opacity <= 1 == true,
'The opacity value of the stacked 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!;
}