// import 'dart:async';
// import 'dart:ui';
//
//
// import 'package:flutter_update_dialog/flutter_update_dialog.dart';
//
// import '../../utils/toast/cloud_toast.dart';
//
// UpdateDialog? dialog;
//
// double progress = 0.0;
//
// void onUpdate() {
//   CloudToast.show('开始升级...');
//   Timer.periodic(const Duration(milliseconds: 50), (Timer timer) {
//     progress = progress + 0.02;
//     if (progress > 1.0001) {
//       timer.cancel();
//       dialog!.dismiss();
//       progress = 0;
//       CloudToast.show('升级成功!');
//     } else {
//       dialog!.update(progress);
//     }
//   });
// }
//
// void defaultStyle() {
//   if (dialog != null && dialog!.isShowing()) {
//     return;
//   }
//   dialog = UpdateDialog.showUpdate(context,
//       title: '是否升级到4.1.4版本?',
//       updateContent: '新版本大小:2.0M\n1.xxxxxxx\n2.xxxxxxx\n3.xxxxxxx',
//       onUpdate: onUpdate);
// }
//
// void customStyle() {
//   if (dialog != null && dialog!.isShowing()) {
//     return;
//   }
//   dialog = UpdateDialog.showUpdate(context,
//       width: 250,
//       title: '是否升级到4.1.4版本?',
//       updateContent: '新版本大小:2.0M\n1.xxxxxxx\n2.xxxxxxx\n3.xxxxxxx',
//       titleTextSize: 14,
//       contentTextSize: 12,
//       buttonTextSize: 12,
//       topImage: Image.asset('assets/bg_update_top.png'),
//       extraHeight: 5,
//       radius: 8,
//       themeColor: const Color(0xFFFFAC5D),
//       progressBackgroundColor: const Color(0x5AFFAC5D),
//       isForce: true,
//       updateButtonText: '升级',
//       ignoreButtonText: '忽略此版本',
//       enableIgnore: true, onIgnore: () {
//         CloudToast.show('忽略');
//         dialog!.dismiss();
//       }, onUpdate: onUpdate);
// }
// }