GetRouterOutlet.pickPages constructor Null safety

GetRouterOutlet.pickPages(
  1. {Widget emptyWidget(
    1. GetDelegate delegate
    )?,
  2. GetPage emptyPage(
    1. GetDelegate delegate
    )?,
  3. required Iterable<GetPage> pickPages(
    1. GetNavConfig currentNavStack
    ),
  4. bool onPopPage(
    1. Route,
    2. dynamic
    )?,
  5. GlobalKey<NavigatorState>? key,
  6. GetDelegate? delegate}
)

Implementation

GetRouterOutlet.pickPages({
  Widget Function(GetDelegate delegate)? emptyWidget,
  GetPage Function(GetDelegate delegate)? emptyPage,
  required Iterable<GetPage> Function(GetNavConfig currentNavStack) pickPages,
  bool Function(Route<dynamic>, dynamic)? onPopPage,
  GlobalKey<NavigatorState>? key,
  GetDelegate? delegate,
}) : super(
        pageBuilder: (context, rDelegate, pages) {
          final pageRes = <GetPage?>[
            ...?pages,
            if (pages == null || pages.length == 0)
              emptyPage?.call(rDelegate),
          ].whereType<GetPage>();

          if (pageRes.length > 0) {
            return GetNavigator(
              onPopPage: onPopPage ??
                  (route, result) {
                    final didPop = route.didPop(result);
                    if (!didPop) {
                      return false;
                    }
                    return true;
                  },
              pages: pageRes.toList(),
              key: key,
            );
          }
          return (emptyWidget?.call(rDelegate) ?? SizedBox.shrink());
        },
        pickPages: pickPages,
        delegate: delegate ?? Get.rootDelegate,
      );