
Hey, what’s up, guys. In this post, we will see how we can use a Drawer in Flutter that helps us in navigation.
Let’s see the steps and code to add a drawer to our app.
To create a drawer, follow these steps.
- First, we will create a Scaffold. Why? Because it supports some material design components such as Drawers, AppBars, and SnackBars that are specific to the scaffold.
- Add a drawer to the scaffold.
- Add items to the drawer
- After a user taps an item, close the drawer
Now let’s see the code.
(You can see the full code here – FlutterDrawerExample)
Output :

You can see in the above code that I have created a scaffold first and then added the drawer to the scaffold. Just one thing here – You can also use a Column widget to show the drawer items but using a ListView is much better because it allows you to scroll through the drawer if the items are more than the space available.
That’s all about Drawer in flutter.
Goodbye.
Leave a Reply