NewVersionChecker class

Checks whether a newer version of this app is available on the iOS App Store or Android Play Store, by querying each store's public lookup endpoint directly — no server of your own needed.

Known limitation: both the iOS and Android lookups are best-effort scraping/parsing of endpoints neither store publishes as a stable, documented API — the iTunes lookup JSON shape and the Play Store listing HTML have both changed unannounced in the past, elsewhere breaking similar packages' version detection outright. This checker fails soft (returns null / UpdateUrgency.none rather than throwing) when a response doesn't parse as expected, but a null result should never be treated as proof no update exists.

Constructors

NewVersionChecker({String? androidId, String? iOSId, String? iOSAppStoreCountry, String? forceAppVersion, String? androidPlayStoreCountry, String? iOSAppStoreId, String? minAppVersion})
Creates a checker configured with the given store identifiers/overrides — see each field's own doc comment above.

Properties

androidId String?
The app's package name on the Play Store. Falls back to the local package name if omitted.
final
androidPlayStoreCountry String?
The Play Store locale to query, e.g. 'en_US'.
final
forceAppVersion String?
Overrides the detected store version — useful for testing canUpdate logic without a real network call.
final
hashCode int
The hash code for this object.
no setterinherited
iOSAppStoreCountry String?
The App Store country/storefront to query, e.g. 'us'.
final
iOSAppStoreId String?
The app's numeric App Store ID (the "trackId"), used as a fallback lookup key if the iOSId-keyed (bundle ID) lookup returns no results — a real, reported failure mode when a bundle-ID lookup misses despite the app being live on the store. Ignored if not supplied.
final
iOSId String?
The app's bundle ID on the App Store. Falls back to the local package name if omitted.
final
minAppVersion String?
The minimum acceptable app version — see VersionStatus.urgency. Supply this from your own remote config or hardcode it; it is never read from the store.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getLocalVersion() Future<String>
Returns the cleaned local app version (e.g. 1.2.3), read from the native package info.
getVersionStatus() Future<VersionStatus?>
Queries the appropriate app store for this platform and returns a VersionStatus, or null if the platform isn't supported or the store couldn't be reached/parsed.
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