createNavigator function

InjectedNavigator createNavigator({
  1. required Map<String, Widget Function(RouteData data)> routes,
  2. String? initialLocation,
  3. Widget unknownRoute(
    1. RouteData data
    )?,
  4. Widget builder(
    1. Widget routerOutlet
    )?,
  5. Page pageBuilder(
    1. MaterialPageArgument arg
    )?,
  6. bool shouldUseCupertinoPage = false,
  7. Widget transitionsBuilder(
    1. BuildContext context,
    2. Animation<double> animation,
    3. Animation<double> secondAnimation,
    4. Widget child,
    )?,
  8. Duration? transitionDuration,
  9. Redirect? onNavigate(
    1. RouteData data
    )?,
  10. bool? onNavigateBack(
    1. RouteData? data
    )?,
  11. bool debugPrintWhenRouted = false,
  12. bool ignoreUnknownRoutes = false,
  13. 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;
}