ChatMessage class

Represents a message in the chat.

Constructors

ChatMessage({required String text, required ChatUser user, required DateTime createdAt, bool isMarkdown = false, List<ChatMedia>? media, List<ChatRecipe>? recipes, List<ChatDocument>? documents, List<QuickReply>? quickReplies, List<MessageReaction>? reactions, Map<String, dynamic>? customProperties, Widget customBuilder(BuildContext, ChatMessage)?, bool isSending = false, bool hasError = false, String? errorMessage, bool isWelcome = false, bool loadingRecipe = false})
const

Properties

createdAt DateTime
When the message was created
final
customBuilder Widget Function(BuildContext, ChatMessage)?
Optional custom widget to display this message
final
customProperties Map<String, dynamic>?
Optional custom properties for the message
final
documents List<ChatDocument>?
final
errorMessage String?
Optional error message if there was an error
final
hasError bool
Whether there was an error sending the message
final
hashCode int
The hash code for this object.
no setteroverride
isMarkdown bool
Whether the message contains markdown formatting
final
isSending bool
Whether the message is currently being sent
final
isWelcome bool
Whether there was an error sending the message
final
loadingRecipe bool
final
media List<ChatMedia>?
Optional list of media attachments
final
quickReplies List<QuickReply>?
Optional list of quick replies
final
reactions List<MessageReaction>?
Optional list of reactions to this message
final
recipes List<ChatRecipe>?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
The text content of the message
final
user ChatUser
The user who sent the message
final

Methods

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(BuildContext, ChatMessage)?, bool? isSending, bool? hasError, String? errorMessage, bool? isWelcome, bool? loadingRecipe}) ChatMessage
Creates a copy of this message with the given fields replaced with new values
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override