DartPackageLoader class

A ModuleLoader for Dart projects that use package: imports.

Resolution delegates to the in-memory VMModuleLoader (already-loaded units

  • core packages); package sources are brought into the VM by provision (via a PackageProvider) before resolution runs. Web-safe: the filesystem/ network work lives entirely in the injected PackageProvider.
Implemented types

Constructors

DartPackageLoader(ApolloVM vm, PackageProvider provider)

Properties

hashCode → int
The hash code for this object.
no setterinherited
importer → DartPackageImporter
latefinal
provider → PackageProvider
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
vm → ApolloVM
final

Methods

loadModule(String moduleId, {String? language}) → LoadedModule?
Loads the module with canonical id moduleId, or null.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
provision() → Future<List<ImportDiagnostic>>
Fetches and loads all reachable package: imports; see DartPackageImporter.provision.
resolveCorePackage(String importPath) → CorePackageBase?
Resolves importPath to a built-in core package, or null.
override
resolveModuleId(String importPath, {String? fromModule, String? language}) → String?
Normalizes importPath (optionally relative to fromModule) to the canonical id of a loadable module, or null if none matches.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited