cancel method

void cancel()

Cancels the file downloading.

Implementation

void cancel() {
  status.value = DownloadStatus.notStarted;
  if (_completer?.isCompleted == false) {
    _completer?.complete(null);
  }
  _completer = null;
  _token.cancel();
  _token = CancelToken();
}