pub struct SimpleDialog<Msg = Callback> { /* private fields */ }Expand description
A dialog that offers a choice: a title, and a list of options to pick from.
The one the reference calls simple, and the difference from AlertDialog is what it
is for: an alert dialog asks a question and puts the answers in a row of buttons at the
bottom, this one lists them and each row is an answer.
Implementations§
Source§impl<Msg: Clone + 'static> SimpleDialog<Msg>
impl<Msg: Clone + 'static> SimpleDialog<Msg>
Sourcepub fn on_dismiss(self, message: impl Into<Msg>) -> Self
pub fn on_dismiss(self, message: impl Into<Msg>) -> Self
What a click on the scrim sends — see Dialog::on_dismiss.
Sourcepub fn title_widget(self, title: impl Widget<Msg> + 'static) -> Self
pub fn title_widget(self, title: impl Widget<Msg> + 'static) -> Self
The heading, as a widget.
Sourcepub fn title_text_style(self, style: TextStyle) -> Self
pub fn title_text_style(self, style: TextStyle) -> Self
The heading’s type. headlineSmall by default, as AlertDialog’s is.
Sourcepub fn title_padding(self, padding: Insets) -> Self
pub fn title_padding(self, padding: Insets) -> Self
The space around the heading.
Sourcepub fn content_padding(self, padding: Insets) -> Self
pub fn content_padding(self, padding: Insets) -> Self
The space around the list of options. No side padding by default: an option is a full-width row that pads itself.
Sourcepub fn content_text_style(self, style: TextStyle) -> Self
pub fn content_text_style(self, style: TextStyle) -> Self
What the options are set in. bodyMedium by default.
Sourcepub fn option(self, option: impl Widget<Msg> + 'static) -> Self
pub fn option(self, option: impl Widget<Msg> + 'static) -> Self
Adds an option — usually a SimpleDialogOption.
Sourcepub fn background(self, color: Color) -> Self
pub fn background(self, color: Color) -> Self
The surface’s colour — see Dialog::background.
Sourcepub fn elevation(self, elevation: f32) -> Self
pub fn elevation(self, elevation: f32) -> Self
How far off the page it sits — see Dialog::elevation.
Sourcepub fn shape(self, shape: ShapeBorder) -> Self
pub fn shape(self, shape: ShapeBorder) -> Self
What shape it is — see Dialog::shape.
Sourcepub fn inset_padding(self, padding: Insets) -> Self
pub fn inset_padding(self, padding: Insets) -> Self
How far off the window’s edges — see Dialog::inset_padding.