version
3.0.2, released 4 years ago by comstar.dev
Parses and compares semantic version numbers in compliance with http://semver.org/
What it does
Provides a Version object to parse, compare, and increment version numbers that follow the Semantic Versioning specification. It handles features like pre-release tags and comparison operators directly in Dart.
AI-written summary of version 3.0.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to parse semantic version strings in your Dart or Flutter application
- You need to compare different application or dependency versions
- You want strict adherence to the http://semver.org/ specification
Skip it when
- You specifically require the pub_semver package behavior which deviates from the standard semver spec in specific ways
- You do not need version parsing or comparison utilities
Strengths
- Compliant with the Semantic Versioning 2.0.0 specification
- Supports pre-release and build validation
- Simple and straightforward API with standard comparison operators
Weaknesses
- Diverts from pub_semver which may be expected in some pub-related tooling
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
none
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");
}
}Alternatives
Packages that do the same job and could replace version.
- string_scanner
A class for parsing strings using a sequence of patterns.
81Compare - rrule
Recurrence rule parsing, calculation, and formatting as defined in the iCalendar RFC.
64Compare - japx
Lightweight parser that flattens and builds JSON:API structures.
50Compare - unicode
Library providing Unicode character utilities and emoji data generated from Unicode 17.0.0
54Compare
Works with
Packages commonly used together with version: ones it builds on, ones built on it, and its own family.
- upgraderBuilt on versionPrompt users to upgrade when a newer version of the app is available in the store.
- patrol_cliBuilt on versionCommand-line tool to run and debug Patrol UI tests on multiple platforms
- docker_commanderBuilt on versionDocker manager for local and remote host machines to automate Docker Daemons and Swarms.
- nextcloudBuilt on versionA Nextcloud API client written in Dart supporting maintained server versions.
- get_cliBuilt on versionOfficial CLI for the GetX framework to scaffold projects, files, and manage dependencies.
- flutter_app_infoBuilt on versionAccess device, platform, target, and app version information via an inherited widget.
- innosetupBuilt on versionMake Windows installers for Flutter and Dart apps using Inno Setup.