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 material banner was closed can use this value.

Example:

ScaffoldMessenger.of(context).showMaterialBanner(
  MaterialBanner( ... )
).closed.then((MaterialBannerClosedReason reason) {
   ...
});

Constants

dismiss → const MaterialBannerClosedReason

The material banner was closed through a SemanticsAction.dismiss.

const MaterialBannerClosedReason(0)
hide → const MaterialBannerClosedReason

The material banner was closed by the ScaffoldFeatureController close callback or by calling ScaffoldMessengerState.hideCurrentMaterialBanner directly.

const MaterialBannerClosedReason(2)
remove → const MaterialBannerClosedReason

The material banner was closed by a call to ScaffoldMessengerState.removeCurrentMaterialBanner.

const MaterialBannerClosedReason(3)
swipe → const MaterialBannerClosedReason

The material banner was closed by a user's swipe.

const MaterialBannerClosedReason(1)
values → const List<MaterialBannerClosedReason>

A constant List of the values in this enum, in order of their declaration.

const List<MaterialBannerClosedReason>

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
index int

The integer index of this enum.

final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited