);

scaffoldKey

currentState

removeCurrentSnackBar

mySnackBar

);

Code after migration:

// The ScaffoldMessengerState of the current context is used for managing SnackBars.

ScaffoldMessenger

of

context

showSnackBar

mySnackBar

);

ScaffoldMessenger

of

context

hideCurrentSnackBar

mySnackBar

);

ScaffoldMessenger

of

context

removeCurrentSnackBar

mySnackBar

);