copyWith method

Attachment copyWith({
  1. String? id,
  2. int? timestamp,
  3. String? filename,
  4. AttachmentState? state,
  5. String? localUri,
  6. String? mediaType,
  7. int? size,
  8. bool? hasSynced,
  9. String? metaData,
})

Returns a copy of this attachment with the given fields replaced.

Implementation

Attachment copyWith({
  String? id,
  int? timestamp,
  String? filename,
  AttachmentState? state,
  String? localUri,
  String? mediaType,
  int? size,
  bool? hasSynced,
  String? metaData,
}) {
  return Attachment(
    id: id ?? this.id,
    timestamp: timestamp ?? this.timestamp,
    filename: filename ?? this.filename,
    state: state ?? this.state,
    localUri: localUri ?? this.localUri,
    mediaType: mediaType ?? this.mediaType,
    size: size ?? this.size,
    hasSynced: hasSynced ?? this.hasSynced,
    metaData: metaData ?? this.metaData,
  );
}