PackageConfig class abstract

A package configuration.

Associates configuration data to packages and files in packages.

More members may be added to this class in the future, so classes outside of this package must not implement PackageConfig or any subclass of it.

Constructors

PackageConfig(Iterable<Package> packages, {Object? extraData})
Creates a package configuration with the provided available packages.
factory

Properties

extraData Object?
Extra data associated with the package configuration.
no setter
hashCode int
The hash code for this object.
no setterinherited
packages Iterable<Package>
All the available packages of this configuration.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
version int
The configuration version number.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
packageOf(Uri file) Package?
Provides the associated package for a specific file (or directory).
resolve(Uri packageUri) Uri?
Resolves a package: URI to a non-package URI
toPackageUri(Uri nonPackageUri) Uri?
The package URI which resolves to nonPackageUri.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String packageName) Package?
Look up a package by name.

Static Methods

parseBytes(Uint8List bytes, Uri baseUri, {void onError(Object error)?}) PackageConfig
Parses a package configuration file.
parseJson(Object? jsonData, Uri baseUri, {void onError(Object error)?}) PackageConfig
Parses the JSON data of a package configuration file.
parseString(String configuration, Uri baseUri, {void onError(Object error)?}) PackageConfig
Parses a package configuration file.
toJson(PackageConfig configuration, [Uri? baseUri]) Map<String, Object?>
Converts a configuration to a JSON-like data structure.
writeBytes(PackageConfig configuration, Sink<Uint8List> output, [Uri? baseUri]) → void
Writes a configuration file for this configuration on output.
writeString(PackageConfig configuration, StringSink output, [Uri? baseUri]) → void
Writes a configuration JSON text for this configuration on output.

Constants

empty → const PackageConfig
An empty package configuration.
maxVersion → const int
The largest configuration version currently recognized.