toJson method
Returns JSON map representation of this TaskRecord
Note the status, progress and exception fields are merged into the JSON map representation of the task
Implementation
Map<String, dynamic> toJson() {
final json = task.toJson();
json['status'] = status.index;
json['progress'] = progress;
json['expectedFileSize'] = expectedFileSize;
json['exception'] = exception?.toJson();
return json;
}