VersionRange class

Constrains versions to a fall within a given range.

If there is a minimum, then this only allows versions that are at that minimum or greater. If there is a maximum, then only versions less than that are allowed. In other words, this allows >= min, < max.

Version ranges are ordered first by their lower bounds, then by their upper bounds. For example, >=1.0.0 <2.0.0 is before >=1.5.0 <2.0.0 is before >=1.5.0 <3.0.0.

Implements
Implemented by

Constructors

VersionRange({Version min, Version max, bool includeMin: false, bool includeMax: false })
Creates a new version range from min to max, either inclusive or exclusive. [...]

Properties

hashCode int
The hash code for this object. [...]
read-only
includeMax bool
If true, then max is allowed by the range.
final
includeMin bool
If true then min is allowed by the range.
final
isAny bool
Returns true if this constraint allows all versions.
read-only
isEmpty bool
Returns true if this constraint allows no versions.
read-only
max Version
The maximum end of the range. [...]
final
min Version
The minimum end of the range. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

allows(Version other) bool
Tests if other falls within this version range.
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.
compareTo(VersionRange other) int
Compares this object to another Comparable [...]
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.
toString() String
Returns a string representation of this object.
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

Operators

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