copyWith method

DownloadTaskModel copyWith({
  1. DownloadTaskStatus? status,
  2. int? downloadedBytes,
  3. int? totalBytes,
  4. 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,
  );
}