Skip to content

TwoLevelList fails to restore sublist expanded state#2846

Merged
HansMuller merged 1 commit intoflutter:masterfrom
HansMuller:two_level_list
Mar 23, 2016
Merged

TwoLevelList fails to restore sublist expanded state#2846
HansMuller merged 1 commit intoflutter:masterfrom
HansMuller:two_level_list

Conversation

@HansMuller
Copy link
Contributor

Each TwoLevelList item needs a unique key to ensure that it ends up with its own expanded state.

Added a TwoLevelList scrollableKey parameter so that its Block can be used to drive the AppBar.

Fixes #2845

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to increment itemIndex every trip through the loop, regardless of whether the item.key is null.

I wonder if we want to break this out into a helper function (maybe a static on KeyedSubtree) now that we've got this pattern in two places. KeyedSubtree.ensureKeysForList(...) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do that.

@abarth
Copy link
Contributor

abarth commented Mar 23, 2016

LGTM

@HansMuller HansMuller merged commit 14440b1 into flutter:master Mar 23, 2016
@HansMuller HansMuller deleted the two_level_list branch March 23, 2016 19:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 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.

TwoLevelList doesn't correctly remember which items are expanded

2 participants