copyWith method

ChatMessage copyWith({
  1. String? id,
  2. String? text,
  3. String? senderId,
  4. String? senderName,
  5. DateTime? timestamp,
  6. MessageStatus? status,
  7. int? attempt,
})

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,
  );
}