Skip to content

Navigator should call didpop when popping page based route #170376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 12, 2025

Conversation

chunhtai
Copy link
Contributor

as title

Pre-launch Checklist

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

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: routes Navigator, Router, and related APIs. labels Jun 10, 2025
@@ -5581,7 +5581,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
if (entry.currentState.index <= _RouteLifecycle.idle.index) {
// The entry may have been disposed if the pop finishes synchronously.
assert(entry.route._popCompleter.isCompleted);
entry.currentState = _RouteLifecycle.popping;
entry.currentState = _RouteLifecycle.pop;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in flush history update, pop will notify observer and then transition to popping. I can't really find out why I made this change in the first place, but I think reverting this back to pop should be fine as long as no other error

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree here. Makes sense to me to keep it as pop.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@@ -5581,7 +5581,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
if (entry.currentState.index <= _RouteLifecycle.idle.index) {
// The entry may have been disposed if the pop finishes synchronously.
assert(entry.route._popCompleter.isCompleted);
entry.currentState = _RouteLifecycle.popping;
entry.currentState = _RouteLifecycle.pop;
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree here. Makes sense to me to keep it as pop.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 12, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jun 12, 2025
Merged via the queue into flutter:master with commit 6f0570b Jun 12, 2025
76 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants