Repository navigation
Fix Hero size changes during Navigator resize - #190025
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates _HeroFlight in heroes.dart to use Positioned.fromRect for positioning the hero shuttle. It also adds a widget test in heroes_test.dart to ensure that a Hero does not resize when its Navigator resizes during flight. There are no review comments, so I have no feedback to provide.
navaronbracke
requested changes
Jul 25, 2026
navaronbracke
previously approved these changes
Jul 25, 2026
Author
|
@navaronbracke The regression test failed due to an undisposed HeroController, so I fixed it! |
navaronbracke
previously approved these changes
Jul 26, 2026
navaronbracke
previously approved these changes
Jul 26, 2026
victorsanni
reviewed
Aug 5, 2026
victorsanni
left a comment
Contributor
There was a problem hiding this comment.
LGTM with one dead code nit.
victorsanni
approved these changes
Aug 5, 2026
navaronbracke
approved these changes
Aug 6, 2026
elliette
approved these changes
Aug 6, 2026
jtmcdole
enabled auto-merge
August 7, 2026 02:15
Member
|
removed and re-added to the queue; wasn't making progress and probably due to github actions. |
This was referenced Aug 7, 2026
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.
Fixes #134647
Description
Hero flights were positioned by converting the evaluated flight Rect into a RelativeRect using the Navigator size captured when the flight started.
This caused the Hero's size or position to become distorted if the Navigator resized during the transition. It was especially visible with nested Navigators because they can be resized by their parent layout, for example when a Scaffold shrinks in response to the keyboard. The root Navigator's Overlay typically keeps the full viewport size, so the issue was less likely to occur there.
This change positions the Hero directly from the evaluated Rect, avoiding calculations based on stale Navigator dimensions.
A regression test was added that resizes a nested Navigator during a Hero flight and verifies that the shuttle preserves its size.
Demonstration
Previous / Current Video
Previous.mp4
Current.mp4
Pre-launch Checklist
///).