getUpdateAvailability function
Checks if there is an update available for the application.
If the iosAppStoreRegion
is set, the iOS version is checked in the specified region.
This method returns the Availability of the update.
Example:
void main() async {
final updateAvailability = await getUpdateAvailability();
text = switch (availability) {
UpdateAvailable() => "There's an update available!",
NoUpdateAvailable() => "There's no update available!",
UnknownAvailability() => "Sorry, couldn't determine if there is or not an available update!",
};
print(text);
}
Implementation
Future<Availability> getUpdateAvailability({String? iosAppStoreRegion}) {
return UpdateAvailablePlatform.instance.getUpdateAvailability(iosAppStoreRegion: iosAppStoreRegion);
}