pub struct CircularProgressIndicator {
pub progress_indicator: ProgressIndicatorData,
pub stroke_width: Option<f64>,
pub stroke_align: Option<f64>,
pub stroke_cap: Option<StrokeCap>,
pub constraints: Option<BoxConstraints>,
pub track_gap: Option<f64>,
pub year2023: Option<bool>,
pub padding: Option<EdgeInsetsGeometry>,
pub controller: Option<Ref<AnimationController>>,
/* private fields */
}Expand description
A Material Design circular progress indicator, which spins to indicate that the application is busy.
A widget that shows progress along a circle. There are two kinds of circular progress indicators:
- Determinate. Determinate progress indicators have a specific value at
each point in time, and the value should increase monotonically from 0.0
to 1.0, at which time the indicator is complete. To create a determinate
progress indicator, use a non-null
valuebetween 0.0 and 1.0. - Indeterminate. Indeterminate progress indicators do not have a specific
value at each point in time and instead indicate that progress is being
made without indicating how much progress remains. To create an
indeterminate progress indicator, use a null
value.
The indicator arc is displayed with value_color, an animated value. To
specify a constant color use: AlwaysStoppedAnimation::new(Some(color)).
For synchronizing the animations of several indicators, see
LinearProgressIndicator’s “Animation synchronization”.
See also:
LinearProgressIndicator, which displays progress along a line.RefreshIndicator, which automatically displays aCircularProgressIndicatorwhen the underlying vertical scrollable is overscrolled.- https://material.io/design/components/progress-indicators.html#circular-progress-indicators
Fields§
§progress_indicator: ProgressIndicatorDataThe base class’s fields.
Its background_color is the color of the circular track being filled by the
circular indicator. If it is null then the ambient
ProgressIndicatorThemeData::circular_track_color will be used. If that is null,
then the track will not be painted.
stroke_width: Option<f64>The width of the line used to draw the circle.
stroke_align: Option<f64>The relative position of the stroke on a CircularProgressIndicator.
Values typically range from -1.0 (STROKE_ALIGN_INSIDE,
inside stroke) to 1.0 (STROKE_ALIGN_OUTSIDE, outside
stroke), without any bound constraints (e.g., a value of -2.0 is not typical, but
allowed). A value of 0 (STROKE_ALIGN_CENTER) will center
the border on the edge of the widget.
If year2023 is true, then the default value is
STROKE_ALIGN_CENTER. Otherwise, the default value is
STROKE_ALIGN_INSIDE.
stroke_cap: Option<StrokeCap>The progress indicator’s line ending.
This determines the shape of the stroke ends of the progress indicator.
By default, stroke_cap is null.
When value is null (indeterminate), the stroke ends are set to
StrokeCap::Square. When value is not null, the stroke
ends are set to StrokeCap::Butt.
Setting stroke_cap to StrokeCap::Round will result in a rounded end.
Setting stroke_cap to StrokeCap::Butt with value == null will
result in a slightly different indeterminate animation; the indicator completely
disappears and reappears on its minimum value.
Setting stroke_cap to StrokeCap::Square with value != null will
result in a different display of value. The indicator will start
drawing from slightly less than the start, and end slightly after
the end. This will produce an alternative result, as the
default behavior, for example, that a value of 0.5 starts at 90 degrees
and ends at 270 degrees. With StrokeCap::Square, it could start 85
degrees and end at 275 degrees.
constraints: Option<BoxConstraints>Defines minimum and maximum sizes for a CircularProgressIndicator.
If null, then the ProgressIndicatorThemeData::constraints will be used.
Otherwise, defaults to a minimum width and height of 36 pixels.
track_gap: Option<f64>The gap between the active indicator and the background track.
If year2023 is true or ThemeData::use_material3 is false, then no
track gap will be drawn.
Set track_gap to 0 to hide the track gap.
If null, then the ProgressIndicatorThemeData::track_gap will be used.
If that is null, then defaults to 4.
year2023: Option<bool>Set this flag to false to opt into the 2024 progress indicator appearance. Defaults to true. In the future, this flag will default to false. Use ProgressIndicatorThemeData to customize individual properties. This feature was deprecated after v3.27.0-0.2.pre.
When true, the CircularProgressIndicator will use the 2023 Material Design 3
appearance.
If null, then the ProgressIndicatorThemeData::year2023 will be used.
If that is null, then defaults to true.
If this is set to false, the CircularProgressIndicator will use the
latest Material Design 3 appearance, which was introduced in December 2023.
If ThemeData::use_material3 is false, then this property is ignored.
padding: Option<EdgeInsetsGeometry>The padding around the indicator track.
If null, then the ProgressIndicatorThemeData::circular_track_padding will be
used. If that is null and year2023 is false, then defaults to
EdgeInsets::all(4.0) padding. Otherwise, defaults to zero padding.
controller: Option<Ref<AnimationController>>An optional AnimationController that controls the animation of this
indeterminate progress indicator; see LinearProgressIndicator::controller.
See also:
CircularProgressIndicator::DEFAULT_ANIMATION_DURATION, default duration for one full cycle of the indeterminate animation.
Implementations§
Source§impl CircularProgressIndicator
impl CircularProgressIndicator
Sourcepub const STROKE_ALIGN_INSIDE: f64 = -1.0
pub const STROKE_ALIGN_INSIDE: f64 = -1.0
The indicator stroke is drawn fully inside of the indicator path.
This is a constant for use with stroke_align.
Sourcepub const STROKE_ALIGN_CENTER: f64 = 0.0
pub const STROKE_ALIGN_CENTER: f64 = 0.0
The indicator stroke is drawn on the center of the indicator path,
with half of the stroke_width on the inside, and the other half
on the outside of the path.
This is a constant for use with stroke_align.
This is the default value for stroke_align.
Sourcepub const STROKE_ALIGN_OUTSIDE: f64 = 1.0
pub const STROKE_ALIGN_OUTSIDE: f64 = 1.0
The indicator stroke is drawn on the outside of the indicator path.
This is a constant for use with stroke_align.
Sourcepub const DEFAULT_ANIMATION_DURATION: Duration
pub const DEFAULT_ANIMATION_DURATION: Duration
The default duration for one full cycle of the indeterminate animation.
During this period, the indicator completes several full rotations.
This duration is used when the widget creates its own AnimationController
because no controller was provided, either directly or through a
ProgressIndicatorTheme.
Sourcepub fn new() -> CircularProgressIndicator
pub fn new() -> CircularProgressIndicator
Creates a circular progress indicator.
The value argument can either be null for an indeterminate
progress indicator, or a non-null value between 0.0 and 1.0 for a
determinate progress indicator.
Sourcepub fn adaptive() -> CircularProgressIndicator
pub fn adaptive() -> CircularProgressIndicator
Creates an adaptive progress indicator that is a
CupertinoActivityIndicator on TargetPlatform::IOS &
TargetPlatform::MacOS and a CircularProgressIndicator in material
theme/non-Apple platforms.
The value_color, stroke_width,
stroke_align, stroke_cap,
semantics_label, semantics_value, track_gap,
year2023 will be ignored on iOS & macOS.
Dart’s CircularProgressIndicator.adaptive has no color parameter: its color is
null, so a color set on it is ignored (effective_color).
Sourcepub fn key(self, key: KeyRef) -> CircularProgressIndicator
pub fn key(self, key: KeyRef) -> CircularProgressIndicator
Dart CircularProgressIndicator(key:).
Sourcepub fn background_color(
self,
background_color: Color,
) -> CircularProgressIndicator
pub fn background_color( self, background_color: Color, ) -> CircularProgressIndicator
Dart CircularProgressIndicator(backgroundColor:).
Sourcepub fn color(self, color: Color) -> CircularProgressIndicator
pub fn color(self, color: Color) -> CircularProgressIndicator
Dart CircularProgressIndicator(color:).
Sourcepub fn value_color(
self,
value_color: AnimationRef<Option<Color>>,
) -> CircularProgressIndicator
pub fn value_color( self, value_color: AnimationRef<Option<Color>>, ) -> CircularProgressIndicator
Dart CircularProgressIndicator(valueColor:).
Sourcepub fn semantics_label(
self,
semantics_label: impl Into<String>,
) -> CircularProgressIndicator
pub fn semantics_label( self, semantics_label: impl Into<String>, ) -> CircularProgressIndicator
Dart CircularProgressIndicator(semanticsLabel:).
Sourcepub fn semantics_value(
self,
semantics_value: impl Into<String>,
) -> CircularProgressIndicator
pub fn semantics_value( self, semantics_value: impl Into<String>, ) -> CircularProgressIndicator
Dart CircularProgressIndicator(semanticsValue:).
Sourcepub fn value(self, value: f64) -> CircularProgressIndicator
pub fn value(self, value: f64) -> CircularProgressIndicator
Dart CircularProgressIndicator(value:).
Sourcepub fn stroke_width(self, stroke_width: f64) -> CircularProgressIndicator
pub fn stroke_width(self, stroke_width: f64) -> CircularProgressIndicator
Dart CircularProgressIndicator(strokeWidth:).
Sourcepub fn stroke_align(self, stroke_align: f64) -> CircularProgressIndicator
pub fn stroke_align(self, stroke_align: f64) -> CircularProgressIndicator
Dart CircularProgressIndicator(strokeAlign:).
Sourcepub fn stroke_cap(self, stroke_cap: StrokeCap) -> CircularProgressIndicator
pub fn stroke_cap(self, stroke_cap: StrokeCap) -> CircularProgressIndicator
Dart CircularProgressIndicator(strokeCap:).
Sourcepub fn constraints(
self,
constraints: BoxConstraints,
) -> CircularProgressIndicator
pub fn constraints( self, constraints: BoxConstraints, ) -> CircularProgressIndicator
Dart CircularProgressIndicator(constraints:).
Sourcepub fn track_gap(self, track_gap: f64) -> CircularProgressIndicator
pub fn track_gap(self, track_gap: f64) -> CircularProgressIndicator
Dart CircularProgressIndicator(trackGap:).
Sourcepub fn year2023(self, year2023: bool) -> CircularProgressIndicator
👎Deprecated: Set this flag to false to opt into the 2024 progress indicator appearance. Defaults to true. In the future, this flag will default to false. Use ProgressIndicatorThemeData to customize individual properties. This feature was deprecated after v3.27.0-0.1.pre.
pub fn year2023(self, year2023: bool) -> CircularProgressIndicator
Set this flag to false to opt into the 2024 progress indicator appearance. Defaults to true. In the future, this flag will default to false. Use ProgressIndicatorThemeData to customize individual properties. This feature was deprecated after v3.27.0-0.1.pre.
Dart CircularProgressIndicator(year2023:).
Sourcepub fn padding(
self,
padding: impl Into<EdgeInsetsGeometry>,
) -> CircularProgressIndicator
pub fn padding( self, padding: impl Into<EdgeInsetsGeometry>, ) -> CircularProgressIndicator
Dart CircularProgressIndicator(padding:).
Sourcepub fn controller(
self,
controller: Ref<AnimationController>,
) -> CircularProgressIndicator
pub fn controller( self, controller: Ref<AnimationController>, ) -> CircularProgressIndicator
Dart CircularProgressIndicator(controller:).
Sourcepub fn effective_color(&self) -> Option<Color>
pub fn effective_color(&self) -> Option<Color>
Dart’s color field: what the color setter was given, and null for an indicator
made with CircularProgressIndicator::adaptive, whose constructor has no color.
Trait Implementations§
Source§impl Clone for CircularProgressIndicator
impl Clone for CircularProgressIndicator
Source§impl Debug for CircularProgressIndicator
impl Debug for CircularProgressIndicator
Source§impl Default for CircularProgressIndicator
impl Default for CircularProgressIndicator
Source§fn default() -> CircularProgressIndicator
fn default() -> CircularProgressIndicator
Source§impl ProgressIndicator for CircularProgressIndicator
impl ProgressIndicator for CircularProgressIndicator
Source§fn progress_indicator_data(&self) -> &ProgressIndicatorData
fn progress_indicator_data(&self) -> &ProgressIndicatorData
ProgressIndicatorData bag.Source§impl StatefulWidget for CircularProgressIndicator
impl StatefulWidget for CircularProgressIndicator
Source§type State = CircularProgressIndicatorState
type State = CircularProgressIndicatorState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn create_state(&self) -> CircularProgressIndicatorState
fn create_state(&self) -> CircularProgressIndicatorState
Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for CircularProgressIndicator
impl !Send for CircularProgressIndicator
impl !Sync for CircularProgressIndicator
impl !UnwindSafe for CircularProgressIndicator
impl Forget for CircularProgressIndicator
impl Freeze for CircularProgressIndicatorwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
NonZero<u32>: Freeze,
&'static AnimationVTable<Option<Color>>: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<fn() -> AnimationController>: Freeze,
impl Move for CircularProgressIndicator
impl Unpin for CircularProgressIndicator
impl UnsafeUnpin for CircularProgressIndicatorwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static AnimationVTable<Option<Color>>: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<fn() -> AnimationController>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.