UDownloadManager class
The download engine behind UDownloads; use UDownloads instead.
- Inheritance
-
- Object
- ChangeNotifier
- UDownloadManager
Properties
-
active
→ List<
UDownloadTask> -
no setter
-
allTasks
→ List<
UDownloadTask> -
Every task, including silent ones.
no setter
- config ↔ UDownloadConfig
-
getter/setter pair
-
events
→ Stream<
UDownloadTask> -
Emits a task whenever its status changes.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
headersProvider
↔ Future<
Map< Function(UDownloadTask task)?String, String> > -
Extra headers per attempt — e.g. a fresh bearer token. Called again after a 401/403.
getter/setter pair
- maxConcurrent ← int
-
no getter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speedLimit ← int
-
no getter
-
tasks
→ List<
UDownloadTask> -
Visible tasks, newest first.
no setter
- totalSpeed → double
-
Sum of the speeds of every running task, in bytes per second.
no setter
-
urlResolver
↔ Future<
String> Function(UDownloadTask task)? -
Turns UDownloadRequest.sourceId into a URL, per attempt. Lets you download by id from an
authenticated endpoint or a short-lived signed URL without the URL ever being persisted.
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
cancel(
String id) → Future< void> -
clearCompleted(
) → Future< void> - Name kept from the media download manager.
-
clearFinished(
) → Future< void> -
dispose(
) → void -
Discards any resources used by the object.
override
-
download(
String url, {UDownloadDestination destination = const UDownloadDestination.downloads(), String? fileName, Map< String, String> headers = const <String, String>{}, bool wifiOnly = false, int? connections, UChecksum? checksum}) → Future<UDownloadTask> -
Convenience for the common case: download
urltodestinationwith default settings. -
enqueue(
UDownloadRequest request) → Future< UDownloadTask> -
fetchBytes(
String url, {Map< String, String> headers = const <String, String>{}, void onProgress(double progress)?, int connections = 1}) → Future<Uint8List> - Silent download into memory. Not listed, not persisted, not resumable across restarts.
-
fetchToStorage(
String url, String key, {UStorageBucket bucket = UStorageBucket.support, Map< String, String> headers = const <String, String>{}, void onProgress(double progress)?, UChecksum? checksum, Duration? expireIn, bool persistent = true}) → Future<String> - Silent download into UFileStorage. Returns the key once the file is stored.
-
init(
{UDownloadConfig? config}) → Future< void> -
load(
) → Future< void> - Name kept from the media download manager.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
open(
UDownloadTask task) → Future< bool> -
pause(
String id) → Future< void> -
pauseAll(
) → Future< void> -
remove(
String id, {bool deleteFile = false}) → Future< void> -
Removes a task from the list; with
deleteFilealso deletes what it downloaded. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resume(
String id) → Future< void> -
resumeAll(
) → Future< void> -
retry(
String id) → Future< void> - Starts a finished or failed task over from byte zero.
-
reveal(
UDownloadTask task) → Future< bool> -
task(
String id) → UDownloadTask? -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → UDownloadManager
-
final