version
A dart library providing a Version class
- Stars
- 46
- Forks
- 13
- Last push (UTC)
- Jun 12, 2026
- Project status
- Active
Original README
English project snapshot. Visit GitHub for the latest content.
version
A dart library providing a Version object for comparing and incrementing version numbers in compliance with the Semantic Versioning spec at http://semver.org/
This is in contrast to pub_semver, which is close to the spec but diverts in a few specific ways.
Installation
In your pubspec.yaml:
dependencies:
version: ^3.0.0
Usage
A simple usage example:
import 'package:version/version.dart';
void main() {
Version currentVersion = new Version(1, 0, 3);
Version latestVersion = Version.parse("2.1.0");
if (latestVersion > currentVersion) {
print("Update is available");
}
Version betaVersion = new Version(2, 1, 0, preRelease: ["beta"]);
// Note: this test will return false, as pre-release versions are considered
// lesser then a non-pre-release version that otherwise has the same numbers.
if (betaVersion > latestVersion) {
print("More recent beta available");
}
}
Features and bugs
Please file feature requests and bugs at the issue tracker.
LanguagesDartShell
Dependencies used
Dependency list 1 items
- testDevelopment
^1.16.3
How do I choose a repository?
Start with your use case, compare repository activity, and check the original project before adopting it.
- Search by repository name, owner or description, then narrow the results by topic.
- Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
- Read the README, license and issues on GitHub before using a project.
Sources and maintenance
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗
- sanmadjack/version_dart · GitHub ↗
- GitHub Docs — Saving repositories with stars ↗
- Directory maintained by Ducafecat ↗