Using this action, you can open and close the drawers with a tap of a button. For example, opening the drawer from the widget placed outside the Appbar and closing it from the widget placed inside the drawer.
Opening and closing drawer on tap of IconButton
Before you add the drawer action, you'll need to have a drawer widget on a page. If you haven't already done so, you can learn how to add a drawer.
There are three types of actions you can add to the drawer.
- 3.Close Drawers: Closes all the open drawers.
Go to your project page on FlutterFlow and follow the steps below to define the Action to any widget.
- Select the Widget (e.g. IconButton, Button) on which you want to define the action.
- Select Actions from the Properties panel (the right menu), and click Open. This will open an Action flow Editor in a new popup window.
- Click on the + Add Action.
- On the right side, search and select the Drawer action.
- Select the Drawer Action Type among the Open Drawer, Open End Drawer, and Close Drawers.
- Click Close.
Adding drawer action