GetRouterOutlet constructor Null safety

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

Implementation

GetRouterOutlet({
  String? anchorRoute,
  required String initialRoute,
  Iterable<GetPage> Function(Iterable<GetPage> afterAnchor)? filterPages,
  GlobalKey<NavigatorState>? key,
  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,
        delegate: delegate,
      );