copyWith method

MediaItem copyWith(
  1. {int? id,
  2. String? mediaIdentifier,
  3. String? title,
  4. String? mediaSourceIdentifier,
  5. String? mediaTypeIdentifier,
  6. String? base64Image,
  7. String? imageUrl,
  8. String? audioUrl,
  9. String? author,
  10. String? sourceMetadata,
  11. int? position,
  12. int? duration,
  13. bool? canDelete,
  14. bool? canEdit}
)

Creates a deep copy of this mapping but with the given variables replaced with the new values.

Implementation

MediaItem copyWith({
  int? id,
  String? mediaIdentifier,
  String? title,
  String? mediaSourceIdentifier,
  String? mediaTypeIdentifier,
  String? base64Image,
  String? imageUrl,
  String? audioUrl,
  String? author,
  String? sourceMetadata,
  int? position,
  int? duration,
  bool? canDelete,
  bool? canEdit,
}) {
  return MediaItem(
    id: id ?? this.id,
    mediaIdentifier: mediaIdentifier ?? this.mediaIdentifier,
    title: title ?? this.title,
    mediaSourceIdentifier:
        mediaSourceIdentifier ?? this.mediaSourceIdentifier,
    mediaTypeIdentifier: mediaTypeIdentifier ?? this.mediaTypeIdentifier,
    base64Image: base64Image ?? this.base64Image,
    imageUrl: imageUrl ?? this.imageUrl,
    audioUrl: audioUrl ?? this.audioUrl,
    author: author ?? this.author,
    sourceMetadata: sourceMetadata ?? this.sourceMetadata,
    position: position ?? this.position,
    duration: duration ?? this.duration,
    canDelete: canDelete ?? this.canDelete,
    canEdit: canEdit ?? this.canEdit,
  );
}