loadConfig method

Future<PackageResolver> loadConfig (
  1. dynamic uri,
  2. {Client client}
)

Loads a package config file from uri and returns its package resolution strategy.

This supports file:, http:, data: and package: URIs. It throws an UnsupportedError for any other schemes. If client is passed and an HTTP request is needed, it's used to make that request; otherwise, a default client is used.

uri may be a String or a Uri.

Implementation

static Future<PackageResolver> loadConfig(uri, {http.Client client}) async {
  var resolver = await SyncPackageResolver.loadConfig(uri, client: client);
  return resolver.asAsync;
}