FLUTTER ECOSYSTEM

sanmadjack/version_dart

Eine Dart-Bibliothek, die eine Version-Klasse bereitstellt

Projektcover von Version
Stars
46
Forks
13
Letzter Push (UTC)
12.06.2026
Projektstatus
Aktiv
Matthew Barbour GitHub avatar
GITHUB User

Matthew Barbour ↗

SprachenDartShell

Verwendete Abhängigkeiten

Abhängigkeiten 1 Einträge
  • testEntwicklung^1.16.3

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Projekt-README ein-/ausklappen

version

version 3.0.2 Tests Coverage Status

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.