PackageResolver class

A class that defines how to resolve package: URIs.

This includes the information necessary to resolve package: URIs using either a package config or a package root. It can be used both as a standard cross-package representation of the user's configuration, and as a means of concretely locating packages and the assets they contain.

Unlike SyncPackageResolver, this does not provide synchronous APIs. This is necessary when dealing with the current Isolate's package resolution strategy.

This class should not be implemented by user code.


PackageResolver.config(Map<String, Uri> packageConfigMap, {dynamic uri})
Returns the package resolution strategy for the given packageConfigMap. [...]
PackageResolver.root(dynamic packageRoot)
Returns the package resolution strategy for the given packageRoot, which may be a String or a Uri.


asSync → Future<SyncPackageResolver>
Fetches the package resolution for this and returns an object that provides synchronous access. [...]
hashCode → int
The hash code for this object. [...]
read-only, inherited
packageConfigMap → Future<Map<String, Uri>>
The map contained in the parsed package config. [...]
packageConfigUri → Future<Uri>
The URI for the package config. [...]
packageRoot → Future<Uri>
The base URL for resolving package: URLs. [...]
processArgument → Future<String>
Returns the argument to pass to a subprocess to get it to use this package resolution strategy when resolving package: URIs. [...]
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
packagePath(String package) → Future<String>
Returns the path on the local filesystem to the root of package, or null if the root cannot be found. [...]
packageUriFor(dynamic uri) → Future<Uri>
Returns the package: URI for uri. [...]
resolveUri(dynamic packageUri) → Future<Uri>
Resolves packageUri according to this package resolution strategy. [...]
toString() → String
Returns a string representation of this object.
urlFor(String package, [String path]) → Future<Uri>
Returns the resolved URL for package and path. [...]


operator ==(Object other) → bool
The equality operator. [...]

Static Properties

current PackageResolver
Returns package resolution strategy describing how the current isolate resolves package: URIs.
none PackageResolver
Returns a package resolution strategy that is unable to resolve any package: URIs.

Static Methods

loadConfig(dynamic uri, {Client client}) → Future<PackageResolver>
Loads a package config file from uri and returns its package resolution strategy. [...]