Progress constructor

const Progress({
  1. Key? key,
  2. double? progress,
  3. double min = 0.0,
  4. double max = 1.0,
  5. bool disableAnimation = false,
  6. Color? color,
  7. Color? backgroundColor,
})

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 indeterminate
  • min (double, default: 0.0): Minimum progress value
  • max (double, default: 1.0): Maximum progress value
  • disableAnimation (bool, default: false): Whether to disable smooth transitions
  • color (Color?, optional): Progress fill color override
  • backgroundColor (Color?, optional): Progress track color override

Throws:

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');