Versions class

Version helpers that fail with OmnyStore's own typed exceptions instead of pub_semver's FormatException.

The difference matters at the API and CLI boundaries: a malformed version in a request body should render as a 400 with ErrorCodes.validationError, not escape as an unmapped FormatException.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

baseOf(Version version) Version
The version with the pre-release tag and build metadata stripped — the stable version a pre-release is working towards.
compare(Version a, Version b) int
Compares a and b for "which release is newer", with build metadata as the final tie-breaker.
matchesChannel(Version version, ReleaseChannel channel) bool
Whether version carries the pre-release tag channel stamps.
parse(String input, {String field = 'version'}) Version
Parses input as a semantic version.
parseConstraint(String input, {String field = 'constraint'}) VersionConstraint
Parses input as a version constraint ('^1.2.0', '>=1.0.0 <2.0.0', 'any').
stamp(Version version, ReleaseChannel channel, [int? build]) Version
Stamps version with channel's pre-release tag and build number, replacing any pre-release tag already present.
tryParse(String input) Version?
Parses input, returning null if it is not a valid version.