HRouter constructor
HRouter({
- String? basePath,
- List<
HRoute> routes = const [], - RouterConfig? config,
Implementation
factory HRouter({
String? basePath,
List<HRoute> routes = const [],
RouterConfig? config,
}) {
String nonNullBasePath = basePath ?? '';
RouterConfig nonNullConfig = config ?? RouterConfig();
HRouter router = HRouter._(
config: nonNullConfig,
routes: _flattenRoutes(routes, nonNullBasePath, nonNullConfig),
basePath: nonNullBasePath,
);
nonNullConfig.onLoadedRoutes(router.routes);
return router;
}