update_helper 0.1.0-rc3 icon indicating copy to clipboard operation
update_helper: ^0.1.0-rc3 copied to clipboard

Help you easier to control the update dialog. It also supports the feature that forces the app to update to continue using.

Update Helper #

Help you easier to control the update dialog. It also supports the feature that forces the app to update to continue using.

Screenshots (Left/Above: don't force to update, Right/Below: force to update and users cannot close the dialog):

Usage #

Simple Way #

UpdateHelper.initial(
  context: context,
  updateConfig: UpdateConfig(
    defaultConfig: UpdatePlatformConfig(latestVersion: '3.0.0'),
  ),
  // forceUpdate: true, // Add this line if you want users to be forced to update
);

Advanced #

final latestVersion = '1.0.0';
final forceUpdate = false;
final bannedVersions = ['<=0.9.0']; // <-------
final currentVersion = '0.9.0';

await UpdateHelper.initial(
    context: context,
    updateConfig: UpdateConfig(
        defaultConfig: UpdatePlatformConfig(latestVersion: latestVersion),
        android: UpdatePlatformConfig(latestVersion: latestVersion)
    ),
    title: 'Cập Nhật',
    content: 'Đã có phiên bản cập nhật mới!\n\n'
        'Phiên bản hiện tại: %currentVersion\n'
        'Phiên bản mới: %latestVersion\n\n'
        'Bạn có muốn cập nhật không?',
    forceUpdate: forceUpdate,
    bannedVersions: bannedVersions, // <--------
    forceUpdateContent: 'Đã có phiên bản cập nhật mới!\n\n'
        'Phiên bản hiện tại: %currentVersion\n'
        'Phiên bản mới: %latestVersion\n\n'
        'Bạn cần cập nhật để tiếp tục sử dụng',
    changelogs: [
        'Bugs fix and improve performances',
        'New feature: Add update dialog',
    ],
    failToOpenStoreError: 'Got an error when trying to open the Store, '
        'please update the app manually. '
        '\nSorry for the inconvenience.\n(Logs: %error)',
);

NOTE:

  • The plugin will replace %currentVersion and %latestVersion with it's real version.
  • You can use only forceUpdate or bannedVersions because forceUpdate will be true if the current version is satisfied with bannedVersions.
  • You can read more about how to use bannedVersions on satisfied_version plugin.
  • Show an error log when the app can't open the store, you can modify it using the failToOpenStoreError parameter. The plugin will replace the %error with it's real error log.
0
likes
140
pub points
59%
popularity

Publisher

verified publisher iconpub.vursin.com

Help you easier to control the update dialog. It also supports the feature that forces the app to update to continue using.

Homepage

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, http, package_info_plus, satisfied_version, universal_platform, url_launcher

More

Packages that depend on update_helper