No need update check for web

This commit is contained in:
2026-03-12 20:38:19 +08:00
parent 0bd2a94ece
commit 9267ebee2c
5 changed files with 83 additions and 31 deletions
+10 -8
View File
@@ -2,13 +2,14 @@
/// `AppUpdateService` fetches the most recent entry and compares it against the
/// running application's build number.
class AppVersion {
/// Incrementing integer that matches the Android `versionCode`.
final int versionCode;
/// Version string, e.g. `1.2.3` or `2026.03.12`. Stored as text in
/// the database so semantic versions are allowed.
final String versionCode;
/// If the device is running a build number that is *strictly less* than this
/// value the update is considered "forced" and the user cannot continue
/// using the existing install.
final int minVersionRequired;
/// using the existing install. Also a string.
final String minVersionRequired;
/// A publiclyaccessible URL pointing at an APK stored in Supabase Storage.
final String downloadUrl;
@@ -25,8 +26,8 @@ class AppVersion {
factory AppVersion.fromMap(Map<String, dynamic> map) {
return AppVersion(
versionCode: map['version_code'] as int,
minVersionRequired: map['min_version_required'] as int,
versionCode: map['version_code']?.toString() ?? '',
minVersionRequired: map['min_version_required']?.toString() ?? '',
downloadUrl: map['download_url'] as String,
releaseNotes: map['release_notes'] as String? ?? '',
);
@@ -40,8 +41,9 @@ class AppUpdateInfo {
/// table was empty (should not happen in normal operation).
final AppVersion? latestVersion;
/// Current build number as reported by ``package_info_plus``.
final int currentBuildNumber;
/// Current build number / version string. May be empty on non-Android
/// platforms since checkForUpdate is skipped there.
final String currentBuildNumber;
/// ``true`` when ``currentBuildNumber < latestVersion.versionCode``.
final bool isUpdateAvailable;