TaskProgressUpdate class

A progress update

A successfully downloaded task will always finish with progress 1.0

TaskStatus.failed results in progress -1.0 TaskStatus.canceled results in progress -2.0 TaskStatus.notFound results in progress -3.0 TaskStatus.waitingToRetry results in progress -4.0

expectedFileSize will only be representative if the 0 < progress < 1, so NOT representative when progress == 0 or progress == 1, and will be -1 if the file size is not provided by the server or otherwise not known. networkSpeed is valid if positive, expressed in MB/second timeRemaining is valid if positive

Use the hasExpectedFileSize, hasNetworkSpeed and hasTimeRemaining getters to determine whether a field is valid

Inheritance

Constructors

TaskProgressUpdate(Task task, double progress, [int expectedFileSize = -1, double networkSpeed = -1, Duration timeRemaining = const Duration(seconds: -1)])
const
TaskProgressUpdate.fromJson(Map<String, dynamic> json)
Create object from json
TaskProgressUpdate.fromJsonString(String jsonString)
Create object from jsonString
factory

Properties

expectedFileSize → int
final
hasExpectedFileSize → bool
If true, expectedFileSize contains a valid value
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasNetworkSpeed → bool
If true, networkSpeed contains a valid value
no setter
hasTimeRemaining → bool
If true, timeRemaining contains a valid value
no setter
networkSpeed → double
final
networkSpeedAsString → String
Use the hasExpectedFileSize, hasNetworkSpeed and hasTimeRemaining getters to determine whether a field is valid
no setter
progress → double
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
task → Task
finalinherited
timeRemaining → Duration
final
timeRemainingAsString → String
String is '--:--' if N/A, otherwise HH:MM:SS or MM:SS
no setter

Methods

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

Operators

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