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: StepperTypeThe type of stepper that determines the layout.
current_step: usizeThe 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: ClipThe 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
impl Stepper
Sourcepub fn new(steps: Vec<Step>) -> Stepper
pub fn new(steps: Vec<Step>) -> Stepper
Creates a stepper from a list of steps; Dart’s optional named arguments are the setters.
Sourcepub fn physics(self, physics: ScrollPhysicsRef) -> Stepper
pub fn physics(self, physics: ScrollPhysicsRef) -> Stepper
Dart Stepper(physics:).
Sourcepub fn controller(self, controller: ScrollControllerRef) -> Stepper
pub fn controller(self, controller: ScrollControllerRef) -> Stepper
Dart Stepper(controller:).
Sourcepub fn type(self, type: StepperType) -> Stepper
pub fn type(self, type: StepperType) -> Stepper
Dart Stepper(type:).
Sourcepub fn current_step(self, current_step: usize) -> Stepper
pub fn current_step(self, current_step: usize) -> Stepper
Dart Stepper(currentStep:).
Sourcepub fn on_step_tapped(self, on_step_tapped: ValueChanged<usize>) -> Stepper
pub fn on_step_tapped(self, on_step_tapped: ValueChanged<usize>) -> Stepper
Dart Stepper(onStepTapped:).
Sourcepub fn on_step_continue(self, on_step_continue: Listener) -> Stepper
pub fn on_step_continue(self, on_step_continue: Listener) -> Stepper
Dart Stepper(onStepContinue:).
Sourcepub fn on_step_cancel(self, on_step_cancel: Listener) -> Stepper
pub fn on_step_cancel(self, on_step_cancel: Listener) -> Stepper
Dart Stepper(onStepCancel:).
Sourcepub fn controls_builder(
self,
controls_builder: ControlsWidgetBuilder,
) -> Stepper
pub fn controls_builder( self, controls_builder: ControlsWidgetBuilder, ) -> Stepper
Dart Stepper(controlsBuilder:).
Sourcepub fn margin(self, margin: impl Into<EdgeInsetsGeometry>) -> Stepper
pub fn margin(self, margin: impl Into<EdgeInsetsGeometry>) -> Stepper
Dart Stepper(margin:).
Sourcepub fn connector_color(
self,
connector_color: WidgetStatePropertyRef<Color>,
) -> Stepper
pub fn connector_color( self, connector_color: WidgetStatePropertyRef<Color>, ) -> Stepper
Dart Stepper(connectorColor:).
Sourcepub fn connector_thickness(self, connector_thickness: f64) -> Stepper
pub fn connector_thickness(self, connector_thickness: f64) -> Stepper
Dart Stepper(connectorThickness:).
Sourcepub fn step_icon_builder(self, step_icon_builder: StepIconBuilder) -> Stepper
pub fn step_icon_builder(self, step_icon_builder: StepIconBuilder) -> Stepper
Dart Stepper(stepIconBuilder:).
Sourcepub fn step_icon_height(self, step_icon_height: f64) -> Stepper
pub fn step_icon_height(self, step_icon_height: f64) -> Stepper
Dart Stepper(stepIconHeight:).
Sourcepub fn step_icon_width(self, step_icon_width: f64) -> Stepper
pub fn step_icon_width(self, step_icon_width: f64) -> Stepper
Dart Stepper(stepIconWidth:).
Sourcepub fn step_icon_margin(self, step_icon_margin: EdgeInsets) -> Stepper
pub fn step_icon_margin(self, step_icon_margin: EdgeInsets) -> Stepper
Dart Stepper(stepIconMargin:).
Sourcepub fn clip_behavior(self, clip_behavior: Clip) -> Stepper
pub fn clip_behavior(self, clip_behavior: Clip) -> Stepper
Dart Stepper(clipBehavior:).
Sourcepub fn header_padding(
self,
header_padding: impl Into<EdgeInsetsGeometry>,
) -> Stepper
pub fn header_padding( self, header_padding: impl Into<EdgeInsetsGeometry>, ) -> Stepper
Dart Stepper(headerPadding:).
Sourcepub fn content_padding(
self,
content_padding: impl Into<EdgeInsetsGeometry>,
) -> Stepper
pub fn content_padding( self, content_padding: impl Into<EdgeInsetsGeometry>, ) -> Stepper
Dart Stepper(contentPadding:).
Trait Implementations§
Source§impl StatefulWidget for Stepper
impl StatefulWidget for Stepper
Source§type State = StepperState
type State = StepperState
Source§fn create_state(&self) -> StepperState
fn create_state(&self) -> StepperState
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 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 Stepper
impl !Send for Stepper
impl !Sync for Stepper
impl !UnwindSafe for Stepper
impl Forget for Stepper
impl Freeze for Stepperwhere
*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 Stepperwhere
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 Stepperwhere
*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> 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.