MaterialApp.router constructor Null safety

const MaterialApp.router(
  1. {Key? key,
  2. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  3. RouteInformationProvider? routeInformationProvider,
  4. required RouteInformationParser<Object> routeInformationParser,
  5. required 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,
  16. Locale? locale,
  17. Iterable<LocalizationsDelegate>? localizationsDelegates,
  18. LocaleListResolutionCallback? localeListResolutionCallback,
  19. LocaleResolutionCallback? localeResolutionCallback,
  20. Iterable<Locale> supportedLocales,
  21. bool debugShowMaterialGrid,
  22. bool showPerformanceOverlay,
  23. bool checkerboardRasterCacheImages,
  24. bool checkerboardOffscreenLayers,
  25. bool showSemanticsDebugger,
  26. bool debugShowCheckedModeBanner,
  27. Map<ShortcutActivator, Intent>? shortcuts,
  28. Map<Type, Action<Intent>>? actions,
  29. String? restorationScopeId,
  30. ScrollBehavior? scrollBehavior,
  31. bool useInheritedMediaQuery}
)

Creates a MaterialApp that uses the Router instead of a Navigator.

Implementation

const MaterialApp.router({
  Key? key,
  this.scaffoldMessengerKey,
  this.routeInformationProvider,
  required RouteInformationParser<Object> this.routeInformationParser,
  required RouterDelegate<Object> this.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.actions,
  this.restorationScopeId,
  this.scrollBehavior,
  this.useInheritedMediaQuery = false,
}) : assert(routeInformationParser != null),
     assert(routerDelegate != null),
     assert(title != null),
     assert(debugShowMaterialGrid != null),
     assert(showPerformanceOverlay != null),
     assert(checkerboardRasterCacheImages != null),
     assert(checkerboardOffscreenLayers != null),
     assert(showSemanticsDebugger != null),
     assert(debugShowCheckedModeBanner != null),
     navigatorObservers = null,
     navigatorKey = null,
     onGenerateRoute = null,
     home = null,
     onGenerateInitialRoutes = null,
     onUnknownRoute = null,
     routes = null,
     initialRoute = null,
     super(key: key);