copyWith method
DownloadTaskModel
copyWith({
- DownloadTaskStatus? status,
- int? downloadedBytes,
- int? totalBytes,
- int? retries,
Implementation
DownloadTaskModel copyWith({
DownloadTaskStatus? status,
int? downloadedBytes,
int? totalBytes,
int? retries,
}) {
return DownloadTaskModel(
id: id,
url: url,
fileName: fileName,
filePath: filePath,
tempPath: tempPath,
status: status ?? this.status,
downloadedBytes: downloadedBytes ?? this.downloadedBytes,
totalBytes: totalBytes ?? this.totalBytes,
retries: retries ?? this.retries,
updatedAtMillis: DateTime.now().millisecondsSinceEpoch,
);
}