Conversation class
Represents a chat conversation.
This class includes various properties that encapsulate details of a conversation, including the ID, type (user or group), the user or group the conversation is with, the last message sent, the last update time, etc. It also includes details used for notifications, such as the count of unread messages and unread mentions.
Constructors
-
Conversation({String? conversationId, required String conversationType, required AppEntity conversationWith, BaseMessage? lastMessage, DateTime? updatedAt, int unreadMessageCount = 0, List<
String> ? tags, int unreadMentionsCount = 0, int? lastReadMessageId, int? latestMessageId, DateTime? pinnedAt, String? pinnedBy}) -
Constructs a new
Conversationinstance. - Conversation.fromMap(dynamic map)
-
Creates a new
Conversationinstance from a map.factory
Properties
- conversationId ↔ String?
-
conversationId is the unique ID of the conversation.
getter/setter pair
- conversationType ↔ String
-
conversationType is the type of conversation.
getter/setter pair
- conversationWith ↔ AppEntity
-
conversationWith is the user or group with whom the conversation is taking place.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastMessage ↔ BaseMessage?
-
lastMessage is the last message sent in the conversation.
getter/setter pair
- lastReadMessageId ↔ int?
-
lastReadMessageId is the ID of the last read message in the conversation.
getter/setter pair
- latestMessageId ↔ int?
-
latestMessageId is the ID of the latest message in the conversation.
getter/setter pair
- pinnedAt ↔ DateTime?
-
pinnedAt is when this conversation was pinned for the logged-in user.
null= not pinned. Present-only-when-set on the wire — absence means "not pinned", never an error.getter/setter pair - pinnedBy ↔ String?
-
pinnedBy is the uid of whoever placed the pin, or the
app_systemsentinel when it was pinned by an admin surface (API key / dashboard). Only a pin placed by the logged-in user is user-removable; anapp_systempin cannot be unpinned from the client.nullwhenever pinnedAt is null.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tags is a list of tags associated with the conversation.
getter/setter pair
- unreadMentionsCount ↔ int
-
unreadMentionsCount is the count of unread mentions in the conversation.
getter/setter pair
- unreadMessageCount ↔ int
-
unreadMessageCount is the count of unread messages in the conversation.
getter/setter pair
- updatedAt ↔ DateTime?
-
updatedAt is the time at which the conversation was last updated.
getter/setter pair
Methods
-
copyWith(
{String? conversationId, String? conversationType, AppEntity? conversationWith, BaseMessage? lastMessage, DateTime? updatedAt, int? unreadMessageCount, List< String> ? tags, int? unreadMentionsCount, int? lastReadMessageId, int? latestMessageId, DateTime? pinnedAt, String? pinnedBy}) → Conversation - Creates a copy of this Conversation with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
Generates a string representation of the
Conversation.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited