pub enum MaterialBannerClosedReason {
Dismiss,
Swipe,
Hide,
Remove,
}Expand description
Specify how a MaterialBanner was closed.
The ScaffoldMessengerState::show_material_banner function returns a
ScaffoldFeatureController. The value of the controller’s closed property
is a future that resolves to a MaterialBannerClosedReason. Applications that need
to know how a MaterialBanner was closed can use this value.
Example:
ScaffoldMessenger::of(app, context)
.show_material_banner(app, MaterialBanner::new(Text::new("Message..."), vec![/* ... */]))
.closed()
.then(app, |app, reason: MaterialBannerClosedReason| {
// ...
});Variants§
Dismiss
The material banner was closed through a SemanticsAction.dismiss.
Swipe
The material banner was closed by a user’s swipe.
Hide
The material banner was closed by the ScaffoldFeatureController close callback
or by calling ScaffoldMessengerState::hide_current_material_banner directly.
Remove
The material banner was closed by a call to
ScaffoldMessengerState::remove_current_material_banner.
Trait Implementations§
Source§impl Clone for MaterialBannerClosedReason
impl Clone for MaterialBannerClosedReason
impl Copy for MaterialBannerClosedReason
Source§impl Debug for MaterialBannerClosedReason
impl Debug for MaterialBannerClosedReason
impl Eq for MaterialBannerClosedReason
impl StructuralPartialEq for MaterialBannerClosedReason
Auto Trait Implementations§
impl Forget for MaterialBannerClosedReason
impl Freeze for MaterialBannerClosedReason
impl Move for MaterialBannerClosedReason
impl RefUnwindSafe for MaterialBannerClosedReason
impl Send for MaterialBannerClosedReason
impl Sync for MaterialBannerClosedReason
impl Unpin for MaterialBannerClosedReason
impl UnsafeUnpin for MaterialBannerClosedReason
impl UnwindSafe for MaterialBannerClosedReason
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
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
Compare self to
key and return true if they are equal.