copyWith method

TranscriptionModel copyWith({
  1. String? id,
  2. String? name,
  3. String? transcription,
  4. String? timestamp,
  5. String? sourceLang,
  6. String? targetLang,
  7. bool? isFinal,
  8. String? translatedTranscription,
})

Implementation

TranscriptionModel copyWith({
  String? id,
  String? name,
  String? transcription,
  String? timestamp,
  String? sourceLang,
  String? targetLang,
  bool? isFinal,
  String? translatedTranscription, // Allow updating the translatedTranscription
}) {
  return TranscriptionModel(
    id: id ?? this.id,
    name: name ?? this.name,
    transcription: transcription ?? this.transcription,
    timestamp: timestamp ?? this.timestamp,
    sourceLang: sourceLang ?? this.sourceLang,
    targetLang: targetLang ?? this.targetLang,
    isFinal: isFinal ?? this.isFinal,
    translatedTranscription: translatedTranscription ?? this.translatedTranscription, // Update the translatedTranscription
  );
}