LinearPainter constructor

LinearPainter({dynamic lineWidth, dynamic progress, Color progressColor, Color backgroundColor, LinearStrokeCap linearStrokeCap: LinearStrokeCap.butt })

Implementation

LinearPainter(
    {this.lineWidth,
    this.progress,
    this.progressColor,
    this.backgroundColor,
    this.linearStrokeCap = LinearStrokeCap.butt}) {
  _paintBackground.color = backgroundColor;
  _paintBackground.style = PaintingStyle.stroke;
  _paintBackground.strokeWidth = lineWidth;

  _paintLine.color = progressColor;
  _paintLine.style = PaintingStyle.stroke;
  _paintLine.strokeWidth = lineWidth;
  if (linearStrokeCap == LinearStrokeCap.round) {
    _paintLine.strokeCap = StrokeCap.round;
  } else if (linearStrokeCap == LinearStrokeCap.butt) {
    _paintLine.strokeCap = StrokeCap.butt;
  } else {
    _paintLine.strokeCap = StrokeCap.round;
    _paintBackground.strokeCap = StrokeCap.round;
  }
}