copyWith method

FileUploadModel copyWith({
  1. String? id,
  2. FileInfo? fileInfo,
  3. String? name,
  4. String? path,
  5. FileSource? source,
  6. UploadStatus? status,
  7. double? progress,
  8. int? fileSize,
  9. String? fileSizeInfo,
  10. String? url,
  11. DateTime? createTime,
  12. DateTime? updateTime,
})

复制并修改模型

Implementation

FileUploadModel copyWith({
  String? id,
  FileInfo? fileInfo,
  String? name,
  String? path,
  FileSource? source,
  UploadStatus? status,
  double? progress,
  int? fileSize,
  String? fileSizeInfo,
  String? url,
  DateTime? createTime,
  DateTime? updateTime,
}) {
  return FileUploadModel(
    id: id ?? this.id,
    fileInfo: fileInfo ?? this.fileInfo,
    name: name ?? this.name,
    path: path ?? this.path,
    source: source ?? this.source,
    status: status ?? this.status,
    progress: progress ?? this.progress,
    fileSize: fileSize ?? this.fileSize,
    fileSizeInfo: fileSizeInfo ?? this.fileSizeInfo,
    url: url ?? this.url,
    createTime: createTime ?? this.createTime,
    updateTime: updateTime ?? this.updateTime,
  );
}