copyWith method
Creates a copy of this message with the given fields replaced with new values
Implementation
ChatMessage copyWith({
String? text,
ChatUser? user,
DateTime? createdAt,
bool? isMarkdown,
Map<String, dynamic>? customProperties,
}) =>
ChatMessage(
text: text ?? this.text,
user: user ?? this.user,
createdAt: createdAt ?? this.createdAt,
isMarkdown: isMarkdown ?? this.isMarkdown,
customProperties: customProperties != null
? Map<String, dynamic>.from(customProperties)
: this.customProperties != null
? Map<String, dynamic>.from(this.customProperties!)
: null,
);