GetRouterOutlet constructor

GetRouterOutlet({
  1. required String initialRoute,
  2. Key? key,
  3. String? anchorRoute,
  4. Iterable<GetPage> filterPages(
    1. Iterable<GetPage> afterAnchor
    )?,
  5. GetDelegate? delegate,
  6. String? restorationScopeId,
})

Implementation

GetRouterOutlet({
  required String initialRoute,
  Key? key,
  String? anchorRoute,
  Iterable<GetPage> Function(Iterable<GetPage> afterAnchor)? filterPages,
  GetDelegate? delegate,
  String? restorationScopeId,
}) : this.pickPages(
        restorationScopeId: restorationScopeId,
        pickPages: (RouteDecoder config) {
          Iterable<GetPage<dynamic>> ret;
          if (anchorRoute == null) {
            // jump the ancestor path
            final int 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: (GetDelegate delegate) =>
            delegate.matchRoute(initialRoute).route ?? delegate.notFoundRoute,
        navigatorKey: Get.nestedKey(anchorRoute)?.navigatorKey,
        delegate: delegate,
      );