currentState

showSnackBar

mySnackBar

);

scaffoldMessengerKey

currentState

hideCurrentSnackBar

mySnackBar

);

scaffoldMessengerKey

currentState

removeCurrentSnackBar

mySnackBar

);

// The root ScaffoldMessenger can also be accessed by providing a key to

// MaterialApp.scaffoldMessengerKey. This way, the ScaffoldMessengerState can be directly accessed

// without first obtaining it from a BuildContext via ScaffoldMessenger.of. From the key, use

// the GlobalKey.currentState getter.

final

GlobalKey