GetRouterOutlet.pickPages constructor
GetRouterOutlet.pickPages({
- Key? key,
- Widget emptyWidget(
- GetDelegate delegate
- GetPage emptyPage(
- GetDelegate delegate
- required Iterable<
GetPage> pickPages( - bool onPopPage(
- Route,
- dynamic
- String? restorationScopeId,
- GetDelegate? delegate,
Implementation
GetRouterOutlet.pickPages({
super.key,
Widget Function(GetDelegate delegate)? emptyWidget,
GetPage Function(GetDelegate delegate)? emptyPage,
required super.pickPages,
bool Function(Route<dynamic>, dynamic)? onPopPage,
String? restorationScopeId,
GlobalKey<NavigatorState>? navigatorKey,
GetDelegate? delegate,
}) : super(
pageBuilder: (context, rDelegate, pages) {
final pageRes = <GetPage?>[
...?pages,
if (pages == null || pages.isEmpty) emptyPage?.call(rDelegate),
].whereType<GetPage>();
if (pageRes.isNotEmpty) {
return InheritedNavigator(
navigatorKey: navigatorKey ??
Get.rootController.rootDelegate.navigatorKey,
child: GetNavigator(
restorationScopeId: restorationScopeId,
onPopPage: onPopPage ??
(route, result) {
final didPop = route.didPop(result);
if (!didPop) {
return false;
}
return true;
},
pages: pageRes.toList(),
key: navigatorKey,
),
);
}
return (emptyWidget?.call(rDelegate) ?? const SizedBox.shrink());
},
delegate: delegate ?? Get.rootController.rootDelegate,
);