cancel method

  1. @override
Future<void> cancel(
  1. String id
)
override

Stops the download of id and deletes its part file; updates then reports it canceled.

Implementation

@override
Future<void> cancel(String id) async {
  calls.add('cancel $id');
  canceled.add(id);
  kept.remove(id);
  if (echoCancel) emit(ModelDownloadUpdate(id: id, state: ModelDownloadState.canceled));
}