Sitelet https://github.com/flutter/flutter/pull/190596
Skip to content

Fixes popuntilwithresult drops results - #190596

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
chunhtai:fix-pop-until
Aug 10, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
chunhtai:fix-pop-until

Conversation

@chunhtai

@chunhtai chunhtai commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

as title, it is a typo and should have checked current route's will handle pop internally

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 5, 2026
@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: routes Navigator, Router, and related APIs. labels Aug 5, 2026
@chunhtai
chunhtai requested a review from justinmc August 5, 2026 05:57

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the NavigatorState class in navigator.dart to check candidate.route.willHandlePopInternally instead of next.route.willHandlePopInternally when determining whether to pop with a result. Additionally, a new widget test has been added to verify that popUntilWithResult correctly returns a value to the last popped route when the destination route contains local history entries, and an existing test has been reformatted. There are no review comments, and I have no feedback to provide.

Comment thread packages/flutter/test/widgets/navigator_test.dart Outdated
Comment thread packages/flutter/test/widgets/navigator_test.dart Outdated

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, but +1 to @navaronbracke's comments about not using Material in the test.

TestWidgetsApp(
initialRoute: '/',
onGenerateRoute: (RouteSettings settings) {
final String? routeName = settings.name;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: this could be a switch expression, but I don't mind it

return switch (settings.name) {
  '/' => TestRoute<bool>(
    ...
  ),
  ...
  _ => null,
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will keep it as is

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants