I have the following drawer. it works as it should as long as i only want to hop between the widgets of my main drawer items.
but inside those widgets i want to route to a new one, with a button click for example, while the drawer stays in my corner. So basically is there any way to reproduce a sticky android drawer in flutter ?
Since the two widgets are
independent of each other
, youcannot
use the same exactDrawer
in the second widget.Either you can create the exact copy of that
Drawer
in second one and open it oninitState
method orif possible
instead of switching to the second, you can make thesecond widget
as asubview
insidefirstWidget
.Drawer
is aScaffold
property.So when you go to another page you will normally have another
Scaffold
widget with its ownDrawer
and the previous one will be disposed.In the new page you need to create and display the
Drawer
for thisScaffold
but you can't keep the previous one in the corner.