GetMaterialApp constructor Null safety

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

Implementation

const GetMaterialApp({
  Key? key,
  this.navigatorKey,
  this.scaffoldMessengerKey,
  this.home,
  Map<String, Widget Function(BuildContext)> this.routes =
      const <String, WidgetBuilder>{},
  this.initialRoute,
  this.onGenerateRoute,
  this.onGenerateInitialRoutes,
  this.onUnknownRoute,
  this.useInheritedMediaQuery = false,
  List<NavigatorObserver> this.navigatorObservers =
      const <NavigatorObserver>[],
  this.builder,
  this.textDirection,
  this.title = '',
  this.onGenerateTitle,
  this.color,
  this.theme,
  this.darkTheme,
  this.themeMode = ThemeMode.system,
  this.locale,
  this.fallbackLocale,
  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.customTransition,
  this.translationsKeys,
  this.translations,
  this.onInit,
  this.onReady,
  this.onDispose,
  this.routingCallback,
  this.defaultTransition,
  this.getPages,
  this.opaqueRoute,
  this.enableLog = kDebugMode,
  this.logWriterCallback,
  this.popGesture,
  this.transitionDuration,
  this.defaultGlobalState,
  this.smartManagement = SmartManagement.full,
  this.initialBinding,
  this.unknownRoute,
  this.highContrastTheme,
  this.highContrastDarkTheme,
  this.actions,
})  : routeInformationProvider = null,
      routeInformationParser = null,
      routerDelegate = null,
      backButtonDispatcher = null,
      super(key: key);