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
aandbfor "which release is newer", with build metadata as the final tie-breaker. -
matchesChannel(
Version version, ReleaseChannel channel) → bool -
Whether
versioncarries the pre-release tagchannelstamps. -
parse(
String input, {String field = 'version'}) → Version -
Parses
inputas a semantic version. -
parseConstraint(
String input, {String field = 'constraint'}) → VersionConstraint -
Parses
inputas a version constraint ('^1.2.0','>=1.0.0 <2.0.0','any'). -
stamp(
Version version, ReleaseChannel channel, [int? build]) → Version -
Stamps
versionwithchannel's pre-release tag andbuildnumber, replacing any pre-release tag already present. -
tryParse(
String input) → Version? -
Parses
input, returningnullif it is not a valid version.