cancel static method

Future<void> cancel({
  1. required String taskId,
})

Cancels download task with id taskId.

Implementation

static Future<void> cancel({required String taskId}) async {
  assert(_initialized, 'plugin flutter_downloader is not initialized');

  try {
    await _channel.invokeMethod<void>('cancel', {'task_id': taskId});
  } on PlatformException catch (err) {
    _log(err.message);
  }
}