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.

Constructors

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

Properties

asAsync PackageResolver
Returns a wrapper for this that implements PackageResolver.
read-only
packageConfigMap Map<String, Uri>
The map contained in the parsed package config. [...]
read-only
packageConfigUri Uri
The URI for the package config. [...]
read-only
packageRoot Uri
The base URL for resolving package: URLs. [...]
read-only
processArgument String
Returns the argument to pass to a subprocess to get it to use this package resolution strategy when resolving package: URIs. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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. [...]
urlFor(String package, [ String path ]) Uri
Returns the resolved URL for package and path. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Properties

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

Static Methods

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