ChatMessage class

Represents a chat message

Constructors

ChatMessage({required String messageId, required String senderId, required String receiverId, required String message, required DateTime createdAt, String status = 'sent', required bool isMine, String? attachmentUrl, String? attachmentName, String? attachmentType})
Constructor
ChatMessage.fromMap(Map<String, dynamic> map, String currentUserId)
Creates a ChatMessage from a Map object
factory

Properties

attachmentName → String?
Optional file name if the message contains an attachment
final
attachmentType → String?
Optional file type if the message contains an attachment
final
attachmentUrl → String?
Optional file URL if the message contains an attachment
final
createdAt → DateTime
Timestamp when the message was created
final
hashCode → int
The hash code for this object.
no setterinherited
isMine → bool
Whether the message is from the current user
final
message → String
Content of the message
final
messageId → String
Unique ID of the message
final
receiverId → String
ID of the receiver
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
senderId → String
ID of the sender
final
status ↔ String
Status of the message (sent, delivered, read)
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
Converts ChatMessage to a Map object
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited