Progress constructor
const
Progress({})
Creates a Progress indicator.
The progress value must be between min
and max
when provided.
If progress is null, the indicator shows indeterminate animation.
Parameters:
progress
(double?, optional): Current progress value or null for indeterminatemin
(double, default: 0.0): Minimum progress valuemax
(double, default: 1.0): Maximum progress valuedisableAnimation
(bool, default: false): Whether to disable smooth transitionscolor
(Color?, optional): Progress fill color overridebackgroundColor
(Color?, optional): Progress track color override
Throws:
- AssertionError if progress is not between min and max values.
Example:
Progress(
progress: 75,
min: 0,
max: 100,
color: Colors.green,
);
Implementation
const Progress({
super.key,
this.progress,
this.min = 0.0,
this.max = 1.0,
this.disableAnimation = false,
this.color,
this.backgroundColor,
}) : assert(progress == null || progress >= min && progress <= max,
'Progress must be between min and max');