Router<T> constructor
- Key? key,
- RouteInformationProvider? routeInformationProvider,
- RouteInformationParser<
T> ? routeInformationParser, - required RouterDelegate<
T> routerDelegate, - BackButtonDispatcher? backButtonDispatcher,
- String? restorationScopeId,
Creates a router.
The routeInformationProvider and routeInformationParser can be null if this router does not depend on route information. A common example is a sub router that builds its content completely based on the app state.
The routeInformationProvider and routeInformationParser must both be provided or not provided.
Implementation
const Router({
super.key,
this.routeInformationProvider,
this.routeInformationParser,
required this.routerDelegate,
this.backButtonDispatcher,
this.restorationScopeId,
}) : assert(
routeInformationProvider == null || routeInformationParser != null,
'A routeInformationParser must be provided when a routeInformationProvider is specified.',
);