WidgetsApp.router constructor Null safety
- {Key? key,
- RouteInformationProvider? routeInformationProvider,
- required RouteInformationParser<
Object> routeInformationParser, - required RouterDelegate<
Object> routerDelegate, - BackButtonDispatcher? backButtonDispatcher,
- TransitionBuilder? builder,
- String title = '',
- GenerateAppTitle? onGenerateTitle,
- TextStyle? textStyle,
- required Color color,
- Locale? locale,
- Iterable<
LocalizationsDelegate> ? localizationsDelegates, - LocaleListResolutionCallback? localeListResolutionCallback,
- LocaleResolutionCallback? localeResolutionCallback,
- Iterable<
Locale> supportedLocales = const <Locale>[Locale('en', 'US')], - bool showPerformanceOverlay = false,
- bool checkerboardRasterCacheImages = false,
- bool checkerboardOffscreenLayers = false,
- bool showSemanticsDebugger = false,
- bool debugShowWidgetInspector = false,
- bool debugShowCheckedModeBanner = true,
- InspectorSelectButtonBuilder? inspectorSelectButtonBuilder,
- Map<
ShortcutActivator, Intent> ? shortcuts, - Map<
Type, Action< ? actions,Intent> > - String? restorationScopeId,
- 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);