Widget.materialApp constructor Null safety

const Widget.materialApp(
  1. {Key? key,
  2. Widget? home,
  3. String? initialRoute,
  4. @Default('') String title,
  5. Color? color,
  6. ThemeData? theme,
  7. ThemeData? darkTheme,
  8. ThemeData? highContrastTheme,
  9. ThemeData? highContrastDarkTheme,
  10. @Default(ThemeMode.system) ThemeMode? themeMode,
  11. @Default(Duration(milliseconds: 200)) Duration themeAnimationDuration,
  12. @Default(Curves.linear()) Curves themeAnimationCurve,
  13. Locale? locale,
  14. @Default([Locale('en', 'US')]) Iterable<Locale> supportedLocales,
  15. @Default(false) bool debugShowMaterialGrid,
  16. @Default(false) bool showPerformanceOverlay,
  17. @Default(false) bool checkerboardRasterCacheImages,
  18. @Default(false) bool checkerboardOffscreenLayers,
  19. @Default(false) bool showSemanticsDebugger,
  20. @Default(true) bool debugShowCheckedModeBanner,
  21. String? restorationScopeId,
  22. @Default(false) bool useInheritedMediaQuery,
  23. @Default({}) Map<String, Widget> routes}
)

Implementation

const factory Widget.materialApp({
  Key? key,
  Widget? home,
  String? initialRoute,
  @Default('') String title,
  Color? color,
  ThemeData? theme,
  ThemeData? darkTheme,
  ThemeData? highContrastTheme,
  ThemeData? highContrastDarkTheme,
  @Default(ThemeMode.system) ThemeMode? themeMode,
  @Default(Duration(milliseconds: 200)) Duration themeAnimationDuration,
  @Default(Curves.linear()) Curves themeAnimationCurve,
  Locale? locale,
  @Default([Locale('en', 'US')]) Iterable<Locale> supportedLocales,
  @Default(false) bool debugShowMaterialGrid,
  @Default(false) bool showPerformanceOverlay,
  @Default(false) bool checkerboardRasterCacheImages,
  @Default(false) bool checkerboardOffscreenLayers,
  @Default(false) bool showSemanticsDebugger,
  @Default(true) bool debugShowCheckedModeBanner,
  String? restorationScopeId,
  @Default(false) bool useInheritedMediaQuery,
  @Default({}) Map<String, Widget> routes,
}) = MaterialApp;