MaterialBannerClosedReason enum
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(
const MaterialBanner(
content: Text('Message...'),
actions: <Widget>[
// ...
],
)
).closed.then((MaterialBannerClosedReason reason) {
// ...
});
Values
- dismiss → const MaterialBannerClosedReason
-
The material banner was closed through a SemanticsAction.dismiss.
- swipe → const MaterialBannerClosedReason
-
The material banner was closed by a user's swipe.
- hide → const MaterialBannerClosedReason
-
The material banner was closed by the ScaffoldFeatureController close callback or by calling ScaffoldMessengerState.hideCurrentMaterialBanner directly.
- remove → const MaterialBannerClosedReason
-
The material banner was closed by a call to ScaffoldMessengerState.removeCurrentMaterialBanner.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent 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.