Circular Progress
import 'dart:async';
import 'package:flutter/material.dart';
double percentage = 0;
void initState() {
Timer.periodic(const Duration(milliseconds: 200), (timer) {
percentage += 5;
setState(() {});
if (percentage == 100) timer.cancel();
});
super.initState();
}
SizedBox.fromSize(
size: const Size.square(80),
child: Stack(
children: [
Positioned.fill(
child: CircularProgressIndicator(
backgroundColor: Colors.blue.shade100,
color: Colors.blue,
strokeWidth: 6,
strokeCap: StrokeCap.round,
value: percentage / 100,
),
),
Center(
child: Text(
'${percentage.round()}%',
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
),
],
),
),