reset method
void
reset()
重置所有状态(用于需要重新开始的场景)
Implementation
void reset() {
_ensureAndroid();
_ensureInitialized();
_emit(UpgraderEventType.log, '重置所有状态');
_activeDownloadSession = null;
_sessionSequence++;
unawaited(
TinyUpgraderPlatform.instance.cancelForegroundDownload().catchError((
Object error,
) {
if (_isDebugging) {
debugPrint('[TinyUpgrader] cancel foreground download: $error');
}
}),
);
_updateInfo = null;
_savePath = null;
_presentedVersionKey = null;
statusNotifier.value = DownloadStatus.none;
progressNotifier.value = 0.0;
}