添加修复大包更新安装覆盖的-待测试
添加修复了更新接口的令狐适配 添加了新的服务端地址-
This commit is contained in:
55
lib/core/update/update_state.dart
Normal file
55
lib/core/update/update_state.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'version_check_service.dart';
|
||||
|
||||
/// 更新状态基类
|
||||
abstract class UpdateState {
|
||||
const UpdateState();
|
||||
}
|
||||
|
||||
/// 初始状态
|
||||
class UpdateInitial extends UpdateState {
|
||||
const UpdateInitial();
|
||||
}
|
||||
|
||||
/// 检查中
|
||||
class UpdateChecking extends UpdateState {
|
||||
const UpdateChecking();
|
||||
}
|
||||
|
||||
/// 发现新版本
|
||||
class UpdateAvailable extends UpdateState {
|
||||
final AppVersionInfo versionInfo;
|
||||
|
||||
const UpdateAvailable(this.versionInfo);
|
||||
}
|
||||
|
||||
/// 下载中
|
||||
class UpdateDownloading extends UpdateState {
|
||||
final double progress;
|
||||
final bool isPatch; // true=差量补丁, false=完整APK
|
||||
|
||||
const UpdateDownloading(this.progress, {required this.isPatch});
|
||||
}
|
||||
|
||||
/// 安装中
|
||||
class UpdateInstalling extends UpdateState {
|
||||
final bool isPatch;
|
||||
|
||||
const UpdateInstalling({required this.isPatch});
|
||||
}
|
||||
|
||||
/// 更新成功
|
||||
class UpdateSuccess extends UpdateState {
|
||||
const UpdateSuccess();
|
||||
}
|
||||
|
||||
/// 已是最新版本
|
||||
class UpdateUpToDate extends UpdateState {
|
||||
const UpdateUpToDate();
|
||||
}
|
||||
|
||||
/// 更新失败
|
||||
class UpdateFailure extends UpdateState {
|
||||
final String error;
|
||||
|
||||
const UpdateFailure(this.error);
|
||||
}
|
||||
Reference in New Issue
Block a user