Persist exact tab locations including Settings under Pipelines
This commit is contained in:
@@ -200,12 +200,14 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
||||
|
||||
@override
|
||||
Future<void> setInitialRoutePath(AppRoute configuration) async {
|
||||
_rememberParent(configuration);
|
||||
_route = configuration;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setNewRoutePath(AppRoute configuration) async {
|
||||
if (configuration == _route) return;
|
||||
_rememberParent(configuration);
|
||||
_route = configuration;
|
||||
notifyListeners();
|
||||
}
|
||||
@@ -217,10 +219,18 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
||||
Future<bool> popRoute() async =>
|
||||
await _navigatorKey.currentState?.maybePop() ?? false;
|
||||
|
||||
void _rememberParent(AppRoute route) {
|
||||
if (route.kind == AppRouteKind.templates ||
|
||||
route.kind == AppRouteKind.schedules) {
|
||||
_templatesReturn = AppRoute.settings;
|
||||
}
|
||||
}
|
||||
|
||||
/// Records a user move; the Router turns the new configuration into a
|
||||
/// history entry (or a replacement when it already matches the location).
|
||||
void goTo(AppRoute route) {
|
||||
if (route == _route) return;
|
||||
_rememberParent(route);
|
||||
_route = route;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user