update_helper 0.1.0-rc1 copy "update_helper: ^0.1.0-rc1" to clipboard
update_helper: ^0.1.0-rc1 copied to clipboard

outdated

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: don't force to update, right: force to update and users cannot close the dialog):

[images/noforce.png?raw=true] [images/force.png?raw=true]

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',
    ],
);

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.
7
likes
0
points
118
downloads

Publisher

verified publisherlamnhan.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, package_info_plus, satisfied_version, universal_platform, url_launcher

More

Packages that depend on update_helper