Using the same widget for multiple routes but maintain state #222
Unanswered
andrewgoldenbracketgg
asked this question in
Q&A
Replies: 1 comment
-
Feel free to disregard, finally figured it out! woot woot |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First I wanted to say thank you for this amazing library, it saved me a lot of time. I come from the web world, specifically react and I am having trouble recreating something I am use to doing in react. I have a "main view" that has a bottom navigation. The main view has 3 pages in it that you can navigate to via the bottom navigation. Each page should be accessible via a unique url (feedback, home, discover). As of right now it loads a new version of MainView() when I click a button on the bottom navigation and it navigates to the new route. My end goal is to have the route change but MainView shouldn't lose it's state. I want to manage the page change via didChangeDependencies in the MainView widget since I am using a PageView widget.
I know that I need to use a GlobalKey but it keeps saying "Multiple widgets used the same GlobalKey" despite me using replace = true in the Fluro navigateTo function.
For context, I have set up my routes / router the same exact way you have in your example.
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions