WidgetsApp.router constructor Null safety

WidgetsApp.router(
  1. {Key? key,
  2. RouteInformationProvider? routeInformationProvider,
  3. required RouteInformationParser<Object> routeInformationParser,
  4. required RouterDelegate<Object> routerDelegate,
  5. BackButtonDispatcher? backButtonDispatcher,
  6. TransitionBuilder? builder,
  7. String title = '',
  8. GenerateAppTitle? onGenerateTitle,
  9. TextStyle? textStyle,
  10. required Color color,
  11. Locale? locale,
  12. Iterable<LocalizationsDelegate>? localizationsDelegates,
  13. LocaleListResolutionCallback? localeListResolutionCallback,
  14. LocaleResolutionCallback? localeResolutionCallback,
  15. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  16. bool showPerformanceOverlay = false,
  17. bool checkerboardRasterCacheImages = false,
  18. bool checkerboardOffscreenLayers = false,
  19. bool showSemanticsDebugger = false,
  20. bool debugShowWidgetInspector = false,
  21. bool debugShowCheckedModeBanner = true,
  22. InspectorSelectButtonBuilder? inspectorSelectButtonBuilder,
  23. Map<ShortcutActivator, Intent>? shortcuts,
  24. Map<Type, Action<Intent>>? actions,
  25. String? restorationScopeId,
  26. bool useInheritedMediaQuery = false}
)

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

Implementation

WidgetsApp.router({
  Key? key,
  this.routeInformationProvider,
  required RouteInformationParser<Object> this.routeInformationParser,
  required RouterDelegate<Object> this.routerDelegate,
  BackButtonDispatcher? backButtonDispatcher,
  this.builder,
  this.title = '',
  this.onGenerateTitle,
  this.textStyle,
  required this.color,
  this.locale,
  this.localizationsDelegates,
  this.localeListResolutionCallback,
  this.localeResolutionCallback,
  this.supportedLocales = const <Locale>[Locale('en', 'US')],
  this.showPerformanceOverlay = false,
  this.checkerboardRasterCacheImages = false,
  this.checkerboardOffscreenLayers = false,
  this.showSemanticsDebugger = false,
  this.debugShowWidgetInspector = false,
  this.debugShowCheckedModeBanner = true,
  this.inspectorSelectButtonBuilder,
  this.shortcuts,
  this.actions,
  this.restorationScopeId,
  this.useInheritedMediaQuery = false,
}) : assert(
       routeInformationParser != null &&
       routerDelegate != null,
       'The routeInformationParser and routerDelegate cannot be null.',
     ),
     assert(title != null),
     assert(color != null),
     assert(supportedLocales != null && supportedLocales.isNotEmpty),
     assert(showPerformanceOverlay != null),
     assert(checkerboardRasterCacheImages != null),
     assert(checkerboardOffscreenLayers != null),
     assert(showSemanticsDebugger != null),
     assert(debugShowCheckedModeBanner != null),
     assert(debugShowWidgetInspector != null),
     navigatorObservers = null,
     backButtonDispatcher = backButtonDispatcher ?? RootBackButtonDispatcher(),
     navigatorKey = null,
     onGenerateRoute = null,
     pageRouteBuilder = null,
     home = null,
     onGenerateInitialRoutes = null,
     onUnknownRoute = null,
     routes = null,
     initialRoute = null,
     super(key: key);