BackgroundDownloaderService class

Download service implementation using SmartDownloader

This is a thin wrapper around SmartDownloader to implement the DownloadService interface. All downloads benefit from SmartDownloader's HTTP-aware retry logic.

Features (provided by SmartDownloader):

  • HTTP-aware retry (401/403/404 fail after 1 attempt, others retry up to maxRetries)
  • Background downloads with resume capability
  • Progress tracking via streams
  • Network interruption recovery
  • Authentication token support
  • Cancellation support via CancelToken
  • Works with ANY URL (HuggingFace, Google Drive, custom servers, etc.)
Implemented types

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

download(String url, String targetPath, {String? token, CancelToken? cancelToken}) Future<void>
Downloads a file from URL to target path
override
downloadWithProgress(String url, String targetPath, {String? token, int maxRetries = 10, CancelToken? cancelToken}) Stream<int>
Downloads a file with progress tracking
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited