CustomProgressBar constructor

const CustomProgressBar({
  1. Key? key,
  2. required int currentPoints,
  3. required List<int> milestones,
  4. List<String>? labels,
  5. Color progressColor = Colors.blue,
  6. Color trackColor = const Color(0xFFE0E0E0),
  7. Widget? completedIcon,
  8. Widget? pendingIcon,
  9. double iconSize = 24.0,
  10. double lineHeight = 6.0,
  11. Duration animationDuration = const Duration(milliseconds: 500),
  12. Curve animationCurve = Curves.easeInOut,
  13. TextStyle? labelStyle,
  14. dynamic onMilestoneTap(
    1. 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');