getStrokePaint method

  1. @override
Paint getStrokePaint()
override

Gets the stroke color of the series.

Implementation

@override
Paint getStrokePaint() {
  final Paint _strokePaint = Paint();
  assert(_series.opacity >= 0,
      'The opacity value of the fast line series should be greater than or equal to 0.');
  assert(_series.opacity <= 1,
      'The opacity value of the fast line series should be less than or equal to 1.');
  if (_series.gradient == null) {
    if (_strokeColor != null) {
      _strokePaint.color =
          (_series.opacity < 1 && _strokeColor != Colors.transparent)
              ? _strokeColor!.withOpacity(_series.opacity)
              : _strokeColor!;
    }
  } else {
    _strokePaint.shader = _series.gradient!
        .createShader(_seriesRenderer._segmentPath!.getBounds());
  }
  _strokePaint.strokeWidth = _strokeWidth!;
  _strokePaint.style = PaintingStyle.stroke;
  _strokePaint.strokeCap = StrokeCap.round;
  _defaultStrokeColor = _strokePaint;
  return _strokePaint;
}