ChatMessage class

Represents a single message in a chat session.

Each message has a unique ID, the user who sent it, a timestamp, and content which can be text, media, or both.

Constructors

ChatMessage({required String id, required ChatUser user, required DateTime createdAt, String? text, String? mediaUrl, MediaType mediaType = MediaType.text})
Creates a new instance of a ChatMessage.

Properties

createdAt DateTime
The time the message was created.
final
hashCode int
The hash code for this object.
no setterinherited
id String
The unique identifier for the message.
final
mediaType MediaType
The type of media this message contains. Defaults to text.
final
mediaUrl String?
An optional URL for media content (e.g., an image).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String?
The text content of the message. Can be null if it's a media-only message.
final
user ChatUser
The user who sent the message.
final

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