PubCache class

A programmatic API for reflecting on Pub's cache directory.

Constructors

PubCache([Directory? dir])
Create a pubcache instance. dir defaults to the default platform pub cache location.

Properties

hashCode int
The hash code for this object.
no setterinherited
location Directory
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAllPackageVersions(String packageName) List<PackageRef>
Return all available cached versions for a given package.
getBinScripts() List<File>
Return the contents of bin/ - the scripts for the activated applications.
getCachedPackages() List<String>
Return the list of package names (not versions) that are available in the cache.
getGlobalApplications() List<Application>
Return applications that have been installed via pub global activate.
getLatestVersion(String packageName, {bool includePreRelease = false}) PackageRef?
Return the most recent verison of the given package contained in the cache. This method will prefer to return only release verions. If includePreRelease is true, then the very latest verision will be returned, include pre-release versions.
getPackageRefs() List<PackageRef>
Get all the packages and their versions that have been installed into the cache.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getSystemCacheLocation() Directory
Return the location of Pub's package cache.