VersionConstraint class

A VersionConstraint is a predicate that can determine whether a given version is valid or not.

For example, a ">= 2.0.0" constraint allows any version that is "2.0.0" or greater. Version objects themselves implement this to match a specific version.

Implemented by

Constructors

VersionConstraint.compatibleWith(Version version)
Creates a version constraint which allows all versions that are backward compatible with version. [...]
factory
VersionConstraint.intersection(Iterable<VersionConstraint> constraints)
Creates a new version constraint that is the intersection of constraints. [...]
factory
VersionConstraint.parse(String text)
Parses a version constraint. [...]
factory
VersionConstraint.unionOf(Iterable<VersionConstraint> constraints)
Creates a new version constraint that is the union of constraints. [...]
factory

Properties

isAny bool
Returns true if this constraint allows all versions.
read-only
isEmpty bool
Returns true if this constraint allows no versions.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

allows(Version version) bool
Returns true if this constraint allows version.
allowsAll(VersionConstraint other) bool
Returns true if this constraint allows all the versions that other allows.
allowsAny(VersionConstraint other) bool
Returns true if this constraint allows any of the versions that other allows.
difference(VersionConstraint other) VersionConstraint
Returns a VersionConstraint that allows Versions allowed by this but not other.
intersect(VersionConstraint other) VersionConstraint
Returns a VersionConstraint that only allows Versions allowed by both this and other.
union(VersionConstraint other) VersionConstraint
Returns a VersionConstraint that allows Versionss allowed by either this or other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(other) bool
The equality operator. [...]
inherited

Static Properties

any VersionConstraint
A VersionConstraint that allows all versions.
read / write
empty VersionConstraint
A VersionConstraint that allows no versions -- the empty set.
read / write