Skip to main content

Stepper

Struct Stepper 

Source
pub struct Stepper {
Show 21 fields pub key: Option<KeyRef>, pub steps: Vec<Step>, pub physics: Option<ScrollPhysicsRef>, pub controller: Option<ScrollControllerRef>, pub type: StepperType, pub current_step: usize, pub on_step_tapped: Option<ValueChanged<usize>>, pub on_step_continue: Option<Listener>, pub on_step_cancel: Option<Listener>, pub controls_builder: Option<ControlsWidgetBuilder>, pub elevation: Option<f64>, pub margin: Option<EdgeInsetsGeometry>, pub connector_color: Option<WidgetStatePropertyRef<Color>>, pub connector_thickness: Option<f64>, pub step_icon_builder: Option<StepIconBuilder>, pub step_icon_height: Option<f64>, pub step_icon_width: Option<f64>, pub step_icon_margin: Option<EdgeInsets>, pub clip_behavior: Clip, pub header_padding: Option<EdgeInsetsGeometry>, pub content_padding: Option<EdgeInsetsGeometry>,
}
Expand description

A material stepper widget that displays progress through a sequence of steps.

Steppers are particularly useful in the case of forms where one step requires the completion of another one, or where multiple steps need to be completed in order to submit the whole form.

The widget is a flexible wrapper. A parent class should pass current_step to this widget based on some logic triggered by the three callbacks that it provides.

Fields§

§key: Option<KeyRef>§steps: Vec<Step>

The steps of the stepper whose titles, subtitles and icons always get shown.

The length of steps must not change.

§physics: Option<ScrollPhysicsRef>

How the stepper’s scroll view should respond to user input.

§controller: Option<ScrollControllerRef>

An object that can be used to control the position to which the scroll view is scrolled.

§type: StepperType

The type of stepper that determines the layout.

§current_step: usize

The index into steps of the current step whose content is displayed.

§on_step_tapped: Option<ValueChanged<usize>>

The callback called when a step is tapped, with its index passed as an argument.

§on_step_continue: Option<Listener>

The callback called when the ‘continue’ button is tapped.

§on_step_cancel: Option<Listener>

The callback called when the ‘cancel’ button is tapped.

§controls_builder: Option<ControlsWidgetBuilder>

The callback for creating custom controls.

§elevation: Option<f64>

The elevation of this stepper’s material when r#type is StepperType::Horizontal.

§margin: Option<EdgeInsetsGeometry>

Custom margin on a vertical stepper.

§connector_color: Option<WidgetStatePropertyRef<Color>>

Customize the connected lines’ colors.

Resolves in the following states: WidgetState::Selected and WidgetState::Disabled.

§connector_thickness: Option<f64>

The thickness of the connecting lines.

§step_icon_builder: Option<StepIconBuilder>

Callback for creating custom icons for the steps.

§step_icon_height: Option<f64>

Overrides the default step icon size height.

§step_icon_width: Option<f64>

Overrides the default step icon size width.

§step_icon_margin: Option<EdgeInsets>

Overrides the default step icon margin.

§clip_behavior: Clip

The Step::content will be clipped to this Clip type.

§header_padding: Option<EdgeInsetsGeometry>

The padding around the header row in both StepperType::Vertical and StepperType::Horizontal steppers.

§content_padding: Option<EdgeInsetsGeometry>

The padding around the content area in both stepper types.

Implementations§

Source§

impl Stepper

Source

pub fn new(steps: Vec<Step>) -> Stepper

Creates a stepper from a list of steps; Dart’s optional named arguments are the setters.

Source

pub fn key(self, key: KeyRef) -> Stepper

Dart Stepper(key:).

Source

pub fn physics(self, physics: ScrollPhysicsRef) -> Stepper

Dart Stepper(physics:).

Source

pub fn controller(self, controller: ScrollControllerRef) -> Stepper

Dart Stepper(controller:).

Source

pub fn type(self, type: StepperType) -> Stepper

Dart Stepper(type:).

Source

pub fn current_step(self, current_step: usize) -> Stepper

Dart Stepper(currentStep:).

Source

pub fn on_step_tapped(self, on_step_tapped: ValueChanged<usize>) -> Stepper

Dart Stepper(onStepTapped:).

Source

pub fn on_step_continue(self, on_step_continue: Listener) -> Stepper

Dart Stepper(onStepContinue:).

Source

pub fn on_step_cancel(self, on_step_cancel: Listener) -> Stepper

Dart Stepper(onStepCancel:).

Source

pub fn controls_builder( self, controls_builder: ControlsWidgetBuilder, ) -> Stepper

Dart Stepper(controlsBuilder:).

