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, ornull.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
importPathto a built-in core package, ornull.override -
resolveModuleId(
String importPath, {String? fromModule, String? language}) → String? -
Normalizes
importPath(optionally relative tofromModule) to the canonical id of a loadable module, ornullif none matches.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited