Add a drawer.

Populate the drawer with items.

Close the drawer programmatically.

1. Create a Scaffold

To add a drawer to the app, wrap it in a Scaffold widget.
The Scaffold widget provides a consistent visual structure to apps that
follow the Material Design Guidelines.
It also supports special Material Design
components, such as Drawers, AppBars, and SnackBars.

In this example, create a Scaffold with a drawer:

2. Add a drawer

Now add a drawer to the Scaffold. A drawer can be any widget,
but it’s often best to use the Drawer widget from the
material library,
which adheres to the Material Design spec.

3. Populate the drawer with items