cancel method

Future<void> cancel()

Cancel any current download, even if the download is pause

Implementation

Future<void> cancel() async {
  _isActive();
  await _inner.cancel();
  await _options.progress.resetProgress(_url);
  if (_options.deleteOnCancel) {
    await _options.file.delete();
  }
  isCancelled = true;
  isDownloading = false;
}