Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to close Scaffold's drawer after an item tap?

Tags:

flutter

dart

After I tap an item in the Scaffold's drawer I want it to automatically hide itself. How do I do it in Flutter?

like image 397
DogeLion Avatar asked May 05 '17 14:05

DogeLion


People also ask

How do you close the drawer after clicking the flutter?

When a user opens the drawer, Flutter adds the drawer to the navigation stack. Therefore, to close the drawer, call Navigator. pop(context) .

How do you open a flutter drawer?

It can be opened via swipe gesture or by clicking on the menu icon in the app bar. Typically, the navigation drawer opens up from the left side of the screen, but you can also configure it to open from the right side (for the LTR text settings).


1 Answers

Navigator.pop() will pop the Drawer route off the stack and cause it to close.

like image 117
Collin Jackson Avatar answered Oct 06 '22 04:10

Collin Jackson