DownloadTask class

Main class, used as a singletone for initialising the downloads

Properties

client → Client
final
deleteOnCancel bool
final
deleteOnError bool
final
event TaskEvent?
Latest event
no setter
events Stream<TaskEvent>
Events stream, used to listen for downloading state changes
no setter
file File
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeRange bool
final
size int?
final
url Uri
final

Methods

cancel() Future<bool>
Cancel the downloading, if deleteOnCancel is true then file will be deleted will return false if downloading was already finished or cancelled
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() Future<bool>
Pause file downloading, file will be stored on defined location downloading may be continued from the paused point if file exists
resume() Future<bool>
Resume file downloading, if file exists downloading will continue from file size will return false if downloading is in progress, finished or cancelled
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

download(Uri url, {Map<String, String> headers = const {}, Client? client, required File file, bool deleteOnCancel = true, bool deleteOnError = false, int? size, bool safeRange = false}) Future<DownloadTask>
Static method to fire file downloading returns future of DownloadTask which may be used to control the request