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();
  strokePaint!
    ..style = PaintingStyle.stroke
    ..strokeWidth = segmentProperties.series.borderWidth;
  if (segmentProperties.series.borderGradient != null &&
      segmentProperties.strokePath != null) {
    strokePaint!.shader = segmentProperties.series.borderGradient!
        .createShader(segmentProperties.strokePath!.getBounds());
  } else if (segmentProperties.strokeColor != null) {
    strokePaint!.color = segmentProperties.series.borderColor;
  }
  segmentProperties.series.borderWidth == 0
      ? strokePaint!.color = Colors.transparent
      : strokePaint!.color;
  strokePaint!.strokeCap = StrokeCap.round;
  segmentProperties.defaultStrokeColor = strokePaint;
  return strokePaint!;
}