navigator patch

Closes #1947

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-04 18:59:21 +08:00
parent ac9631462a
commit 9b0c9e9276
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart
index fb7ccc5da2f..54dbc2b6c1d 100644
--- a/packages/flutter/lib/src/widgets/navigator.dart
+++ b/packages/flutter/lib/src/widgets/navigator.dart
@@ -5615,7 +5615,9 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
_debugLocked = false;
return true;
}());
- _afterNavigation(entry.route);
+ if (entry.currentState == _RouteLifecycle.popping) {
+ _afterNavigation(entry.route);
+ }
}
/// Calls [pop] repeatedly until the predicate returns true.