Version class

A parsed semantic version number.

Implements

Constructors

Version(int major, int minor, int patch, { String pre, String build })
Creates a new Version object.
factory
Version.parse(String text)
Creates a new Version by parsing text.
factory

Properties

build List
The build identifier: "foo" in "1.2.3+foo". [...]
final
hashCode int
The hash code for this object. [...]
read-only
includeMax bool
If true, then max is allowed by the range.
read-only
includeMin bool
If true then min is allowed by the range.
read-only
isAny bool
Returns true if this constraint allows all versions.
read-only
isEmpty bool
Returns true if this constraint allows no versions.
read-only
isPreRelease bool
Whether or not this is a pre-release version.
read-only
major int
The major version number: "1" in "1.2.3".
final
max Version
The maximum end of the range. [...]
read-only
min Version
The minimum end of the range. [...]
read-only
minor int
The minor version number: "2" in "1.2.3".
final
nextBreaking Version
Gets the next breaking version number that follows this one. [...]
read-only
nextMajor Version
Gets the next major version number that follows this one. [...]
read-only
nextMinor Version
Gets the next minor version number that follows this one. [...]
read-only
nextPatch Version
Gets the next patch version number that follows this one. [...]
read-only
patch int
The patch version number: "3" in "1.2.3".
final
preRelease List
The pre-release identifier: "foo" in "1.2.3-foo". [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

allows(Version other) bool
Tests if other matches this version exactly.
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
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 <(Version other) bool
operator <=(Version other) bool
operator ==(other) bool
The equality operator. [...]
operator >(Version other) bool
operator >=(Version other) bool

Static Properties

none Version
No released version: i.e. "0.0.0".
read-only

Static Methods

antiprioritize(Version a, Version b) int
Like prioritize, but lower version numbers are considered greater than higher version numbers. [...]
primary(List<Version> versions) Version
Returns the primary version out of a list of candidates. [...]
prioritize(Version a, Version b) int
Compares a and b to see which takes priority over the other. [...]