можно через https://dartpad.dev/*)
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  class RingProgress extends StatelessWidget {
                  
                  
                    final int stepsDone = 12600;
                  
                  
                    final int stepsNeed = 20000;
                  
                  
                    const RingProgress({Key? key}) : super(key: key);
                  
                  
                  
                  
                  
                    @override
                  
                  
                    Widget build(BuildContext context) {
                  
                  
                      return Container(child: Stack(
                  
                  
                        alignment: Alignment.center,
                  
                  
                        children: [
                  
                  
                          Container(
                  
                  
                              width: 260,
                  
                  
                              height: 260,
                  
                  
                              decoration: BoxDecoration(
                  
                  
                                color: Colors.grey[300],
                  
                  
                                shape: BoxShape.circle,
                  
                  
                              )),
                  
                  
                          DrawRingWidget(
                  
                  
                            diameter: 250,
                  
                  
                            sweepAngle: (stepsDone / stepsNeed * 360).clamp(0, 360.0),
                  
                  
                            color: Colors.indigo[900],
                  
                  
                          ),
                  
                  
                        ],
                  
                  
                      ),);
                  
                  
                    }
                  
                  
                  }
                  
                  
                  
                  
                  
                  class MyPainter extends CustomPainter {
                  
                  
                    MyPainter(this.sweepAngle, this.color);
                  
                  
                  
                  
                  
                    final double? sweepAngle;
                  
                  
                    final Color? color;
                  
                  
                  
                  
                  
                    @override
                  
                  
                    void paint(Canvas canvas, Size size) {
                  
                  
                      final Paint paint = Paint()
                  
                  
                
Я думал я замарачиваюсь по всякой ерунде...
..strokeCap = StrokeCap.round для Paint() ?
Не счетчик случаем? Типо заполняться должен. со временем
https://pub.dev/packages/circular_countdown_timer
Обсуждают сегодня