getStrokePaint method

  1. @override
Paint getStrokePaint()
override

Gets the border color of the series.

Implementation

@override
Paint getStrokePaint() {
  final SegmentProperties segmentProperties =
      SegmentHelper.getSegmentProperties(this);
  strokePaint = Paint()
    ..style = PaintingStyle.stroke
    ..strokeWidth = segmentProperties.currentPoint!.isEmpty != null &&
            segmentProperties.currentPoint!.isEmpty! == true
        ? segmentProperties.series.emptyPointSettings.borderWidth
        : segmentProperties.strokeWidth!;
  if (segmentProperties.series.borderGradient != null) {
    strokePaint!.shader = segmentProperties.series.borderGradient!
        .createShader(segmentProperties.currentPoint!.region!);
  } else if (segmentProperties.strokeColor != null) {
    strokePaint!.color = segmentProperties.currentPoint!.isEmpty != null &&
            segmentProperties.currentPoint!.isEmpty! == true
        ? segmentProperties.series.emptyPointSettings.borderColor
        : segmentProperties.strokeColor!;
  }
  segmentProperties.defaultStrokeColor = strokePaint;
  segmentProperties.series.borderWidth == 0
      ? strokePaint!.color = Colors.transparent
      : strokePaint!.color;
  return strokePaint!;
}