materialApp method

MaterialApp materialApp({
  1. Key? key,
  2. GlobalKey<NavigatorState>? navigatorKey,
  3. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  4. Map<String, WidgetBuilder> routes = const <String, WidgetBuilder>{},
  5. String? initialRoute,
  6. RouteFactory? onGenerateRoute,
  7. InitialRouteListFactory? onGenerateInitialRoutes,
  8. RouteFactory? onUnknownRoute,
  9. List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
  10. TransitionBuilder? builder,
  11. String title = "",
  12. GenerateAppTitle? onGenerateTitle,
  13. Color? color,
  14. ThemeData? theme,
  15. ThemeData? darkTheme,
  16. ThemeData? highContrastTheme,
  17. ThemeData? highContrastDarkTheme,
  18. ThemeMode? themeMode = ThemeMode.system,
  19. Locale? locale,
  20. Iterable<LocalizationsDelegate>? localizationsDelegates,
  21. LocaleListResolutionCallback? localeListResolutionCallback,
  22. LocaleResolutionCallback? localeResolutionCallback,
  23. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  24. bool debugShowMaterialGrid = false,
  25. bool showPerformanceOverlay = false,
  26. bool checkerboardRasterCacheImages = false,
  27. bool checkerboardOffscreenLayers = false,
  28. bool showSemanticsDebugger = false,
  29. bool debugShowCheckedModeBanner = true,
  30. Map<ShortcutActivator, Intent>? shortcuts,
  31. Map<Type, Action<Intent>>? actions,
  32. String? restorationScopeId,
  33. ScrollBehavior? scrollBehavior,
  34. bool useInheritedMediaQuery = false,
})

Implementation

MaterialApp materialApp({
  Key? key,
  GlobalKey<NavigatorState>? navigatorKey,
  GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  Map<String, WidgetBuilder> routes = const <String, WidgetBuilder>{},
  String? initialRoute,
  RouteFactory? onGenerateRoute,
  InitialRouteListFactory? onGenerateInitialRoutes,
  RouteFactory? onUnknownRoute,
  List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
  TransitionBuilder? builder,
  String title = "",
  GenerateAppTitle? onGenerateTitle,
  Color? color,
  ThemeData? theme,
  ThemeData? darkTheme,
  ThemeData? highContrastTheme,
  ThemeData? highContrastDarkTheme,
  ThemeMode? themeMode = ThemeMode.system,
  Locale? locale,
  Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates,
  LocaleListResolutionCallback? localeListResolutionCallback,
  LocaleResolutionCallback? localeResolutionCallback,
  Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  bool debugShowMaterialGrid = false,
  bool showPerformanceOverlay = false,
  bool checkerboardRasterCacheImages = false,
  bool checkerboardOffscreenLayers = false,
  bool showSemanticsDebugger = false,
  bool debugShowCheckedModeBanner = true,
  Map<ShortcutActivator, Intent>? shortcuts,
  Map<Type, Action<Intent>>? actions,
  String? restorationScopeId,
  ScrollBehavior? scrollBehavior,
  bool useInheritedMediaQuery = false,
}) =>
    MaterialApp(
      key: key,
      navigatorKey: navigatorKey,
      scaffoldMessengerKey: scaffoldMessengerKey,
      routes: routes,
      initialRoute: initialRoute,
      onGenerateRoute: onGenerateRoute,
      onGenerateInitialRoutes: onGenerateInitialRoutes,
      onUnknownRoute: onUnknownRoute,
      navigatorObservers: navigatorObservers,
      builder: builder,
      title: title,
      onGenerateTitle: onGenerateTitle,
      color: color,
      home: this,
      theme: theme,
      darkTheme: darkTheme,
      highContrastDarkTheme: highContrastDarkTheme,
      themeMode: themeMode,
      locale: locale,
      localizationsDelegates: localizationsDelegates,
      localeListResolutionCallback: localeListResolutionCallback,
      supportedLocales: supportedLocales,
      debugShowMaterialGrid: debugShowMaterialGrid,
      showPerformanceOverlay: showPerformanceOverlay,
      checkerboardRasterCacheImages: checkerboardOffscreenLayers,
      debugShowCheckedModeBanner: debugShowCheckedModeBanner,
      shortcuts: shortcuts,
      actions: actions,
      restorationScopeId: restorationScopeId,
      scrollBehavior: scrollBehavior,
      useInheritedMediaQuery: useInheritedMediaQuery,
    );