MaterialBannerClosedReason enum Null safety
Specify how a MaterialBanner was closed.
The ScaffoldMessengerState.showMaterialBanner 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(context).showMaterialBanner(
MaterialBanner( ... )
).closed.then((MaterialBannerClosedReason reason) {
...
});
Constructors
- MaterialBannerClosedReason()
-
const
Values
- dismiss → const MaterialBannerClosedReason
-
The material banner was closed through a SemanticsAction.dismiss.
MaterialBannerClosedReason()
- swipe → const MaterialBannerClosedReason
-
The material banner was closed by a user's swipe.
MaterialBannerClosedReason()
- hide → const MaterialBannerClosedReason
-
The material banner was closed by the ScaffoldFeatureController close callback or by calling ScaffoldMessengerState.hideCurrentMaterialBanner directly.
MaterialBannerClosedReason()
- remove → const MaterialBannerClosedReason
-
The material banner was closed by a call to ScaffoldMessengerState.removeCurrentMaterialBanner.
MaterialBannerClosedReason()
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
MaterialBannerClosedReason> -
A constant List of the values in this enum, in order of their declaration.
[dismiss, swipe, hide, remove]