Skip to content

Conversation

@HansMuller
Copy link
Contributor

Fixes #671

@abarth
Copy link
Contributor

abarth commented Dec 9, 2015

This isn't the right fix. We should teach TabBar how to persist this data in PageStorage. Check out how Scrollable saves its scroll offset.

@HansMuller
Copy link
Contributor Author

TabBar doesn't own its TabBarSelection the app or page does. In this case I think StockHome would be the logical owner, so I can have it use PageStorage to save the TabBarSelection.

@abarth
Copy link
Contributor

abarth commented Dec 9, 2015

LGTM

@Hixie
Copy link
Contributor

Hixie commented Dec 9, 2015

Can the TabBarSelection actually be an Inherited widget in the tree itself? Then the tab bar and tab view could crawl up a bit instead of being given a TabBarSelection; and the TabBarSelection could crawl up and find the page storage.

@HansMuller
Copy link
Contributor Author

Making the TabBarSelection an InheritedWidget sounds like the right thing to do. If it's OK with you, I'll commit this change, just to fix the bug, and then do the inherited widget.

@Hixie
Copy link
Contributor

Hixie commented Dec 9, 2015

Oh sure there's no reason to do that in this PR. Feel free to just file a bug for it too.

@HansMuller
Copy link
Contributor Author

TabBarSelection should be an InheritedWidget
#835

HansMuller pushed a commit that referenced this pull request Dec 9, 2015
Make the StockHome TabBar selection persistent

Fixes #671
@HansMuller HansMuller merged commit b42ac4e into flutter:master Dec 9, 2015
@HansMuller HansMuller deleted the save_tabs_selection branch December 9, 2015 17:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tabs forget which tab there were showing

3 participants