GetMaterialApp.router constructor

GetMaterialApp.router({
  1. Key? key,
  2. RouteInformationProvider? routeInformationProvider,
  3. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  4. RouteInformationParser<Object>? routeInformationParser,
  5. RouterDelegate<Object>? routerDelegate,
  6. BackButtonDispatcher? backButtonDispatcher,
  7. TransitionBuilder? builder,
  8. String title = '',
  9. GenerateAppTitle? onGenerateTitle,
  10. Color? color,
  11. ThemeData? theme,
  12. ThemeData? darkTheme,
  13. ThemeData? highContrastTheme,
  14. ThemeData? highContrastDarkTheme,
  15. ThemeMode themeMode = ThemeMode.system,
  16. Locale? locale,
  17. Iterable<LocalizationsDelegate>? localizationsDelegates,
  18. LocaleListResolutionCallback? localeListResolutionCallback,
  19. LocaleResolutionCallback? localeResolutionCallback,
  20. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  21. bool debugShowMaterialGrid = false,
  22. bool showPerformanceOverlay = false,
  23. bool checkerboardRasterCacheImages = false,
  24. bool checkerboardOffscreenLayers = false,
  25. bool showSemanticsDebugger = false,
  26. bool debugShowCheckedModeBanner = true,
  27. Map<LogicalKeySet, Intent>? shortcuts,
  28. ScrollBehavior? scrollBehavior,
  29. Map<Type, Action<Intent>>? actions,
  30. CustomTransition? customTransition,
  31. Map<String, Map<String, String>>? translationsKeys,
  32. Translations? translations,
  33. TextDirection? textDirection,
  34. Locale? fallbackLocale,
  35. ValueChanged<Routing?>? routingCallback,
  36. Transition? defaultTransition,
  37. bool? opaqueRoute,
  38. VoidCallback? onInit,
  39. VoidCallback? onReady,
  40. VoidCallback? onDispose,
  41. bool? enableLog,
  42. LogWriterCallback? logWriterCallback,
  43. bool? popGesture,
  44. SmartManagement smartManagement = SmartManagement.full,
  45. Bindings? initialBinding,
  46. Duration? transitionDuration,
  47. bool? defaultGlobalState,
  48. List<GetPage>? getPages,
  49. List<NavigatorObserver>? navigatorObservers,
  50. GetPage? unknownRoute,
})

Implementation

GetMaterialApp.router({
  Key? key,
  this.routeInformationProvider,
  this.scaffoldMessengerKey,
  RouteInformationParser<Object>? routeInformationParser,
  RouterDelegate<Object>? routerDelegate,
  this.backButtonDispatcher,
  this.builder,
  this.title = '',
  this.onGenerateTitle,
  this.color,
  this.theme,
  this.darkTheme,
  this.highContrastTheme,
  this.highContrastDarkTheme,
  this.themeMode = ThemeMode.system,
  this.locale,
  this.localizationsDelegates,
  this.localeListResolutionCallback,
  this.localeResolutionCallback,
  this.supportedLocales = const <Locale>[Locale('en', 'US')],
  this.debugShowMaterialGrid = false,
  this.showPerformanceOverlay = false,
  this.checkerboardRasterCacheImages = false,
  this.checkerboardOffscreenLayers = false,
  this.showSemanticsDebugger = false,
  this.debugShowCheckedModeBanner = true,
  this.shortcuts,
  this.scrollBehavior,
  this.actions,
  this.customTransition,
  this.translationsKeys,
  this.translations,
  this.textDirection,
  this.fallbackLocale,
  this.routingCallback,
  this.defaultTransition,
  this.opaqueRoute,
  this.onInit,
  this.onReady,
  this.onDispose,
  this.enableLog,
  this.logWriterCallback,
  this.popGesture,
  this.smartManagement = SmartManagement.full,
  this.initialBinding,
  this.transitionDuration,
  this.defaultGlobalState,
  this.getPages,
  this.navigatorObservers,
  this.unknownRoute,
})  : routerDelegate = routerDelegate ??= Get.createDelegate(
        notFoundRoute: unknownRoute,
      ),
      routeInformationParser =
          routeInformationParser ??= Get.createInformationParser(
        initialRoute: getPages?.first.name ?? '/',
      ),
      //navigatorObservers = null,
      navigatorKey = null,
      onGenerateRoute = null,
      home = null,
      onGenerateInitialRoutes = null,
      onUnknownRoute = null,
      routes = null,
      initialRoute = null,
      super(key: key) {
  Get.routerDelegate = routerDelegate;
  Get.routeInformationParser = routeInformationParser;
}