参数添加

This commit is contained in:
DESKTOP-I3JPKHK\wy 2025-11-25 15:20:07 +08:00
parent 353bb8abb0
commit dcc03e9070
1 changed files with 52 additions and 0 deletions

View File

@ -198,6 +198,58 @@ class AppUpgradeSimple {
}
///
///
///
/// - [context] () BuildContext MaterialApp
/// - [future] () [AppUpgradeVersion] null
/// - null
/// - [AppUpgradeVersion]
/// - [showNoUpdateToast] () "已是最新版本"
/// - true:
/// - false:
/// - null: 使 [config] [UpgradeConfig.showNoUpdateToast]
/// - [autoDownload] () APK
/// - true:
/// - false: "立即更新"
/// - null: 使 [config] [UpgradeConfig.autoDownload]
/// - [autoInstall] () APK
/// - true:
/// - false:
/// - null: 使 [config] [UpgradeConfig.autoInstall]
/// - [autoDownload] true
/// - [onComplete] ()
/// -
/// -
/// -
/// -
/// - [config] () [UpgradeConfig]
/// -
/// - null使 [UpgradeConfig]
/// -
///
/// 使
/// ```dart
/// await AppUpgradeSimple.instance.checkUpdate(
/// context: context,
/// future: () async {
/// // API获取版本信息
/// final response = await http.get('https://api.example.com/version');
/// return AppUpgradeVersion.fromJson(json.decode(response.body));
/// },
/// showNoUpdateToast: true,
/// autoDownload: false,
/// autoInstall: false,
/// onComplete: () {
/// print('检查更新完成');
/// },
/// );
/// ```
///
///
/// 1. [showNoUpdateToast], [autoDownload], [autoInstall]
/// 2. [config]
/// 3. [configure]
/// 4.
Future<void> checkUpdate({
required BuildContext context,
required Future<AppUpgradeVersion?> Function() future,