getStrokePaint method

  1. @override
Paint getStrokePaint()
override

Gets the border color of the series.

Implementation

@override
Paint getStrokePaint() {
  _setSegmentProperties();
  final ScatterSeriesRenderer scatterRenderer =
      _segmentProperties.seriesRenderer as ScatterSeriesRenderer;
  final Paint strokePaint = Paint()
    ..style = PaintingStyle.stroke
    ..strokeWidth = (_segmentProperties.currentPoint!.isEmpty ?? false)
        ? _segmentProperties.series.emptyPointSettings.borderWidth
        : _segmentProperties.series.markerSettings.isVisible == true
            ? _segmentProperties.series.markerSettings.borderWidth
            : _segmentProperties.strokeWidth!;
  if (_segmentProperties.series.borderGradient != null) {
    strokePaint.shader = _segmentProperties.series.borderGradient!
        .createShader(_segmentProperties.currentPoint!.region!);
  } else {
    strokePaint.color = (_segmentProperties.currentPoint!.isEmpty ?? false)
        ? _segmentProperties.series.emptyPointSettings.borderColor
        : _segmentProperties.series.markerSettings.isVisible == true
            ? _segmentProperties.series.markerSettings.borderColor ??
                SeriesHelper.getSeriesRendererDetails(
                        _segmentProperties.seriesRenderer)
                    .seriesColor!
            : _segmentProperties.strokeColor!;
  }
  (strokePaint.strokeWidth == 0 &&
          SeriesHelper.getSeriesRendererDetails(scatterRenderer).isLineType ==
              false)
      ? strokePaint.color = Colors.transparent
      : strokePaint.color;
  _segmentProperties.defaultStrokeColor = strokePaint;
  return strokePaint;
}