SyncPackageResolver 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 PackageResolver, all members on this are synchronous, which may require that more data be loaded up front. This is useful when primarily dealing with user-created package resolution strategies, whereas PackageInfo is usually preferable when the current Isolate's package resolution logic may be used.

This class should not be implemented by user code.


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


asAsync PackageResolver
Returns a wrapper for this that implements PackageResolver.
hashCode int
The hash code for this object. [...]
read-only, inherited
packageConfigMap Map<String, Uri>
The map contained in the parsed package config. [...]
packageConfigUri Uri
The URI for the package config. [...]
packageRoot Uri
The base URL for resolving package: URLs. [...]
processArgument 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) String
Returns the path on the local filesystem to the root of package, or null if the root cannot be found. [...]
packageUriFor(dynamic url) Uri
Returns the package: URI for url. [...]
resolveUri(dynamic packageUri) Uri
Resolves packageUri according to this package resolution strategy. [...]
toString() String
Returns a string representation of this object.
urlFor(String package, [String path]) Uri
Returns the resolved URL for package and path. [...]


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

Static Properties

current Future<SyncPackageResolver>
Returns a package resolution strategy describing how the current isolate resolves package: URIs. [...]
none SyncPackageResolver
Returns a package resolution strategy that is unable to resolve any package: URIs.

Static Methods

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