1
I’m Getting an Application in Flutter
, added to my HomePage
one DrawerMenu
, It works well, but when I access another page, I wish the menu could be opened from anyone.
I saw some examples creating the Drawer
in separate files, but I couldn’t put in my project.
Meu Drawer:
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
child: Image.asset("assets/quadro.jpg"),
decoration: BoxDecoration(
color: Colors.white24,
),
),
ListTile(
leading: Icon(Icons.home),
title: Text('Home'),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HomePage(),
),
);
}),
ListTile(
title: Text('Item 2'),
onTap: () {},
),
],
),
)
Great Leonardo, it worked very well this, the stacking part I will rethink further, for now having the menu accessed from any screen already helps me a lot. Thank you.
– Luan Martins Gepfrie