FLUTTER ECOSYSTEM

KevMorelli/version_tracker

Flutter 的 Xamarin.Essentials VersionTracking

version_tracker 專案封面
Stars
11
Forks
4
最近推送(UTC)
2025年11月4日
專案狀態
未封存
Kevin Morelli GitHub avatar
GITHUB User

Kevin Morelli ↗

Argentina
語言Dart

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 5 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Pub Version GitHub

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

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.

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):

vt.isFirstLaunchEver;        // false
vt.isFirstLaunchForVersion;  // true
vt.isFirstLaunchForBuild;    // true

vt.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 ]