I want to open Drawer programmatically not by sliding it, how to disable that sliding functionality (touch functionality of Drawer)
To disable the slide to open functionality you can set the property endDrawerEnableOpenDragGesture on Scaffold to false.
@override
Widget build(BuildContext context) {
return Scaffold(
endDrawerEnableOpenDragGesture: false, // THIS WAY IT WILL NOT OPEN
drawer: Drawer(),
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {
Scaffold.of(context).openDrawer();
},
),
),
);
}