Source

pub fn elevation(self, elevation: f64) -> Stepper

Dart Stepper(elevation:).

Source

pub fn margin(self, margin: impl Into<EdgeInsetsGeometry>) -> Stepper

Dart Stepper(margin:).

Source

pub fn connector_color( self, connector_color: WidgetStatePropertyRef<Color>, ) -> Stepper

Dart Stepper(connectorColor:).

Source

pub fn connector_thickness(self, connector_thickness: f64) -> Stepper

Dart Stepper(connectorThickness:).

Source

pub fn step_icon_builder(self, step_icon_builder: StepIconBuilder) -> Stepper

Dart Stepper(stepIconBuilder:).

Source

pub fn step_icon_height(self, step_icon_height: f64) -> Stepper

Dart Stepper(stepIconHeight:).

Source

pub fn step_icon_width(self, step_icon_width: f64) -> Stepper

Dart Stepper(stepIconWidth:).

Source

pub fn step_icon_margin(self, step_icon_margin: EdgeInsets) -> Stepper

Dart Stepper(stepIconMargin:).

Source

pub fn clip_behavior(self, clip_behavior: Clip) -> Stepper

Dart Stepper(clipBehavior:).

Source

pub fn header_padding( self, header_padding: impl Into<EdgeInsetsGeometry>, ) -> Stepper

Dart Stepper(headerPadding:).

Source

pub fn content_padding( self, content_padding: impl Into<EdgeInsetsGeometry>, ) -> Stepper

Dart Stepper(contentPadding:).

Trait Implementations§

Source§

impl Clone for Stepper

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Stepper

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StatefulWidget for Stepper

Source§

type State = StepperState

The state this widget creates.
Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn create_state(&self) -> StepperState

Creates the mutable state for this widget at a given location in the tree. Read more
Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s 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 debug_check_constructor(&self)

Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Source§

fn type_name(&self) -> &'static str

See 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 Stepper

§

impl !Send for Stepper

§

impl !Sync for Stepper

§

impl !UnwindSafe for Stepper

§

impl Forget for Stepper

§

impl Freeze for Stepper
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const u8 is !null: Freeze, PhantomData<Step>: Freeze, *const RcInner<dyn ScrollPhysics> is !null: Freeze, PhantomData<RcInner<dyn ScrollPhysics>>: Freeze, NonZero<u32>: Freeze, &'static ScrollControllerVTable: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, *const RcInner<dyn Fn(&mut App, usize)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, usize)>>: Freeze, *const RcInner<dyn Fn(&mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze, *const (): Freeze, *const RcInner<dyn Fn(&mut App, AnyElement, ControlsDetails) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, ControlsDetails) -> Rc<dyn Widget>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Color>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Color>>>: Freeze, *const RcInner<dyn Fn(usize, StepState) -> Option<Rc<dyn Widget>>> is !null: Freeze, PhantomData<RcInner<dyn Fn(usize, StepState) -> Option<Rc<dyn Widget>>>>: Freeze,

§

impl Move for Stepper

§

impl Unpin for Stepper
where Rc<dyn Key>: Unpin, *const u8 is !null: Unpin, Rc<dyn Widget>: Unpin, Rc<dyn BoxBorder>: Unpin, Rc<dyn Gradient>: Unpin, &'static dyn ColorExtension: Unpin, Rc<dyn ColorExtension>: Unpin, Rc<Paint>: Unpin, Rc<dyn ScrollPhysics>: Unpin, NonZero<u32>: Unpin, &'static ScrollControllerVTable: Unpin, Rc<Keep>: Unpin, Rc<dyn Fn(&mut App, usize)>: Unpin, Rc<dyn Fn(&mut App)>: Unpin, *const (): Unpin, Rc<dyn Fn(&mut App, AnyElement, ControlsDetails) -> Rc<dyn Widget>>: Unpin, Rc<dyn WidgetStateProperty<Color>>: Unpin, Rc<dyn Fn(usize, StepState) -> Option<Rc<dyn Widget>>>: Unpin,

§

impl UnsafeUnpin for Stepper
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Step>: UnsafeUnpin, *const RcInner<dyn ScrollPhysics> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ScrollPhysics>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, &'static ScrollControllerVTable: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, usize)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, usize)>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin, *const (): UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement, ControlsDetails) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, ControlsDetails) -> Rc<dyn Widget>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Color>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Color>>>: UnsafeUnpin, *const RcInner<dyn Fn(usize, StepState) -> Option<Rc<dyn Widget>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(usize, StepState) -> Option<Rc<dyn Widget>>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W> IntoWidget<StatefulKind> for W
where W: StatefulWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>