Ahmed Fwela

+ rolled back participatesInRootNavigator

+ made GetNavigator key optional
... ... @@ -36,13 +36,11 @@ class AppPages {
//only enter this route when not authed
EnsureNotAuthedMiddleware(),
],
participatesInRootNavigator: false,
name: _Paths.LOGIN,
page: () => LoginView(),
binding: LoginBinding(),
),
GetPage(
participatesInRootNavigator: false,
preventDuplicates: true,
name: _Paths.HOME,
page: () => HomeView(),
... ... @@ -83,7 +81,6 @@ class AppPages {
],
),
GetPage(
participatesInRootNavigator: true,
name: _Paths.SETTINGS,
page: () => SettingsView(),
binding: SettingsBinding(),
... ...
... ... @@ -263,7 +263,7 @@ class GetDelegate extends RouterDelegate<GetNavConfig>
if (currentHistory == null) return <GetPage>[];
final res = currentHistory.currentTreeBranch
.where((r) => r.participatesInRootNavigator);
.where((r) => r.participatesInRootNavigator != null);
if (res.length == 0) {
//default behavoir, all routes participate in root navigator
return currentHistory.currentTreeBranch;
... ... @@ -421,10 +421,13 @@ class GetNavigator extends Navigator {
bool reportsRouteUpdateToEngine = false,
TransitionDelegate? transitionDelegate,
String? name,
}) : assert(key != null || name != null,
'GetNavigator should either have a key or a name set'),
super(
key: key ?? Get.nestedKey(name),
}) : super(
//keys should be optional
key: key != null
? key
: name != null
? Get.nestedKey(name)
: null,
onPopPage: onPopPage ??
(route, result) {
final didPop = route.didPop(result);
... ...
... ... @@ -94,7 +94,7 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, GetNavConfig> {
GetPage Function(GetDelegate delegate)? emptyPage,
required List<GetPage> Function(GetNavConfig currentNavStack) pickPages,
bool Function(Route<dynamic>, dynamic)? onPopPage,
required String name,
String? name,
}) : assert(
(emptyPage == null && emptyWidget == null) ||
(emptyPage != null && emptyWidget == null) ||
... ...
... ... @@ -34,7 +34,7 @@ class GetPage<T> extends Page<T> {
final String? title;
final Transition? transition;
final Curve curve;
final bool participatesInRootNavigator;
final bool? participatesInRootNavigator;
final Alignment? alignment;
final bool maintainState;
final bool opaque;
... ... @@ -66,7 +66,7 @@ class GetPage<T> extends Page<T> {
required this.name,
required this.page,
this.title,
this.participatesInRootNavigator = true,
this.participatesInRootNavigator,
this.gestureWidth = 20,
// RouteSettings settings,
this.maintainState = true,
... ...