I just migrated my go_router
package from 12.1.3
to 13.2.4
.
I checked the breaking changes but could not find anything about pop
. Currently I extended my context with this:
extension HelperExtensions on BuildContext {
void maybePop<T extends Object?>([T? result]) {
if (canPop()) {
return pop(result);
}
}
}
But when using this in dialogs, it will not pop them, but instead pop the view beneath them. When I do Navigator.of(this, rootNavigator: true).pop()
it works.
Can someone explain me why this is the case? Why are dialogs not anymore on the navigators page stack?
Is using rootNavigator instead now correct? What does canPop()
even do then. Does it still check the correct thing when I afterwards use Navigator.of(this, rootNavigator: true).pop()
to pop my dialog?
Thanks a lot.