resume method

  1. @override
Future<void> resume(
  1. String taskId
)
override

Resumes a previously interrupted download

Throws:

  • UnsupportedError if task cannot be resumed
  • NetworkException for network errors

Implementation

@override
Future<void> resume(String taskId) async {
  final task = _activeTasks[taskId];
  if (task == null) {
    throw UnsupportedError('Task not found: $taskId');
  }

  final canResumeTask = await canResume(taskId);
  if (!canResumeTask) {
    throw UnsupportedError('Task cannot be resumed: $taskId');
  }

  await _downloader.resume(task);
}