12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import 'package:dio/dio.dart';
- import 'package:fis_jsonrpc/rpc.dart';
- import 'package:flutter/foundation.dart';
- import 'package:vitalapp/managers/interfaces/base.dart';
- import 'models/upgrade.dart';
- /// 应用升级管理器
- abstract class IUpgradeManager implements IManager {
- /// 获取当前版本号
- Future<String> getCurrentVersion();
- /// 检查是否存在新版本
- ///
- /// - 结果为 `null` 时:无更新
- ///
- /// - 结果不为 `null` 时:根据返回实体更新
- Future<UpgradeCheckResultModel?> checkNewVersionArrival();
- /// 下载安装包
- ///
- /// [version] 版本号
- ///
- /// [url] 文件链接
- ///
- /// [onProgress] 下载进度回调,0~1.0
- ///
- /// [cancelToken] 取消下载标识
- Future<bool> downloadPackage(
- String version,
- String url, {
- ValueChanged<double>? onProgress,
- CancelToken? cancelToken,
- });
- /// 安装版本
- ///
- /// [version] 版本号
- Future<void> install(String version);
- ///删除安装包文件
- Future<void> deleteFile(String version);
- Future<VitalResourceInfoDTO?> getResourceInfoByVersionAsync(
- String version, String resourceKey);
- }
|