CircularProgressIndicator constructor
const
CircularProgressIndicator({})
Creates a CircularProgressIndicator.
The component automatically handles both determinate and indeterminate modes
based on whether value is provided. Size and colors adapt intelligently
based on theme context unless explicitly overridden.
Parameters:
value(double?, optional): Progress completion (0.0-1.0) or null for indeterminatesize(double?, optional): Explicit diameter size overridecolor(Color?, optional): Primary progress arc color overridebackgroundColor(Color?, optional): Background track color overridestrokeWidth(double?, optional): Progress stroke thickness overrideduration(Duration, default: kDefaultDuration): Animation duration for value changesanimated(bool, default: true): Whether to animate progress transitionsonSurface(bool, default: false): Whether displayed on colored background
Example:
CircularProgressIndicator(
value: 0.6,
size: 24.0,
strokeWidth: 2.0,
animated: true,
);
Implementation
const CircularProgressIndicator({
super.key,
this.value,
this.size,
this.color,
this.backgroundColor,
this.strokeWidth,
this.duration = kDefaultDuration,
this.animated = true,
this.onSurface = false,
});