Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KevMorelli/version_tracker
Xamarin.Essentials VersionTracking for Flutter
https://github.com/KevMorelli/version_tracker
dart dart-package flutter flutter-package flutter-plugin pub
Last synced: about 2 months ago
JSON representation
Xamarin.Essentials VersionTracking for Flutter
- Host: GitHub
- URL: https://github.com/KevMorelli/version_tracker
- Owner: KevMorelli
- License: mit
- Created: 2021-03-27T22:11:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-03T11:34:34.000Z (5 months ago)
- Last Synced: 2024-07-26T21:58:59.496Z (about 2 months ago)
- Topics: dart, dart-package, flutter, flutter-package, flutter-plugin, pub
- Language: Dart
- Homepage:
- Size: 405 KB
- Stars: 10
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Pub Version](https://img.shields.io/pub/v/version_tracker)](https://pub.dev/packages/version_tracker)
[![GitHub](https://img.shields.io/github/license/KevMorelli/version_tracker)](https://github.com/KevMorelli/version_tracker/blob/main/LICENSE)# VersionTracker
Local version and build tracker plugin. Provides the ability to keep track of previous installations and easily migrate data between upgrades.
## Usage
Call this on the main function
```dart
var vt = VersionTracker();
await vt.track();
```You can also set the max number for version and build history by giving a value to ``buildHistoryMaxLength`` and ``versionHistoryMaxLength`` in the track function.
```dart
var vt = VersionTracker();
await vt.track(buildHistoryMaxLength: 10, versionHistoryMaxLength: 10);
```Then call these whenever you want (in these examples the user has launched a bunch of previous versions, and this is the first time he's launched the new version 1.0.11):
```dart
vt.isFirstLaunchEver; // false
vt.isFirstLaunchForVersion; // true
vt.isFirstLaunchForBuild; // truevt.currentVersion; // 1.0.11
vt.previousVersion; // 1.0.10
vt.firstInstalledVersion; // 1.0.0
vt.versionHistory; // [ 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.10, 1.0.11 ]vt.currentBuild; // 18
vt.previousBuild; // 15
vt.firstInstalledBuild; // 1
vt.buildHistory; // [ 1, 2, 3, 4, 5, 8, 9, 10, 11, 13, 15, 18 ]
```