cancel method

void cancel(
  1. DownloadItem item
)

Implementation

void cancel(DownloadItem item) async {
  await service.cancel(item);
  item.status = DownloadStatus.readyToDownload;
  locallyQueuedIds.remove(item.id);
  locallyDownloadingIds.remove(item.id);
  running = (running - 1).clamp(0, maxParallel);
  _processQueue();
  _managePollingTimer();
  downloads.refresh();
}