pub enum SnackBarClosedReason {
Action,
Dismiss,
Swipe,
Hide,
Remove,
Timeout,
}Expand description
Specify how a SnackBar was closed.
The ScaffoldMessengerState::show_snack_bar function returns a
ScaffoldFeatureController. The value of the controller’s closed property
is a future that resolves to a SnackBarClosedReason. Applications that need
to know how a snackbar was closed can use this value.
Example:
ScaffoldMessenger::of(app, context)
.show_snack_bar(app, SnackBar::new(Text::new("He likes me. I think he likes me.")), None)
.closed()
.then(app, |app, reason: SnackBarClosedReason| {
// ...
});Variants§
Action
The snack bar was closed after the user tapped a SnackBarAction.
Dismiss
The snack bar was closed through a SemanticsAction.dismiss.
Swipe
The snack bar was closed by a user’s swipe.
Hide
The snack bar was closed by the ScaffoldFeatureController close callback
or by calling ScaffoldMessengerState::hide_current_snack_bar directly.
Remove
The snack bar was closed by an call to
ScaffoldMessengerState::remove_current_snack_bar.
Timeout
The snack bar was closed because its timer expired.
Trait Implementations§
Source§impl Clone for SnackBarClosedReason
impl Clone for SnackBarClosedReason
impl Copy for SnackBarClosedReason
Source§impl Debug for SnackBarClosedReason
impl Debug for SnackBarClosedReason
impl Eq for SnackBarClosedReason
Source§impl PartialEq for SnackBarClosedReason
impl PartialEq for SnackBarClosedReason
impl StructuralPartialEq for SnackBarClosedReason
Auto Trait Implementations§
impl Forget for SnackBarClosedReason
impl Freeze for SnackBarClosedReason
impl Move for SnackBarClosedReason
impl RefUnwindSafe for SnackBarClosedReason
impl Send for SnackBarClosedReason
impl Sync for SnackBarClosedReason
impl Unpin for SnackBarClosedReason
impl UnsafeUnpin for SnackBarClosedReason
impl UnwindSafe for SnackBarClosedReason
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.