getStrokePaint method Null safety

  1. @override
Paint getStrokePaint()
override

Gets the border color of the series.

Implementation

@override
Paint getStrokePaint() {
  final Paint strokePaint = Paint();
  strokePaint
    ..style = PaintingStyle.stroke
    ..strokeWidth = _series.borderWidth;
  if (_series.borderGradient != null) {
    strokePaint.shader =
        _series.borderGradient!.createShader(_strokePath.getBounds());
  } else if (_strokeColor != null) {
    strokePaint.color = _series.borderColor;
  }
  _series.borderWidth == 0
      ? strokePaint.color = Colors.transparent
      : strokePaint.color;
  strokePaint.strokeCap = StrokeCap.round;
  _defaultStrokeColor = strokePaint;
  return strokePaint;
}