FLUTTER ECOSYSTEM

sanmadjack/version_dart

Version 클래스를 제공하는 Dart 라이브러리

버전 프로젝트 이미지
Stars
46
Forks
13
최근 푸시(UTC)
2026. 6. 12.
프로젝트 상태
활성
Matthew Barbour GitHub avatar
GITHUB User

Matthew Barbour ↗

언어DartShell

사용 중인 의존성

의존성 목록 1 개
  • test개발 의존성^1.16.3

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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.