pub struct SimpleDialogOption<Msg = Callback> { /* private fields */ }Expand description
One row of a SimpleDialog: a full-width option that answers the question by being
chosen.
It is a widget of its own rather than a closure argument for the reason the reference makes it one — the row is the tappable thing, and its ink has to run the full width of the dialog, which only a widget that is the row can do.
Implementations§
Source§impl<Msg: Clone + 'static> SimpleDialogOption<Msg>
impl<Msg: Clone + 'static> SimpleDialogOption<Msg>
Sourcepub fn new(label: impl Into<String>, message: Msg) -> Self
pub fn new(label: impl Into<String>, message: Msg) -> Self
An option showing label, sending message when it is chosen.
Sourcepub fn with_child(child: impl Widget<Msg> + 'static) -> Self
pub fn with_child(child: impl Widget<Msg> + 'static) -> Self
The same, with a widget in place of the text.
Sourcepub fn on_press(self, message: impl Into<Msg>) -> Self
pub fn on_press(self, message: impl Into<Msg>) -> Self
What choosing it sends. Without one it cannot be chosen, which is the reference’s
null onPressed.
Auto Trait Implementations§
impl<Msg = Callback> !RefUnwindSafe for SimpleDialogOption<Msg>
impl<Msg = Callback> !Send for SimpleDialogOption<Msg>
impl<Msg = Callback> !Sync for SimpleDialogOption<Msg>
impl<Msg = Callback> !UnwindSafe for SimpleDialogOption<Msg>
impl<Msg> Freeze for SimpleDialogOption<Msg>
impl<Msg> Unpin for SimpleDialogOption<Msg>
impl<Msg> UnsafeUnpin for SimpleDialogOption<Msg>
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
Mutably borrows from an owned value. Read more