getStrokePaint method

  1. @override
Paint getStrokePaint()
override

Gets the border color of the series.

Implementation

@override
Paint getStrokePaint() {
  _setSegmentProperties();
  strokePaint = Paint()
    ..style = PaintingStyle.stroke
    ..strokeWidth = (_segmentProperties.currentPoint!.isEmpty ?? false)
        ? _segmentProperties.series.emptyPointSettings.borderWidth
        : _segmentProperties.strokeWidth!;
  _meanPaint = Paint()
    ..style = PaintingStyle.stroke
    ..strokeWidth = (_segmentProperties.currentPoint!.isEmpty ?? false)
        ? _segmentProperties.series.emptyPointSettings.borderWidth
        : _segmentProperties.strokeWidth!;
  if (_segmentProperties.series.borderGradient != null) {
    strokePaint!.shader = _segmentProperties.series.borderGradient!
        .createShader(_segmentProperties.currentPoint!.region!);
    _meanPaint.shader = _segmentProperties.series.borderGradient!
        .createShader(_segmentProperties.currentPoint!.region!);
  } else {
    strokePaint!.color = (_segmentProperties.currentPoint!.isEmpty ?? false)
        ? _segmentProperties.series.emptyPointSettings.borderColor
        : _segmentProperties.strokeColor!;
    _meanPaint.color = (_segmentProperties.currentPoint!.isEmpty ?? false)
        ? _segmentProperties.series.emptyPointSettings.borderColor
        : _segmentProperties.strokeColor!;
  }
  _segmentProperties.series.borderWidth == 0
      ? strokePaint!.color = Colors.transparent
      : strokePaint!.color;
  _segmentProperties.defaultStrokeColor = strokePaint;
  return strokePaint!;
}