CachedSource class abstract

Base class for a BoundSource that installs packages into pub's SystemCache.

A source should be cached if it requires network access to retrieve packages or the package needs to be "frozen" at the point in time that it's installed. (For example, Git packages are cached because installing from the same repo over time may yield different commits.)

Constructors

CachedSource()

Properties

hashCode int
The hash code for this object.
no setterinherited
hasMultipleVersions bool
Whether this source can choose between multiple versions of the same package during version solving.
no setterinherited
name String
The name of the source.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

describeUncached(PackageId id, SystemCache cache) Future<Pubspec>
Loads the (possibly remote) pubspec for the package version identified by id.
doDescribe(PackageId id, SystemCache cache) Future<Pubspec>
If id is already in the system cache, just loads it from there.
doGetDirectory(PackageId id, SystemCache cache, {String? relativeFrom}) String
Returns the directory where this package can (or could) be found locally.
doGetVersions(PackageRef ref, Duration? maxAge, SystemCache cache) Future<List<PackageId>>
Get the IDs of all versions that match ref.
inherited
downloadToSystemCache(PackageId id, SystemCache cache) Future<DownloadPackageResult>
Downloads the package identified by id to the system cache.
getAdvisoriesForPackage(PackageId id, SystemCache cache, Duration? maxAge) Future<List<Advisory>?>?
inherited
getAdvisoriesForPackageVersion(PackageId id, SystemCache cache, Duration? maxAge) Future<List<Advisory>?>?
inherited
getCachedPackages(SystemCache cache) List<Package>
Returns the Packages that have been downloaded to the system cache.
getDirectoryInCache(PackageId id, SystemCache cache) String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseId(String name, Version version, Object? description, {String? containingDir}) PackageId
Parses a PackageId from a name and a serialized description.
inherited
parseRef(String name, Object? description, {required Description containingDescription, required LanguageVersion languageVersion}) PackageRef
Parses a PackageRef from a name and a user-provided description.
inherited
repairCachedPackages(SystemCache cache) Future<Iterable<RepairResult>>
Reinstalls all packages that have been previously installed into the system cache by this source.
status(PackageRef ref, Version version, SystemCache cache, {Duration? maxAge}) Future<PackageStatus>
Returns metadata about a given package-version.
inherited
toString() String
Returns the source's name.
inherited

Operators

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