install method
调用平台接口安装APK (仅限Android)
Implementation
Future<void> install() async {
if (!Platform.isAndroid) assert(false, 'Only Android is supported');
if (statusNotifier.value != DownloadStatus.finished || _savePath == null) {
_log('错误: 文件未下载完成,无法安装。');
return;
}
_log('准备安装APK: $_savePath');
try {
await TinyUpgraderPlatform.instance.installApk(_savePath!);
} catch (e) {
_log('安装失败: $e');
_errorHandler?.call(e);
}
}