Version class

Provides immutable storage and comparison of semantic version numbers.

Implemented types

Constructors

Version(int major, int minor, int patch, {List<String> preRelease = const <String>[], String build = ""})
Creates a new instance of Version.

Properties

build String
Build information relevant to the version. Does not contribute to sorting.
final
hashCode int
The hash code for this object.
no setteroverride
major int
The major number of the version, incremented when making breaking changes.
final
minor int
The minor number of the version, incremented when adding new functionality in a backwards-compatible manner.
final
patch int
The patch number of the version, incremented when making backwards-compatible bug fixes.
final
preRelease List<String>
Pre-release information segments.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(Version? other) int
Compares this object to another object.
override
hasNumericPreRelease() bool
incrementMajor() Version
Creates a new Version with the major version number incremented.
incrementMinor() Version
Creates a new Version with the minor version number incremented.
incrementPatch() Version
Creates a new Version with the patch version number incremented.
leadingPreRelease() String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numericPrelease() int
toString() String
Returns a String representation of the Version.
override

Operators

operator <(dynamic o) bool
Determines whether the left-hand Version represents a lower precedence than the right-hand Version.
operator <=(dynamic o) bool
Determines whether the left-hand Version represents an equal or lower precedence than the right-hand Version.
operator ==(dynamic o) bool
Determines whether the left-hand Version represents an equal precedence to the right-hand Version.
override
operator >(dynamic o) bool
Determines whether the left-hand Version represents a greater precedence than the right-hand Version.
operator >=(dynamic o) bool
Determines whether the left-hand Version represents an equal or greater precedence than the right-hand Version.

Static Methods

parse(String? versionString) Version
Creates a Version instance from a string.