remove static method

Future<void> remove({
  1. required String taskId,
  2. bool shouldDeleteContent = false,
})

Deletes a download task from the database. If the given task is running, it is also canceled. If the task is completed and shouldDeleteContent is true, the downloaded file will be deleted.

parameters:

  • taskId: unique identifier of a download task
  • shouldDeleteContent: if the task is completed, set true to let the plugin remove the downloaded file. The default value is false.

Implementation

static Future<void> remove({
  required String taskId,
  bool shouldDeleteContent = false,
}) async {
  assert(_initialized, 'plugin flutter_downloader is not initialized');

  try {
    return await _channel.invokeMethod('remove', {
      'task_id': taskId,
      'should_delete_content': shouldDeleteContent,
    });
  } on PlatformException catch (e) {
    _log(e.message);
  }
}