Closed adar2378 closed 5 years ago
Solved the issue by using IndexedStack like this:
return SimpleHiddenDrawer(
menu: Menu(),
screenSelectedBuilder: (position, controller) {
return IndexedStack(
index: position,
children: <Widget>[
HomePage(onPressed: () { controller.toggle(); }),
MapPage(onPressed: () { controller.toggle(); }),
],
);
},
);
I think this concept is worth to be included in bundle of hidden_drawer_menu; For example as a parameter keepWidgetsAlive: bool, and if it is true - use IndexedStack behind the scene
In the moment the soluction submited for @elisar4 looks good. I'm going to improve soon!
Each of the ScreenHiddenDrawer is rebuilding each time I change the the screen from the drawer. How can stop rebuilding it? Tried to include automatickeepalivemixin in each of the screens but not working!