ChatSummary class

Represents a summary of a chat, including the last message, users involved, and unread message counts.

Constructors

ChatSummary.new({required String chatId, required String lastMessage, required MessageType lastMessageType, required DateTime lastMessageTime, required List<String> users, required String otherUserId, required String lastMessageSenderId, required Map<String, int> unreadMessageCount})
Creates a new ChatSummary instance.
ChatSummary.fromMap(Map<String, dynamic> map, String currentUserId)
Factory constructor to create a ChatSummary from Firestore data. The currentUserId is used to determine the other user's ID in the chat.
factory

Properties

chatId String
Unique identifier for the chat.
final
hashCode int
The hash code for this object.
no setterinherited
lastMessage String
The last message sent in the chat.
final
lastMessageSenderId String
The ID of the user who sent the last message.
final
lastMessageTime DateTime
The time when the last message was sent.
final
lastMessageType MessageType
The type of the last message (text, image, audio, etc.).
final
otherUserId String
The ID of the other user in the chat (not the current user).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unreadMessageCount Map<String, int>
A map containing the count of unread messages for each user in the chat.
final
users List<String>
List of user IDs involved in the chat.
final

Methods

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

Operators

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