app_version_compare

Last updated:

0 purchases

app_version_compare Image
app_version_compare Images
Add to Cart

Description:

app version compare

App Version Compare #



Overview #
This Dart package provides a utility for parsing version strings according to Semantic Versioning (SemVer) and comparing two versions. It's particularly useful for managing app versions and implementing version comparison logic, such as determining whether a force update is required based on a version retrieved from a remote configuration.
Installation #
You can install this package via pub.dev. Add the following line to your pubspec.yaml file:
Then, run:
flutter pub add app_version_compare
copied to clipboard
Usage #
Comparing Versions #
void main() {
final remoteConfigVersion = '1.2.4';
final appVersion = '1.2.3';

final remoteVersion = AppVersion.fromString(remoteConfigVersion);
final appCurrentVersion = AppVersion.fromString(appVersion);

if (appCurrentVersion >= remoteVersion) {
print('The app is updated!');
print('Current app version: $appCurrentVersion');
print('Latest version available: $remoteVersion');
} else {
print('The app is out of date!');
print('Current app version: $appCurrentVersion');
print('Latest version available: $remoteVersion');
}
}
copied to clipboard
Support #
For any issues or suggestions, please open an issue on GitHub.
License #
This package is licensed under the MIT License. See the LICENSE file for details.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.