createRoutingSystem method

  1. @override
RoutingSystem<Object> createRoutingSystem([
  1. RouterDelegate? parent
])
override

Implementation

@override
RoutingSystem createRoutingSystem([RouterDelegate? parent]) {
  final state = FRouteState(historyObservers: historyObservers);
  var initialAppRoute = routes.matchRoute(initialRoute)!.route!;

  final delegate = (parent is FRouterDelegate)
      ? FRouterDelegate(state, routes,
          parent: parent,
          path: path,
          preferUpdates: preferUpdates,
          initialRoute: initialAppRoute,
          navigatorKey: navigatorKey,
          historyObservers: historyObservers)
      : FRouterDelegate.root(state, routes,
          historyObservers: historyObservers,
          preferUpdates: preferUpdates,
          path: path,
          initialRoute: initialAppRoute,
          navigatorKey: navigatorKey);

  return FluroRoutingSystem._(
    delegate: delegate,
    parser: FRouterInformationParser(routes, delegate),
    state: state,
    provider: FRouterRootProviderPlatform(
      state: state,
      initialRoute:
          RouteInformation(location: delegate.calculateInitialRoute()),
    ),
  );
}