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

check(BuildContext context, {required String url, UpdateAvailableCallback? onUpdateAvailable, bool shouldUpdate(VersionInfo newVersion, PackageInfo currentPackage)?, Map<String, dynamic>? params}) Future<void>
检查更新
getPlatformVersion() Future<String?>
install() Future<void>
安装APK(仅 Android)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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}) → void
初始化配置,应在 App 启动时调用一次。