copyWith method
Creates a copy of this conversation with some fields replaced.
Only the specified fields will be changed; all others remain the same.
Example:
final updatedConversation = conversation.copyWith(title: 'New Title');
Implementation
Conversation copyWith({
final String? id,
final String? title,
final List<ChatMessage>? messages,
final DateTime? createdAt,
final DateTime? updatedAt,
}) => Conversation(
id: id ?? this.id,
title: title ?? this.title,
messages: messages ?? this.messages,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
);