Closed esDotDev closed 3 years ago
The issue was caused by not assigning a pageKey
, which caused the navigator to be unaware that it's pageStack had changed. Which I suppose is expected :)
This could be worked around by just adding a manual notifyListeners
call to _go
fwiw.
I'm just using the underlying Navigator
support for NavigatorObserver
.
It looks like you do call _safeNotifyListeners
from within goRouterDelegate.go
, this causes the GoRouterDelegate to call notifyListeners
, but it does not cause GoRouter
to do the same.
Which creates this edge case:
If you wanted to remove this edge case, you could probably do something like:
void go(String location, {Object? extra}){
routerDelegate.go(location, extra: extra);
notifyListeners(); // just manually let everyone know we changed, since navigator.observers might miss it.
}
It seems that
notifyListeners
is only called when using the various imperative .push/.pop, but not when callingrouter.go()
.