csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
442 stars 96 forks source link

Example: Add AutomaticKeepAliveClientMixin to FamilyView #56

Closed rydmike closed 2 years ago

rydmike commented 2 years ago

As example and demo of case:

Add the AutomaticKeepAliveClientMixin to the FamilyView example to demonstrate how to keep state.

csells commented 2 years ago

love this update, @rydmike! can you also add a section to the README re: keeping state on pages during navigation?

rydmike commented 2 years ago

Sure, will do tomorrow, 2:30 am here now, gotta catch some ZzZ now. :)

rydmike commented 2 years ago

@csell I added a section to the readme about "Keeping State" after the "Nested Navigation" section. Also fixed some typos my IDE spellchecker suggested in the readme.

Feel free to review or edit.

I also added an animated GIF showing it working and keeping state with the nest tab view nav. However , due to the few number of people in the families it is not so clear. If we add a lot more people to the families it would be easier to see and demonstrate that it is working, but I did not want to mess with your family data! :D

I though of making the section a sub topic to the nested nav example, but the principle can also be used with bottom navbar or just a long scrolling master list with details view that you open and when you pop it to get back you want to keep scroll position in the long list view. I did mentioned that it works for such use cases as well.