I want to open Drawer
programmatically not by sliding it, how to disable that sliding functionality (touch functionality of Drawer)
You'll need to create a GlobalKey
and use openDrawer()
method on it.
GlobalKey _drawerKey = GlobalKey();
@override
Widget build(BuildContext context) {
return Scaffold(
key: _drawerKey, // assign key to Scaffold
drawer: Drawer(),
floatingActionButton: FloatingActionButton(
onPressed: () => _drawerKey.currentState.openDrawer(), // open drawer
),
);
}