Open knnkrt opened 3 years ago
How are you making your routes?
How are you making your routes?
See my example with BottomNavigationBar: https://github.com/jonataslaw/getx/issues/799#issuecomment-730719165
I'd like to add to this and ask, how can I keep my nested pages state when navigating away and coming back. For example scroll to point 100 on page "/settings", go to another tab on navbar and back to settings then the scroll position should be the same? #799 works great but my pages return to previous state. I've read #23 that GetObserver might be an option...
Doing the below keeps my pages state when navigating. Works really well.
Scaffold(
extendBodyBehindAppBar: true,
extendBody: true,
body: PageView(
key: PageStorageKey('storage-key'),
controller: Get.find<NavigationController>().pageController,
scrollDirection: Axis.horizontal,
//physics: NeverScrollableScrollPhysics(),
pageSnapping: true,
children: Get.find<NavigationController>().pageWidgets,
),
Adding Navigator with a Get.nestedKey(1) key and using Get.to(() => page, id:1, transition: Transition.cupertino); to navigate to nested pages causes my pages to reload when onGenerateRoute: is called.
The reason I would like to combine these 2, PageView and Navigator, so that my pages state stay as is when navigating away and returning and also my nested subpages load behind my navbar, navbar is always visible. But combining the 2 is not successful so far.
Any help would really be appreciated. Any other solution would also be great.
@gordonlotter I am stuck on creating a working nested navigation https://github.com/jonataslaw/getx/issues/1157#issue-823654841 and can't find any solution. Would you mind sharing a gist of your nested navigation implementation please ?
pump this, I got the same issue
same issue
same issue
Same issue.
same issue too
Same issue, has anyone found a solution?
Get.to(AnyPage(), id: 1);
works perfectly in Nested Navigation but,Get.toNamed('/any', id: 1);
doesn't work and returning existing page. @jonataslaw