GetRouterOutlet constructor

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

Implementation

GetRouterOutlet({
  Key? key,
  String? anchorRoute,
  required String initialRoute,
  Iterable<GetPage> Function(Iterable<GetPage> afterAnchor)? filterPages,
  GlobalKey<NavigatorState>? navigatorKey,
  GetDelegate? delegate,
}) : this.pickPages(
        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;
        },
        emptyPage: (delegate) =>
            Get.routeTree.matchRoute(initialRoute).route ??
            delegate.notFoundRoute,
        key: key,
        navigatorKey: navigatorKey,
        delegate: delegate,
      );