SnackBarClosedReason enum
Specify how a SnackBar was closed.
The ScaffoldState.showSnackBar function returns a ScaffoldFeatureController. The value of the controller's closed property is a Future that resolves to a SnackBarClosedReason. Applications that need to know how a snackbar was closed can use this value.
Example:
Scaffold.of(context).showSnackBar(
SnackBar( ... )
).closed.then((SnackBarClosedReason reason) {
...
});
Constants
- action → const SnackBarClosedReason
-
The snack bar was closed after the user tapped a SnackBarAction.
const SnackBarClosedReason(0) - dismiss → const SnackBarClosedReason
-
The snack bar was closed through a
SemanticAction.dismiss.const SnackBarClosedReason(1) - hide → const SnackBarClosedReason
-
The snack bar was closed by the ScaffoldFeatureController close callback or by calling ScaffoldState.hideCurrentSnackBar directly.
const SnackBarClosedReason(3) - remove → const SnackBarClosedReason
-
The snack bar was closed by an call to ScaffoldState.removeCurrentSnackBar.
const SnackBarClosedReason(4) - swipe → const SnackBarClosedReason
-
The snack bar was closed by a user's swipe.
const SnackBarClosedReason(2) - timeout → const SnackBarClosedReason
-
The snack bar was closed because its timer expired.
const SnackBarClosedReason(5) -
values
→ const List<
SnackBarClosedReason> -
A constant List of the values in this enum, in order of their declaration.
const List<SnackBarClosedReason>
Properties
Methods
-
toString(
) → String -
Returns a string representation of this object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited