app_update_helper 1.0.4 copy "app_update_helper: ^1.0.4" to clipboard
app_update_helper: ^1.0.4 copied to clipboard

Simply check for updates, then based on the version (major, minor, patch) decide to update or not.

Getting Started #

Simply call the checkForUpdates function to check for updates and handle them accordingly.

final info = await AppUpdateHelper.checkForUpdates();
if (info == null) return; // No update available

Then you can use the update function to update the app. (Or ideally let your user choose)

// let's say you want to update only if major/minor
switch (info.updateType) {
  case UpdateType.major:
  case UpdateType.minor:
    AppUpdateHelper.update();
    break;
  case UpdateType.patch:
    debugPrint("Patch Update Available: ${info.newVersion}");
}

// if you only care about major updates
if (info.isMajorUpdate) AppUpdateHelper.update();

// if patch and multiple of 3 (who am I to judge?)
if (info.isPatchUpdate && info.newVersion.patch % 3 == 0) AppUpdateHelper.update();

For ios you must provide the iosAppId when calling the update function:

AppUpdateHelper.update(iosAppId: "YOUR_IOS_APP_ID");

you can find your iOS app id in the App Store URL of your app, for example: https://apps.apple.com/app/idYOUR_IOS_APP_ID.

1
likes
0
points
297
downloads

Publisher

verified publisherzealousfoundry.com

Weekly Downloads

Simply check for updates, then based on the version (major, minor, patch) decide to update or not.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, package_info_plus, plugin_platform_interface, url_launcher

More

Packages that depend on app_update_helper

Packages that implement app_update_helper