ProgressRingPainter constructor

ProgressRingPainter({
  1. required Animation<double> progress,
  2. StrokeCap strokeCap = StrokeCap.butt,
  3. Color circularRingColor = Colors.black38,
  4. Color progressColor = Colors.pinkAccent,
  5. required Size size,
  6. double strokeW = 10,
})

Implementation

ProgressRingPainter(
    {required this.progress,
    this.strokeCap = StrokeCap.butt,
    this.circularRingColor = Colors.black38,
    this.progressColor = Colors.pinkAccent,
    required this.size,
    this.strokeW = 10})
    : super(repaint: progress) {
  Path _path = Path();
  _path.addOval(
    Rect.fromCenter(
        center: const Offset(0, 0),
        width: size.width - strokeW,
        height: size.height - strokeW),
  );
  pathMetric = _path.computeMetrics().first;
  _paint = Paint()
    ..color = circularRingColor
    ..strokeWidth = strokeW
    ..style = PaintingStyle.stroke;

}