SemanticVersion class
Semantic version representation and comparison
- Implemented types
Constructors
- SemanticVersion({required int major, required int minor, required int patch, String? preRelease, String? buildMetadata})
- SemanticVersion.parse(String version)
-
Parse a version string (e.g., "1.2.3", "1.2.3-alpha", "1.2.3+build.1")
factory
Properties
- buildMetadata → String?
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- major → int
-
final
- minor → int
-
final
- patch → int
-
final
- preRelease → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
compareTo(
SemanticVersion other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
satisfies(
String requirement) → bool - Check if this version is compatible with a version requirement Examples:
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator <(
SemanticVersion other) → bool -
operator <=(
SemanticVersion other) → bool -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
SemanticVersion other) → bool -
operator >=(
SemanticVersion other) → bool
Static Methods
-
tryParse(
String version) → SemanticVersion? - Try to parse, returns null on failure