UDownloadTask class
A download: status, progress, speed, ETA, bytes, file path.
- Inheritance
-
- Object
- ChangeNotifier
- UDownloadTask
Constructors
- UDownloadTask({required String id, required UDownloadRequest request, DateTime? createdAt, UDownloadStatus status = UDownloadStatus.queued})
-
UDownloadTask.fromJson(Map<
String, dynamic> json) -
Reads it from JSON.
factory
Properties
- acceptsRanges ↔ bool
-
True when the server supports resume.
getter/setter pair
- attempts ↔ int
-
Tries so far.
getter/setter pair
- bytes ↔ Uint8List?
-
The downloaded bytes for UDownloadDestination.memory.
getter/setter pair
- canPause → bool
-
True when pause is possible.
no setter
- canResume → bool
-
True when resume is possible.
no setter
- category → UDownloadCategory
-
Video, audio, document…
no setter
- completedAt ↔ DateTime?
-
When it finished.
getter/setter pair
- createdAt → DateTime
-
When it was added.
final
- displayName → String
-
Name to show in lists.
no setter
-
done
→ Future<
UDownloadTask> -
Completes once the task reaches completed, failed or canceled.
no setter
- durable ↔ int Function(int position)?
-
Maps an in-memory offset to the offset that is safely on disk (vault chunks are only
durable once sealed). Set by the engine while the task runs.
getter/setter pair
- error ↔ UDownloadError?
-
Last error.
getter/setter pair
- eta → Duration?
-
Estimated time left.
no setter
- etag ↔ String?
-
Server ETag (for safe resume).
getter/setter pair
- fileName ↔ String?
-
Final file name.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- id → String
-
Download id.
final
- isActive → bool
-
Queued or running.
no setter
- isFinished → bool
-
Completed, failed or canceled.
no setter
- isResumable → bool
-
Resuming continues from the saved offset instead of starting over.
no setter
- lastModified ↔ String?
-
Server Last-Modified (for safe resume).
getter/setter pair
- mimeType ↔ String?
-
MIME type.
getter/setter pair
- mirrorIndex ↔ int
-
Which mirror URL is in use.
getter/setter pair
- partPath ↔ String?
-
Temp file while downloading.
getter/setter pair
- progress → double
-
Progress 0-1 (null when size is unknown).
no setter
- received ↔ int
-
Bytes downloaded.
getter/setter pair
- request → UDownloadRequest
-
What was requested.
final
- result ↔ String?
-
The finished file: a path, a content URI, a storage key, or a browser file name.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
segments
→ List<
UDownloadSegment> -
Parts downloaded in parallel.
final
- speed ↔ double
-
Bytes per second, smoothed.
getter/setter pair
- state → UDownloadStatus
-
Kept for code written against the media download manager.
no setter
- status ↔ UDownloadStatus
-
Current status.
getter/setter pair
- system ↔ bool
-
True while the OS (not this process) owns the transfer.
getter/setter pair
- total ↔ int
-
Total bytes, or -1 while unknown.
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
changed(
) → void - Internal: marks the task as changed.
-
complete(
) → void - Internal: marks the task as completed.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toJson(
) → Map< String, dynamic> - As JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited