PackageId class

A reference to a specific version of a package.

A package ID contains enough information to correctly retrieve the package.

It's possible for multiple distinct package IDs to point to different packages that have identical contents. For example, the same package may be available from multiple sources. As far as Pub is concerned, those packages are different.

Note that a package ID's description field is a ResolvedDescription while PackageRef.description and PackageRange.description are Descriptions.

Constructors

PackageId(String name, Version version, ResolvedDescription description)
Creates an ID for a package with the given name, source, version, and description.

Properties

description → ResolvedDescription
final
hashCode int
The hash code for this object.
no setteroverride
isRoot bool
no setter
name String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source → Source
no setter
version → Version
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toRange() PackageRange
Returns a PackageRange that allows only version of this package.
toRef() PackageRef
toString([PackageDetail? detail]) String
A string representation of this object.
override

Operators

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

Static Methods

root(Package package) PackageId
Creates an ID for the given root package.