on_upgrade 0.0.3 copy "on_upgrade: ^0.0.3" to clipboard
on_upgrade: ^0.0.3 copied to clipboard

outdated

Local upgrade checker plugin. Provides the ability to compare the currently running app version against a saved one.

OnUpgrade #

Local upgrade checker plugin for Flutter. Enables the developer to easily migrate data between upgrades or to show users a new features dialog.

Features #

A simple upgrade checker to migrate data between app updates or to display a change log with new features to your users.

  • Contains a default implementation using the shared preferences of the platform to persist the last known version
  • Minimal effort to check if an app update is given and to updated the persisted values
  • Possibility to implement custom getters and setters for the persisted version interaction (e.g. if the last known app version is already available via a database)

Usage #

For full examples please see the example app.

Default implementation #

final onUpgrade = OnUpgrade();
final isNewVersion = await onUpgrade.isNewVersion();
if (isNewVersion.isUpdate == UpgradeState.upgrade) {
  await onUpgrade.updateLastVersion();
  myDataMigration();
  myShowUserNewFeaturesDialog();
}

Custom implementation #

Future<String> _customVersionGetter() async {
    // Your implementation
}

Future<bool> _customVersionSetter([String version]) async {
    // Your implementation
}

final onUpgradeCustom = OnUpgrade(customVersionUpdate: _customVersionSetter, customVersionLookup: _customVersionGetter);
final isNewVersion = await _onUpgradeCustom.isNewVersion();
if (isNewVersion.state == UpgradeState.upgrade) {
  await _onUpgradeCustom.updateLastVersion();
  myDataMigration();
  myShowUserNewFeaturesDialog();
}
10
likes
0
pub points
16%
popularity

Publisher

verified publisherboehrsi.de

Local upgrade checker plugin. Provides the ability to compare the currently running app version against a saved one.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, package_info_plus, pub_semver, shared_preferences

More

Packages that depend on on_upgrade