TinyUpgrader class

Flutter 应用内更新核心类(单例模式)

Constructors

TinyUpgrader()
factory

Properties

enableLog ↔ bool
获取当前是否启用日志回调。
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
onEvent → UpgraderCallback?
获取当前设置的事件回调(可能为 null)。
no setter
progressNotifier → ValueNotifier<double>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statusNotifier → ValueNotifier<DownloadStatus>
final

Methods

canRequestPackageInstalls() → Future<bool>
check(BuildContext context, {required String url, UpdateAvailableCallback? onUpdateAvailable, bool shouldUpdate(VersionInfo newVersion, PackageInfo currentPackage)?, Map<String, dynamic>? params}) → Future<UpdateCheckResult>
检查更新
getPlatformVersion() → Future<String?>
install() → Future<InstallResult>
安装APK(仅 Android)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openInstallPermissionSettings() → Future<void>
pauseDownload() → void
暂停下载
reset() → void
重置所有状态(用于需要重新开始的场景)
startDownload() → Future<void>
开始或恢复下载
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → TinyUpgrader
no setter

Static Methods

init({bool isDebug = false, String? baseUrl, Dio? dio, UpdateApiParser? parser, ErrorHandler? errorHandler, UpdateDialogBuilder? dialogBuilder, ForcedUpdatePageBuilder? forcedUpdatePageBuilder, OssConfig? ossConfig, UpgraderCallback? onEvent, bool enableLog = false, int maxRetryCount = 3, int? maxValidationRetryCount, int maxNetworkRetryCount = 2, int minFreeSpaceMarginBytes = 64 * 1024 * 1024, bool autoStartForcedDownload = false, bool barrierDismissible = true}) → void
初始化配置,应在 App 启动时调用一次。