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) {
   // ...
});
Inheritance

Constructors

MaterialBannerClosedReason()
const

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

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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.