back<T> method
Pops the topmost route with an optional result.
Pageless routes pushed imperatively on the navigator (e.g. dialogs, bottom sheets or raw Navigator.push routes) are popped through the navigator itself, so the pages managed by this delegate stay intact. Otherwise the last entry of activePages is removed declaratively.
Implementation
@override
void back<T>([T? result]) {
if (_topRouteIsPageless) {
navigatorKey.currentState?.pop<T>(result);
return;
}
_checkIfCanBack();
_markNavigationAsPop();
_popWithResult<T>(result);
notifyListeners();
}