Browse SDKs · Flutter
SDKsFlutter

Conversations overview

Understand the responsibilities of ConversationInfo, conversationID, conversation settings, and conversation events in the OpenIM Flutter SDK.

Copy

In OpenIMSDK, a conversation is client-side chat state maintained around one one-to-one or group chat. The current user has one ConversationInfo record for each conversation. It stores list state such as the unread count, latest message, pin state, draft, message receive option, and extension data. The conversation record and chat target have separate identifiers: conversationID locates the current account's conversation state, while a one-to-one target uses the other user's userID and a group target uses groupID.

Both one-to-one and group chats use conversation records for chat-list state. Group profiles, memberships, and permissions remain under the Group APIs. A group-chat page therefore uses groupID for group capabilities and conversationID for conversation settings, unread state, drafts, and message history.

Conversation identifiers

A one-to-one conversation uses the target user ID as sourceID and ConversationType.single as its type. A group conversation uses groupID as sourceID and ConversationType.superGroup as its type. Call getConversationIDBySessionType() to obtain the stable conversationID, then use it for settings, read state, hiding, and cleanup operations.

IdentifierPurpose
conversationIDConversation-record ID for the current account, used for conversation settings, message history, and unread state.
userIDUser ID of the other participant in a one-to-one chat.
groupIDGroup ID of a group chat and the target identifier used by Group APIs.
sourceIDChat target passed to a type-based query: userID for one-to-one chats and groupID for group chats.

ConversationInfo

Common ConversationInfo fields include:

FieldDescription
conversationIDConversation ID.
conversationTypeConversation type.
userIDOther participant's user ID in a one-to-one chat.
groupIDGroup ID in a group chat.
showNameCurrent display name of the conversation.
faceURLCurrent display avatar of the conversation.
unreadCountCurrent conversation unread count.
latestMsgLatest message.
latestMsgSendTimeSend time of the latest message.
recvMsgOptMessage receive option for this conversation.
groupAtType@ mention state in a group chat.
draftTextCurrent conversation draft.
draftTextTimeTime when the draft was updated.
isPinnedWhether the conversation is pinned.
isPrivateChatWhether private-chat mode is enabled.
isMsgDestructWhether message destruction is enabled.
burnDurationBurn-after-reading duration.
msgDestructTimeMessage-destruction time configuration.
exApplication-defined conversation extension string.

Queries and settings

Conversation lifecycle

Conversation groups

Conversation groups overview explains how to organize several conversations into custom groups. A group member is identified by conversationID, while the group itself uses conversationGroupID. This changes only how the current account organizes conversations; it does not create a chat group or alter a groupID, group profile, or group membership.

The Flutter SDK exposes this capability through ConversationGroupManager. Query results establish group snapshots. Group events update records by conversationGroupID, while member events use both conversationGroupID and conversationID. The overview contains the data model, complete listener, and links to each individual API page.

State updates

Queries establish page snapshots, and events merge subsequent changes:

This overview identifies event ownership but does not set a listener. Treat a button action's successful Future, the event increment, and a reconciliation query as separate stages. Do not infer final conversation state from the user's action alone.