configureRoutes method
- @Deprecated('Use configureRoutesAsync — will be removed in 5.0')
Synchronous route configuration entry point.
Walks the module tree and produces the flattened list of RouteBase
consumed by GoRouter.
Migration: prefer configureRoutesAsync for new modules — it allows awaiting async setup (feature flags, remote config, lazy module loading) before route construction. This method will be removed in 5.0.
Implementation
@Deprecated('Use configureRoutesAsync — will be removed in 5.0')
List<RouteBase> configureRoutes({
String modulePath = '',
bool topLevel = false,
String? parentModuleName,
String? parentModulePath,
String parentRoutePath = '',
}) {
return [
..._createChildRoutes(
routeList: null,
topLevel: topLevel,
parentModuleName: parentModuleName,
parentModulePath: parentModulePath,
parentRoutePath: parentRoutePath,
),
..._createModuleRoutes(
routeList: null,
modulePath: modulePath,
topLevel: topLevel,
grandParentModuleName: parentModuleName,
grandParentModulePath: parentModulePath,
),
..._createShellRoutes(topLevel),
];
}