copyWith method

AppFile copyWith({
  1. String? fileKey,
  2. String? fileName,
  3. String? filePath,
  4. Uint8List? fileBytes,
  5. String? fileUrl,
  6. String? fileExtension,
  7. String? fileType,
  8. int? size,
  9. XFile? xFile,
  10. bool clearBytes = false,
})

Implementation

AppFile copyWith({
  String? fileKey,
  String? fileName,
  String? filePath,
  Uint8List? fileBytes,
  String? fileUrl,
  String? fileExtension,
  String? fileType,
  int? size,
  XFile? xFile,
  bool clearBytes = false,
}) {
  return AppFile(
    fileKey: fileKey ?? this.fileKey,
    fileName: fileName ?? this.fileName,
    filePath: filePath ?? this.filePath,
    fileBytes: clearBytes ? null : fileBytes ?? this.fileBytes,
    fileUrl: fileUrl ?? this.fileUrl,
    fileExtension: fileExtension ?? this.fileExtension,
    fileType: fileType ?? this.fileType,
    size: size ?? this.size,
    xFile: xFile ?? this.xFile,
  );
}