Provide version check and upgrade functionality for Flutter on HarmonyOS.
提供 Flutter HarmonyOS 平台上的版本检查和升级功能
dependencies:
update_manager_ohos: ^0.0.1
final hasUpdate = await UpdateManagerOhos.instance.checkUpdate();
debugPrint('hasUpdate: $hasUpdate');
/// 如果有可用的更新,弹出升级弹窗
if (hasUpdate) {
final didShowDialog = await UpdateManagerOhos.instance.showUpdateDialog();
debugPrint('didShowDialog: $didShowDialog');
}
More information can be found in the official updateManager
详情请参考官方 API 文档: updateManager