createNavigator function
InjectedNavigator
createNavigator(
{ - required Map<String, Widget Function(RouteData data)> routes,
- String? initialLocation,
- Widget unknownRoute(
- RouteData data
)?,
- Widget builder(
- Widget routerOutlet
)?,
- Page pageBuilder(
- MaterialPageArgument arg
)?,
- bool shouldUseCupertinoPage = false,
- Widget transitionsBuilder(
- BuildContext context,
- Animation<double> animation,
- Animation<double> secondAnimation,
- Widget child,
)?,
- Duration? transitionDuration,
- Redirect? onNavigate(
- RouteData data
)?,
- bool? onNavigateBack(
- RouteData? data
)?,
- bool debugPrintWhenRouted = false,
- bool ignoreUnknownRoutes = false,
- List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
})
Implementation
InjectedNavigator createNavigator({
required Map<String, Widget Function(RouteData data)> routes,
String? initialLocation,
Widget Function(RouteData data)? unknownRoute,
Widget Function(Widget routerOutlet)? builder,
Page<dynamic> Function(MaterialPageArgument arg)? pageBuilder,
bool shouldUseCupertinoPage = false,
Widget Function(
BuildContext context,
Animation<double> animation,
Animation<double> secondAnimation,
Widget child,
)? transitionsBuilder,
Duration? transitionDuration,
Redirect? Function(RouteData data)? onNavigate,
bool? Function(RouteData? data)? onNavigateBack,
bool debugPrintWhenRouted = false,
bool ignoreUnknownRoutes = false,
List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
}) {
final navigationBuilder = NavigationBuilder.create(
routes: routes,
unknownRoute: unknownRoute,
transitionsBuilder: transitionsBuilder,
transitionDuration: transitionDuration,
builder: builder,
initialLocation: initialLocation,
shouldUseCupertinoPage: shouldUseCupertinoPage,
onNavigate: onNavigate,
onNavigateBack: onNavigateBack,
debugPrintWhenRouted: debugPrintWhenRouted,
pageBuilder: pageBuilder,
ignoreUnknownRoutes: ignoreUnknownRoutes,
navigatorObservers: navigatorObservers,
);
return InjectedNavigator().._navigationBuilder = navigationBuilder;
}