CirclePainter constructor

CirclePainter({dynamic lineWidth, dynamic progress, @required dynamic radius, Color progressColor, Color backgroundColor, CircularStrokeCap circularStrokeCap: CircularStrokeCap.round })

Implementation

CirclePainter(
    {this.lineWidth,
    this.progress,
    @required this.radius,
    this.progressColor,
    this.backgroundColor,
    this.circularStrokeCap = CircularStrokeCap.round}) {
  _paintBackground.color = backgroundColor;
  _paintBackground.style = PaintingStyle.stroke;
  _paintBackground.strokeWidth = lineWidth;

  _paintLine.color = progressColor;
  _paintLine.style = PaintingStyle.stroke;
  _paintLine.strokeWidth = lineWidth;
  if (circularStrokeCap == CircularStrokeCap.round) {
    _paintLine.strokeCap = StrokeCap.round;
  } else if (circularStrokeCap == CircularStrokeCap.butt) {
    _paintLine.strokeCap = StrokeCap.butt;
  } else {
    _paintLine.strokeCap = StrokeCap.square;
  }
}