ParallelDownloadTask class
final
Constructors
ParallelDownloadTask ({String ? taskId , required dynamic url , Map <String , String > ? urlQueryParameters , String ? filename , String ? httpRequestMethod , int chunks = 1 , String directory = '' , BaseDirectory baseDirectory = BaseDirectory.applicationDocuments , String group = 'default' , Updates updates = Updates.status , bool requiresWiFi = false , int retries = 0 , bool allowPause = false , int priority = 5 , String metaData = '' , String displayName = '' , DateTime ? creationTime })
Creates a ParallelDownloadTask
ParallelDownloadTask.fromJson (Map <String , dynamic > json )
Creates ParallelDownloadTask object from json
Properties
allowPause
→ bool
If true, task will pause if the task fails partly through the execution,
when some but not all bytes have transferred, provided the server supports
partial transfers. Such failures are typically temporary, eg due to
connectivity issues, and may be resumed when connectivity returns.
If false, task fails on any issue, and task cannot be paused
final inherited
baseDirectory
→ BaseDirectory
Base directory
final inherited
chunks
→ int
Number of chunks per URL
final
creationTime
→ DateTime
Time at which this request was first created
final inherited
directory
→ String
Optional directory, relative to the base directory
final inherited
displayName
→ String
Human readable name for this task - use {displayName} in notification
final inherited
filename
→ String
Filename of the file to store - use {filename} in notification
final inherited
group
→ String
Group that this task belongs to
final inherited
hasFilename
→ bool
True if this task has a filename, or false if set to suggest
no setter inherited
hashCode
→ int
The hash code for this object.
no setter inherited
potential additional headers to send with the request
final inherited
hostName
→ String
Hostname represented by the url. Throws FormatException if url cannot
be parsed, and returns empty string if no host in url
no setter inherited
httpRequestMethod
→ String
HTTP request method to use
final inherited
metaData
→ String
User-defined metadata - use {metaData} in notification
final inherited
post
→ String ?
Set post to make the request using POST instead of GET.
In the constructor, post must be one of the following:
final inherited
priority
→ int
Priority of this task, relative to other tasks.
Range 0 <= priority <= 10 with 0 being the highest priority.
Not all platforms will have the same actual granularity, and how
priority is considered is inconsistent across platforms.
final inherited
providesProgressUpdates
→ bool
If true, task expects progress updates
no setter inherited
providesStatusUpdates
→ bool
If true, task expects status updates
no setter inherited
requiresWiFi
→ bool
If true, will not download over cellular (metered) network
final inherited
retries
→ int
Maximum number of retries the downloader should attempt
final inherited
retriesRemaining
↔ int
Number of retries remaining
getter/setter pair inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
taskId
→ String
Identifier for the task - auto generated if omitted
final inherited
taskType
→ String
Returns the type of task as a String
no setter override
updates
→ Updates
Type of progress updates desired
final inherited
url
→ String
String representation of the url, urlEncoded
final inherited
urls
→ List <String >
List of URLs to download the file from
final
validHttpMethods
→ List <String >
final inherited
Methods
compareTo (dynamic other )
→ int
Returns this.priority - other.priority if not the same
Returns this.creationTime - other.creationTime if priorities the same
Returns 0 if other is not a Task
inherited
copyWith ({String ? taskId , String ? url , String ? filename , String ? httpRequestMethod , Object ? post , String ? directory , BaseDirectory ? baseDirectory , String ? group , Updates ? updates , bool ? requiresWiFi , int ? retries , int ? retriesRemaining , bool ? allowPause , int ? priority , String ? metaData , String ? displayName , DateTime ? creationTime })
→ ParallelDownloadTask
Returns a copy of the Task with optional changes to specific fields
override
decreaseRetriesRemaining ()
→ void
Decrease retriesRemaining by one
inherited
expectedFileSize ()
→ Future <int >
Return the expected file size for this task, or -1 if unknown
inherited
filePath ({String ? withFilename })
→ Future <String >
Returns the absolute path to the file represented by this task
based on the Task.filename
(default) or withFilename
inherited
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson ()
→ Map <String , dynamic >
Creates JSON map of this object
override
toString ()
→ String
A string representation of this object.
inherited
withSuggestedFilename ({dynamic unique = false , Future <DownloadTask > taskWithFilenameBuilder (DownloadTask task , bool unique ) = taskWithSuggestedFilename })
→ Future <DownloadTask >
Returns a copy of the task with the Task.filename
property changed
to the filename suggested by the server, or derived from the url, or
unchanged.
inherited
background_downloader 8.4.3