CustomProgressBar constructor
const
CustomProgressBar({
- Key? key,
- required int currentPoints,
- required List<
int> milestones, - List<
String> ? labels, - Color progressColor = Colors.blue,
- Color trackColor = const Color(0xFFE0E0E0),
- Widget? completedIcon,
- Widget? pendingIcon,
- double iconSize = 24.0,
- double lineHeight = 6.0,
- Duration animationDuration = const Duration(milliseconds: 500),
- Curve animationCurve = Curves.easeInOut,
- TextStyle? labelStyle,
- dynamic onMilestoneTap(
- int index
Creates a CustomProgressBar widget.
milestones must have at least 2 values.
labels length must match milestones if provided.
Implementation
const CustomProgressBar({
super.key,
required this.currentPoints,
required this.milestones,
this.labels,
this.progressColor = Colors.blue,
this.trackColor = const Color(0xFFE0E0E0),
this.completedIcon,
this.pendingIcon,
this.iconSize = 24.0,
this.lineHeight = 6.0,
this.animationDuration = const Duration(milliseconds: 500),
this.animationCurve = Curves.easeInOut,
this.labelStyle,
this.onMilestoneTap,
}) : assert(labels == null || labels.length == milestones.length,
'Labels length must match milestones length');