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.
Constructors
-
PackageResolver.config(Map<
String, Uri> packageConfigMap, {dynamic uri}) -
Returns the package resolution strategy for the given
packageConfigMap
. [...]factory - PackageResolver.root(dynamic packageRoot)
-
Returns the package resolution strategy for the given
packageRoot
, which may be aString
or aUri
.factory
Properties
-
asSync
→ Future<
SyncPackageResolver> -
Fetches the package resolution for this and returns an object that
provides synchronous access. [...]
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
-
packageConfigMap
→ Future<
Map< String, Uri> > -
The map contained in the parsed package config. [...]
read-only
-
packageConfigUri
→ Future<
Uri> -
The URI for the package config. [...]
read-only
-
packageRoot
→ Future<
Uri> -
The base URL for resolving
package:
URLs. [...]read-only -
processArgument
→ Future<
String> -
Returns the argument to pass to a subprocess to get it to use this package
resolution strategy when resolving
package:
URIs. [...]read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
packagePath(
String package) → Future< String> -
Returns the path on the local filesystem to the root of
package
, ornull
if the root cannot be found. [...] -
packageUriFor(
dynamic uri) → Future< Uri> -
Returns the
package:
URI foruri
. [...] -
resolveUri(
dynamic packageUri) → Future< Uri> -
Resolves
packageUri
according to this package resolution strategy. [...] -
toString(
) → String -
Returns a string representation of this object.
inherited
-
urlFor(
String package, [String path]) → Future< Uri> -
Returns the resolved URL for
package
andpath
. [...]
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited
Static Properties
- current → PackageResolver
-
Returns package resolution strategy describing how the current isolate
resolves
package:
URIs.final - none → PackageResolver
-
Returns a package resolution strategy that is unable to resolve any
package:
URIs.final
Static Methods
-
loadConfig(
dynamic uri, {Client client}) → Future< PackageResolver> -
Loads a package config file from
uri
and returns its package resolution strategy. [...]