flutter安卓项目应用内升级版本(下载链接升级版本)

文章介绍了如何在Flutter项目中使用r_upgrade插件进行应用升级。首先在pubspec.yaml文件中引入插件,然后在需要升级的页面导入并配置相关参数,如安装类型、通知可见性和样式,通过调用RUpgrade.upgrade方法启动升级过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这里写自定义目录标题

推荐 r_upgrade 插件

1、首先在 pubspec.yaml 引入插件:

dependencies:
	r_upgrade: ^0.4.2

在需要升级的页面:

import 'package:r_upgrade/r_upgrade.dart';

2、这个插件有很多的升级方式,这次我用的是下载链接方法

  RUpgradeInstallType installType = RUpgradeInstallType.normal;
  NotificationVisibility notificationVisibility =
      NotificationVisibility.VISIBILITY_VISIBLE;
  NotificationStyle notificationStyle = NotificationStyle.planTime;

  Future<int?> _upgrade() async {
    var id = await RUpgrade.upgrade(_lastestAPKInfo.url,
        installType: installType,
        notificationStyle: notificationStyle,
        notificationVisibility: notificationVisibility,
        useDownloadManager: false);
    return id;
  }

这样就搞定了!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值