copyWith method
Creates a copy of this message with some fields replaced.
Only the specified fields will be changed; all others remain the same.
Example:
final updatedMessage = message.copyWith(content: 'Updated content');
Implementation
ChatMessage copyWith({
final String? id,
final String? content,
final bool? isUser,
final DateTime? timestamp,
}) => ChatMessage(
id: id ?? this.id,
content: content ?? this.content,
isUser: isUser ?? this.isUser,
timestamp: timestamp ?? this.timestamp,
);