1. Create a Scaffold

When creating apps that follow the Material Design guidelines,
give your apps a consistent visual structure.
In this example, display the SnackBar at the bottom of the screen,
without overlapping other important
widgets, such as the FloatingActionButton.

The Scaffold widget, from the material library,
creates this visual structure and ensures that important
widgets don’t overlap.

2. Display a SnackBar

With the Scaffold in place, display a SnackBar.
First, create a SnackBar, then display it using ScaffoldMessenger.

Note:
  To learn more, watch this short Widget of the Week video on the ScaffoldMessenger widget:

3. Provide an optional action