configureRoutesAsync method

Future<List<RouteBase>> configureRoutesAsync({
  1. String modulePath = '',
  2. bool topLevel = false,
  3. String? parentModuleName,
  4. String? parentModulePath,
  5. String parentRoutePath = '',
})

Asynchronous variant of configureRoutes.

Default implementation simply wraps configureRoutes in a completed Future. Override in subclasses that need to await initialization (e.g. feature flags, dynamic module loading) before producing routes.

Will become the canonical entry point in 5.0 once configureRoutes is removed.

Implementation

// ignore: deprecated_member_use_from_same_package
Future<List<RouteBase>> configureRoutesAsync({
  String modulePath = '',
  bool topLevel = false,
  String? parentModuleName,
  String? parentModulePath,
  String parentRoutePath = '',
}) {
  // ignore: deprecated_member_use_from_same_package
  return Future.value(configureRoutes(
    modulePath: modulePath,
    topLevel: topLevel,
    parentModuleName: parentModuleName,
    parentModulePath: parentModulePath,
    parentRoutePath: parentRoutePath,
  ));
}