copyWith method
Implementation
ChatMessage copyWith({
String? id,
String? text,
String? senderId,
String? senderName,
DateTime? timestamp,
MessageStatus? status,
int? attempt,
}) {
return ChatMessage(
id: id ?? this.id,
text: text ?? this.text,
senderId: senderId ?? this.senderId,
senderName: senderName ?? this.senderName,
timestamp: timestamp ?? this.timestamp,
status: status ?? this.status,
attempt: attempt ?? this.attempt,
);
}