Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

document go_router + AutomaticKeepAliveClientMixin to keep ListView scroll position #44

Closed
csells opened this issue Sep 30, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@csells
Copy link
Owner

csells commented Sep 30, 2021

Shawn: "If you stick an AutomaticKeepAliveClientMixin on any of the top-level tabs, then they retain their state between tabs and you get the full "nested navigation + persistent tabs" that many folks are looking for. Just had to make FamilyView stateful, and add that mixin to the state, and the ListView remembers it's scroll position between routes! The entire widget state is retained. Like I can add a counter btn to each view, or a textfield, totally retains state between tabs."

@csells csells added the documentation Improvements or additions to documentation label Sep 30, 2021
rydmike added a commit to rydmike/go_router that referenced this issue Oct 3, 2021
As example and demo of case csells#45

And as part of documentation for csells#44

Add the AutomaticKeepAliveClientMixin to the FamilyView to demonstrate how to keep state.
@rydmike
Copy link
Contributor

rydmike commented Oct 3, 2021

This PR #56 updates the example nested_nav.dart to demonstrate it with the FamilyView tab content screen(s). The usage is described in example comments, but may still need a mention in the readme.

It is a good idea to add this to the example, as the usage of the AutomaticKeepAliveClientMixin is not necessarily so well known among Flutter developers. It would of course be easier to try it and see that it works, if there was more scrollable content on the example screens, but in a Web build it can be tested by resizing the browser window to see it.

@csells
Copy link
Owner Author

csells commented Oct 8, 2021

fixed in v2.0.0.

@csells csells closed this as completed Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants