GetRouterOutlet constructor
GetRouterOutlet({})
Implementation
GetRouterOutlet({
Key? key,
String? anchorRoute,
required String initialRoute,
Iterable<GetPage> Function(Iterable<GetPage> afterAnchor)? filterPages,
GetDelegate? delegate,
String? restorationScopeId,
}) : this.pickPages(
restorationScopeId: restorationScopeId,
pickPages: (config) {
Iterable<GetPage<dynamic>> ret;
if (anchorRoute == null) {
// jump the ancestor path
final length = Uri.parse(initialRoute).pathSegments.length;
return config.currentTreeBranch
.skip(length)
.take(length)
.toList();
}
ret = config.currentTreeBranch.pickAfterRoute(anchorRoute);
if (filterPages != null) {
ret = filterPages(ret);
}
return ret;
},
key: key,
emptyPage: (delegate) =>
delegate.matchRoute(initialRoute).route ?? delegate.notFoundRoute,
navigatorKey: Get.nestedKey(anchorRoute)?.navigatorKey,
delegate: delegate,
);