Duration

seconds:

),

action:

SnackBarAction

label:

'ACTION'

onPressed:

()

},

),

));

},

child:

const

Text

'SHOW SNACK'

),

),

);

When presenting a SnackBar during a transition,
the SnackBar completes a Hero animation,
moving smoothly to the next page.

The method debugCheckHasScaffoldMessenger is available to assert
that a given context has a ScaffoldMessenger ancestor.
Trying to present  a SnackBar without a ScaffoldMessenger ancestor
present results in an assertion such as the following:

Migration guide