generateRoute static method

Route? generateRoute(
  1. RouteSettings settings
)

生成路由

Implementation

static Route<dynamic>? generateRoute(RouteSettings settings) {
  final String? name = settings.name;
  RouteOptions? options = routes[name];
  if (name == null || options == null) {
    MeteorLog.error('No registered route was found with name $name for $settings.');
    options = routes['UnknownRouteName'];
    if (options == null) {
      return _notFoundRoute('UnknownRouteName', maintainState: true);
    } else {
      return options.createRoute(settings);
    }
  }
  return options.createRoute(settings);
}