version 1.0.2 copy "version: ^1.0.2" to clipboard
version: ^1.0.2 copied to clipboard

outdatedDart 1 only

Provides a simple class for parsing and comparing semantic versions as defined by http://semver.org/

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/

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.

255
likes
0
pub points
99%
popularity

Publisher

verified publisherdart.ninja

Provides a simple class for parsing and comparing semantic versions as defined by http://semver.org/

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on version