pauseDownload method

void pauseDownload()

暂停下载

Implementation

void pauseDownload() {
  _ensureAndroid();
  _ensureInitialized();
  if (statusNotifier.value == DownloadStatus.downloading) {
    _emit(UpgraderEventType.log, '用户请求暂停下载');
    statusNotifier.value = DownloadStatus.paused;
    unawaited(
      TinyUpgraderPlatform.instance.pauseForegroundDownload().catchError((
        Object error,
      ) {
        if (_isDebugging) {
          debugPrint('[TinyUpgrader] pause foreground download: $error');
        }
      }),
    );
  }
}