retry static method

Future<String?> retry(
  1. {required String taskId,
  2. bool requiresStorageNotLow = true,
  3. int timeout = 15000}
)

Retries a failed download task.

parameters:

  • taskId: unique identifier of a failed download task
  • timeout: http request connection timeout. Android only.

return:

An unique identifier of a new download task that is created to start the failed download progress from the beginning

Implementation

static Future<String?> retry({
  required String taskId,
  bool requiresStorageNotLow = true,
  int timeout = 15000,
}) async {
  assert(_initialized, 'plugin flutter_downloader is not initialized');

  try {
    return await _channel.invokeMethod('retry', {
      'task_id': taskId,
      'requires_storage_not_low': requiresStorageNotLow,
      'timeout': timeout,
    });
  } on PlatformException catch (e) {
    _log(e.message);
    return null;
  }
}