Fixed AnimatedSwitcher chain produced duplicates#106962
Merged
youssef-attia merged 5 commits intoflutter:masterfrom Jul 7, 2022
Merged
Fixed AnimatedSwitcher chain produced duplicates#106962youssef-attia merged 5 commits intoflutter:masterfrom
youssef-attia merged 5 commits intoflutter:masterfrom
Conversation
gspencergoog
reviewed
Jul 6, 2022
| Widget build(BuildContext context) { | ||
| _rebuildOutgoingWidgetsIfNeeded(); | ||
| return widget.layoutBuilder(_currentEntry?.transition, _outgoingWidgets!); | ||
| return widget.layoutBuilder(_currentEntry?.transition, _outgoingWidgets!.where((Widget outgoing) => outgoing.key != _currentEntry?.transition.key).toSet().toList()); |
Contributor
There was a problem hiding this comment.
What does this look like? Does the existing one just disappear to be replaced by the new one?
Contributor
Author
There was a problem hiding this comment.
Yes. If we were to display both versions simultaneously then we would have the issue with duplicate keys. The duplicate keys issue seems to not only be a problem with the LayoutIds but also locally for the AnimatedSwitcher.
This was referenced Jul 8, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 8, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 8, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 8, 2022
youssef-attia
added a commit
that referenced
this pull request
Jul 8, 2022
This reverts commit 0d3cc92.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 8, 2022
youssef-attia
added a commit
that referenced
this pull request
Jul 8, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 8, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 9, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 9, 2022
youssef-attia
added a commit
that referenced
this pull request
Jul 12, 2022
camsim99
pushed a commit
to camsim99/flutter
that referenced
this pull request
Aug 10, 2022
* Fixed AnimatedSwitcher chain produced duplicates * Fixed issue with global keys being copied * trailing whitespace * removed unused dependencies * Fixed dependency loop
camsim99
pushed a commit
to camsim99/flutter
that referenced
this pull request
Aug 10, 2022
)" (flutter#107318) This reverts commit 0d3cc92.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 30, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Aug 30, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

When the child of an AnimatedSwitcher went through rapid changes, there were times where the same widget would be in the display chain many times. For example if the AnimatedSwitcher's child goes from A->B->A then B is displayed once and A is displayed twice. This did not mesh so well when A was given a key as duplicate local keys are disallowed and this would cause problems with the rendering of AnimatedSwitcher.
Pre-launch Checklist
///).