AppVersion class abstract final

Provides cached access to the application's version metadata and helpers for update checks.

final info = await AppVersion.info;
print(info.version);  // '1.2.3'

if (await AppVersion.isUpdateAvailable(latestVersion: '2.0.0')) {
  await AppVersion.openStoreForUpdate();
}

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

info Future<VersionInfo>
Returns the application's version info, fetching and caching it on the first call.
no setter

Static Methods

clearCache() → void
Clears the cached VersionInfo.
isUpdateAvailable({required String latestVersion}) Future<bool>
Returns true if latestVersion is newer than the installed version.
openStoreForUpdate() Future<void>
Opens the platform app store page for this application so the user can update.