Version class

Represents a software version using semantic versioning, which is a widely adopted versioning format.

  • Major version (first number): Incremented for incompatible API changes or major rewrites. Users should expect breaking changes.
  • Minor version (second number): Incremented for new features that are backward-compatible. Existing functionality remains valid.
  • Patch version (third number): Incremented for bug fixes or small improvements that do not add new features or break compatibility.

Constructors

Version(int major, int minor, int patch)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
major int
final
minor int
final
patch int
The patch version number (also called revision or bugfix level).
final
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

parse(String versionString) Version
Parses a version string into a Version instance. Expects a format like "major.minor.patch" or "major.minor". If patch is missing, it defaults to 0.