remove static method
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 taskshouldDeleteContent
: if the task is completed, settrue
to let the plugin remove the downloaded file. The default value isfalse
.
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);
}
}