UDownloadRequest class

Constructors

UDownloadRequest({String url = "", String? sourceId, List<String> mirrors = const <String>[], Map<String, String> headers = const <String, String>{}, String? fileName, String? title, String? mimeType, UDownloadDestination destination = const UDownloadDestination.downloads(), UDownloadPriority priority = UDownloadPriority.normal, int? connections, int speedLimit = 0, UChecksum? checksum, bool wifiOnly = false, DateTime? startAt, UDownloadConflict conflict = UDownloadConflict.rename, int maxRetries = 8, bool useSystemDownloader = false, bool openWhenDone = false, bool notifyWhenDone = false, bool visible = true, bool persistent = true, Duration? expireIn, String? tag, Map<String, String> metadata = const <String, String>{}})
const
UDownloadRequest.fromJson(Map<String, dynamic> json)
factory

Properties

checksum → UChecksum?
final
conflict → UDownloadConflict
final
connections → int?
Parallel connections (segments). Null uses UDownloadConfig.connections.
final
destination → UDownloadDestination
final
expireIn → Duration?
Expiry for storage destinations.
final
fileName → String?
Overrides the name from Content-Disposition or the URL.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, String>
final
maxRetries → int
final
metadata → Map<String, String>
final
mimeType → String?
final
mirrors → List<String>
Alternative URLs tried in order when the primary one fails for good.
final
notifyWhenDone → bool
final
openWhenDone → bool
final
persistent → bool
False keeps the task out of the saved queue, so it does not survive a restart.
final
priority → UDownloadPriority
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sourceId → String?
An opaque id (e.g. a file id on your server) that UDownloadManager.urlResolver turns into a URL on every attempt. The real URL is then never stored, shown or logged, and short-lived signed URLs are refreshed automatically.
final
speedLimit → int
Bytes per second for this task; 0 means unlimited.
final
startAt → DateTime?
final
tag → String?
final
title → String?
Shown in lists and notifications instead of the file name.
final
url → String
Where to download from. May be empty when sourceId is set.
final
useSystemDownloader → bool
Hand the transfer to the OS (Android DownloadManager, Apple background URLSession, Windows BITS) so it continues after the app is killed. Ignored for memory, vault and save-as destinations, and where the OS has no such service.
final
visible → bool
False hides the task from UDownloadManager.tasks — for silent, in-app downloads.
final
wifiOnly → bool
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

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