这里写自定义目录标题
推荐 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;
}
这样就搞定了!!!