Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 875 Bytes

README.md

File metadata and controls

26 lines (23 loc) · 875 Bytes

pgyer_updater

package

flutter蒲公英应用更新插件,使用api实现,理论上无平台限制,仅弹窗提醒,下载安装可拿到versionResult自行实现

Example

import 'package:package_info_plus/package_info_plus.dart';

final packageInfo = await PackageInfo.fromPlatform();
final projectVersionName = packageInfo.version;
PgyerUpdater.check(apiKey: "apiKey", appKey: "appKey", versionName: projectVersionName).then((result) {
  if (mounted) {
    PgyerUpdater.showUpdateDialog(
      context,
      versionResult: result,
      onConfirm: (appUrl) {
        //launchUrlString(appUrl);
        // 或者自行实现下载
        //final downloadUrl = PgyerUpdater.getDownloadUrl(result);
        //download(downloadUrl);
      },
    );
  }
});