Reputation: 43
Want that onTap ListTile of Drawer,drawer closed.
I have used Navigation.pop(context) but it pop whole screen. I have a CustomScaffold with global key.
Upvotes: 0
Views: 419
Reputation: 2021
You can put this code in any onpressed event and you will get a solution.
onPressed: () {
if (_scaffoldKey.currentState.isDrawerOpen)
_scaffoldKey.currentState.openEndDrawer();
else {
_scaffoldKey.currentState.openDrawer();
}
},
Upvotes: 1