Commit 3e46fc3a authored by ColdPaleLight's avatar ColdPaleLight

fix stack overflow

parent 3fd457c1
...@@ -307,6 +307,7 @@ class ContainerNavigatorObserver extends NavigatorObserver { ...@@ -307,6 +307,7 @@ class ContainerNavigatorObserver extends NavigatorObserver {
void willPush(Route<dynamic> route, Route<dynamic> previousRoute) { void willPush(Route<dynamic> route, Route<dynamic> previousRoute) {
for (NavigatorObserver observer in boostObservers) { for (NavigatorObserver observer in boostObservers) {
if(observer is ContainerNavigatorObserver){ if(observer is ContainerNavigatorObserver){
if (observer == this) continue;
ContainerNavigatorObserver containerNavigatorObserver = observer as ContainerNavigatorObserver; ContainerNavigatorObserver containerNavigatorObserver = observer as ContainerNavigatorObserver;
containerNavigatorObserver.willPush(route, previousRoute); containerNavigatorObserver.willPush(route, previousRoute);
} }
...@@ -315,6 +316,7 @@ class ContainerNavigatorObserver extends NavigatorObserver { ...@@ -315,6 +316,7 @@ class ContainerNavigatorObserver extends NavigatorObserver {
@override @override
void didPush(Route<dynamic> route, Route<dynamic> previousRoute) { void didPush(Route<dynamic> route, Route<dynamic> previousRoute) {
for (NavigatorObserver observer in boostObservers) { for (NavigatorObserver observer in boostObservers) {
if (observer == this) continue;
observer.didPush(route, previousRoute); observer.didPush(route, previousRoute);
} }
} }
...@@ -322,6 +324,7 @@ class ContainerNavigatorObserver extends NavigatorObserver { ...@@ -322,6 +324,7 @@ class ContainerNavigatorObserver extends NavigatorObserver {
@override @override
void didPop(Route<dynamic> route, Route<dynamic> previousRoute) { void didPop(Route<dynamic> route, Route<dynamic> previousRoute) {
for (NavigatorObserver observer in boostObservers) { for (NavigatorObserver observer in boostObservers) {
if (observer == this) continue;
observer.didPop(route, previousRoute); observer.didPop(route, previousRoute);
} }
} }
...@@ -329,6 +332,7 @@ class ContainerNavigatorObserver extends NavigatorObserver { ...@@ -329,6 +332,7 @@ class ContainerNavigatorObserver extends NavigatorObserver {
@override @override
void didRemove(Route<dynamic> route, Route<dynamic> previousRoute) { void didRemove(Route<dynamic> route, Route<dynamic> previousRoute) {
for (NavigatorObserver observer in boostObservers) { for (NavigatorObserver observer in boostObservers) {
if (observer == this) continue;
observer.didRemove(route, previousRoute); observer.didRemove(route, previousRoute);
} }
} }
...@@ -336,6 +340,7 @@ class ContainerNavigatorObserver extends NavigatorObserver { ...@@ -336,6 +340,7 @@ class ContainerNavigatorObserver extends NavigatorObserver {
@override @override
void didReplace({Route<dynamic> newRoute, Route<dynamic> oldRoute}) { void didReplace({Route<dynamic> newRoute, Route<dynamic> oldRoute}) {
for (NavigatorObserver observer in boostObservers) { for (NavigatorObserver observer in boostObservers) {
if (observer == this) continue;
observer.didReplace(newRoute: newRoute, oldRoute: oldRoute); observer.didReplace(newRoute: newRoute, oldRoute: oldRoute);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment