DownloadService class abstract interface

Abstraction for downloading files from network Different implementations for different strategies

Platform implementations:

  • BackgroundDownloaderService: uses background_downloader package
  • SimpleDownloadService: uses http package
  • MockDownloadService: for testing
Implementers

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

cancel(String taskId) Future<void>
Cancels an active download
canResume(String taskId) Future<bool>
Checks if a download task can be resumed
download(String url, String targetPath, {String? token}) Future<void>
Downloads a file from URL to target path
downloadWithProgress(String url, String targetPath, {String? token, int maxRetries = 10}) Stream<int>
Downloads a file with progress tracking
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resume(String taskId) Future<void>
Resumes a previously interrupted download
toString() String
A string representation of this object.
inherited

Operators

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