initRouter method
Implementation
@override
void initRouter(
{String? initialLocation,
required List<g.RouteBase> routes,
required GlobalKey<NavigatorState> rootNavigatorKey}) {
final allRoutes = _finalizeRoutes(routes);
_routingConfig.value = RoutingConfig(routes: allRoutes);
_router = GoRouter.routingConfig(
initialLocation: initialLocation ?? '/',
routingConfig: _routingConfig,
navigatorKey: rootNavigatorKey,
debugLogDiagnostics: kDebugMode,
observers: vyuh.analytics.observers,
errorBuilder: (context, state) => vyuh.widgetBuilder.routeErrorView(
context,
title: 'Failed to load route',
subtitle: state.matchedLocation,
error: state.error,
onRetry: () {
vyuh.tracker.init(vyuh.tracker.currentState.value);
},
),
);
}