ChatMessage class
Represents a chat message.
The ChatMessage class stores the details of a message within a chat system, including the text content, the time when the message was sent, and the author who sent the message.
Example:
@override
Widget build(BuildContext context) {
return SfChat(
messages: [
ChatMessage(
text: 'Hi',
time: DateTime.now(),
author: ChatAuthor(id: '123-001', name: 'Chat A'),
),
],
);
}
Constructors
- ChatMessage({required String text, required DateTime time, required ChatAuthor author})
-
Creates a ChatMessage instance with the given
text
,time
, andauthor
.const
Properties
Methods
-
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.
inherited