File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ import 'dialog_proxy.dart';
9
9
class SmartNavigatorObserver extends NavigatorObserver {
10
10
@override
11
11
void didPush (Route <dynamic > route, Route <dynamic >? previousRoute) {
12
- DialogProxy .contextNavigator = navigator? .context;
13
12
RouteRecord .curRoute = route;
14
13
RouteRecord .instance.push (route, previousRoute);
14
+ navigateChange ();
15
15
}
16
16
17
17
@override
@@ -34,7 +34,15 @@ class SmartNavigatorObserver extends NavigatorObserver {
34
34
_removeDialog (route);
35
35
}
36
36
37
+ void navigateChange () {
38
+ final navigatorContext = navigator? .context;
39
+ if (navigatorContext != null ) {
40
+ DialogProxy .contextNavigator = navigatorContext;
41
+ }
42
+ }
43
+
37
44
void _removeDialog (Route <dynamic >? route) {
45
+ navigateChange ();
38
46
if (route == null ) {
39
47
return ;
40
48
}
You can’t perform that action at this time.
0 commit comments