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(
  new SnackBar( ... )
).closed.then((SnackBarClosedReason reason) {
   ...
});

Constants

action → const SnackBarClosedReason

The snack bar was closed after the user tapped a SnackBarAction.

const SnackBarClosedReason(0)
hide → const SnackBarClosedReason

The snack bar was closed by the ScaffoldFeatureController close callback or by calling ScaffoldState.hideCurrentSnackBar directly.

const SnackBarClosedReason(2)
remove → const SnackBarClosedReason

The snack bar was closed by an call to ScaffoldState.removeCurrentSnackBar.

const SnackBarClosedReason(3)
swipe → const SnackBarClosedReason

The snack bar was closed by a user's swipe.

const SnackBarClosedReason(1)
timeout → const SnackBarClosedReason

The snack bar was closed because its timer expired.

const SnackBarClosedReason(4)
values → const List<SnackBarClosedReason>

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

const List<SnackBarClosedReason>

Properties

index int

The integer index of this enum.

final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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

Operators

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