getStrokePaint method

  1. @override
Paint getStrokePaint()
override

Gets the border color of the series.

Implementation

@override
Paint getStrokePaint() {
  _setSegmentProperties();
  final Paint strokePaint = Paint();
  strokePaint
    ..style = PaintingStyle.stroke
    ..strokeWidth = _segmentProperties.series.borderWidth;
  if (_segmentProperties.series.borderGradient != null &&
      _segmentProperties.borderPath != null) {
    strokePaint.shader = _segmentProperties.series.borderGradient!
        .createShader(_segmentProperties.borderPath!.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;
}