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 line series should be greater than or equal to 0.');
  assert(_series.opacity <= 1,
      'The opacity value of the line series should be less than or equal to 1.');
  if (_strokeColor != null) {
    strokePaint.color = _pointColorMapper ?? _strokeColor!;
    strokePaint.color =
        (_series.opacity < 1 && strokePaint.color != Colors.transparent)
            ? strokePaint.color.withOpacity(_series.opacity)
            : strokePaint.color;
  }
  strokePaint.strokeWidth = _strokeWidth!;
  strokePaint.style = PaintingStyle.stroke;
  strokePaint.strokeCap = StrokeCap.round;
  _defaultStrokeColor = strokePaint;
  return strokePaint;
}