azhon / flutter_app_update

一个Flutter版本简单、轻量、可随意定制的Android版本更新库;A simple, lightweight, and customizable Android version update library for Flutter
Apache License 2.0
36 stars 13 forks source link

Chinese Doc

一、Introduce

 UpdateModel model = UpdateModel(
   url,
   "flutterUpdate.apk",
   /// android res/mipmap icon name
   "ic_launcher",
   'https://itunes.apple.com/cn/app/xxxx',
 );
 AzhonAppUpdate.update(model).then((value) => debugPrint('$value'));
@override
void initState() {
  super.initState();
  AzhonAppUpdate.listener((map) {
    debugPrint('app update listener: ${jsonEncode(map)}');
  });
}
Type Keys Type of data Remark
onButtonClick id int Update dialog button click event(0:confirm,1:cancel)
start / / Start download
downloading max int Downloading, apk file size
progress int Current progress
done apk String Downloaded, apk path
cancel / / Cancel download
error exception String Download error

三、Screenshot