getStrokePaint method

  1. @override
Paint getStrokePaint()
override

Gets the stroke color of the series.

Implementation

@override
Paint getStrokePaint() {
  _setSegmentProperties();
  final Paint strokePaint = Paint();
  assert(_segmentProperties.series.opacity >= 0 == true,
      'The opacity value of the Hilo series should be greater than or equal to 0.');
  assert(_segmentProperties.series.opacity <= 1 == true,
      'The opacity value of the Hilo series should be less than or equal to 1.');
  if (_segmentProperties.strokeColor != null) {
    strokePaint.color = _segmentProperties.currentPoint!.isEmpty != null &&
            _segmentProperties.currentPoint!.isEmpty! == true
        ? _segmentProperties.series.emptyPointSettings.color
        : _segmentProperties.pointColorMapper ??
            _segmentProperties.strokeColor!;
    strokePaint.color = (_segmentProperties.series.opacity < 1 == true &&
            strokePaint.color != Colors.transparent)
        ? strokePaint.color.withOpacity(_segmentProperties.series.opacity)
        : strokePaint.color;
  }
  strokePaint.strokeWidth = _segmentProperties.strokeWidth!;
  strokePaint.style = PaintingStyle.stroke;
  strokePaint.strokeCap = StrokeCap.round;
  _segmentProperties.defaultStrokeColor = strokePaint;
  setShader(_segmentProperties, strokePaint);
  return strokePaint;
}