flutter_app_update 3.0.2 copy "flutter_app_update: ^3.0.2" to clipboard
flutter_app_update: ^3.0.2 copied to clipboard

A simple lightweight and customizable version update library for Flutter

一、使用说明 #

dependencies:
  flutter_app_update: ^latest_version
  • 创建UpdateModel设置下载地址
 UpdateModel model = UpdateModel(
   url,
   "flutterUpdate.apk",
   /// android res/mipmap 目录下的图片名称
   "ic_launcher",
   'https://itunes.apple.com/cn/app/抖音/id1142110895',
 );
 AzhonAppUpdate.update(model).then((value) => debugPrint('$value'));

关于UpdateModel各字段的释义详情请看代码注释

  • 监听下载过程
@override
void initState() {
  super.initState();
  AzhonAppUpdate.listener((map) {
    print(map['type']);
  });
}
监听类型(type) 扩展字段数据 数据类型 备注
onButtonClick id int 对话框按钮点击通知(0:确定,1:取消)
start / / 开始下载通知
downloading max int 下载中通知,下载总大小
progress int 当前下载进度
done apk String 下载完成通知,安装包路径
cancel / / 取消下载通知
error exception String 下载出错通知,错误信息

三、效果图 #

   

38
likes
0
pub points
88%
popularity

Publisher

unverified uploader

A simple lightweight and customizable version update library for Flutter

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_app_update