copyWith method
ChatMessage
copyWith({
- String? text,
- ChatUser? user,
- DateTime? createdAt,
- bool? isMarkdown,
- List<
ChatMedia> ? media, - List<
ChatRecipe> ? recipes, - List<
ChatDocument> ? documents, - List<
QuickReply> ? quickReplies, - List<
MessageReaction> ? reactions, - Map<
String, dynamic> ? customProperties, - Widget customBuilder()?,
- bool? isSending,
- bool? hasError,
- String? errorMessage,
- bool? isWelcome,
- bool? loadingRecipe,
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,
List<ChatMedia>? media,
List<ChatRecipe>? recipes,
List<ChatDocument>? documents,
List<QuickReply>? quickReplies,
List<MessageReaction>? reactions,
Map<String, dynamic>? customProperties,
Widget Function(BuildContext, ChatMessage)? customBuilder,
bool? isSending,
bool? hasError,
String? errorMessage,
bool? isWelcome,
bool? loadingRecipe}) =>
ChatMessage(
text: text ?? this.text,
user: user ?? this.user,
createdAt: createdAt ?? this.createdAt,
isMarkdown: isMarkdown ?? this.isMarkdown,
media: media ?? this.media,
recipes: recipes ?? this.recipes,
documents: documents ?? this.documents,
quickReplies: quickReplies ?? this.quickReplies,
reactions: reactions ?? this.reactions,
customProperties: customProperties ?? this.customProperties,
customBuilder: customBuilder ?? this.customBuilder,
isSending: isSending ?? this.isSending,
hasError: hasError ?? this.hasError,
errorMessage: errorMessage ?? this.errorMessage,
isWelcome: isWelcome ?? this.isWelcome,
loadingRecipe: loadingRecipe ?? this.loadingRecipe);