GetDelegate<T> constructor

GetDelegate<T>({
  1. required List<GetPage<T>> pages,
  2. GetPage<T>? notFoundRoute,
  3. List<NavigatorObserver>? navigatorObservers,
  4. TransitionDelegate? transitionDelegate,
  5. PopMode backButtonPopMode = PopMode.history,
  6. PreventDuplicateHandlingMode preventDuplicateHandlingMode = PreventDuplicateHandlingMode.reorderRoutes,
  7. Iterable<GetPage> pickPagesForRootNavigator(
    1. RouteDecoder currentNavStack
    )?,
  8. String? restorationScopeId,
  9. bool showHashOnUrl = false,
  10. GlobalKey<NavigatorState>? navigatorKey,
})

Implementation

GetDelegate({
  required List<GetPage<T>> pages,
  GetPage<T>? notFoundRoute,
  this.navigatorObservers,
  this.transitionDelegate,
  this.backButtonPopMode = PopMode.history,
  this.preventDuplicateHandlingMode =
      PreventDuplicateHandlingMode.reorderRoutes,
  this.pickPagesForRootNavigator,
  this.restorationScopeId,
  bool showHashOnUrl = false,
  GlobalKey<NavigatorState>? navigatorKey,
})  : navigatorKey = navigatorKey ?? GlobalKey<NavigatorState>(),
      notFoundRoute = notFoundRoute ??= GetPage(
        name: "/404",
        page: () => const Scaffold(
          body: Center(child: Text("Route not found")),
        ),
      ) {
  if (!showHashOnUrl && GetPlatform.isWeb) {
    setUrlStrategy();
  }
  addPages(pages);
  addPage(notFoundRoute);
  Get.log("GetDelegate is created !");
}