ConversationManager class

会话管理器,仿照 OpenIM ConversationManager。

Constructors

ConversationManager()

Properties

conversationListener → OnConversationListener?
no setter
hashCode → int
The hash code for this object.
no setterinherited
lastCounts ↔ ConversationListCounts?
最近一次网络拉取的 Tab 计数(全量,不受当前筛选影响)
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

bindWsEvents() → void
createConversation({required int talkMode, required int toFromId}) → Future<ConversationInfo>
deleteConversation({required int talkMode, required int toFromId}) → Future<void>
getAllConversationList({int? talkMode, int? isFriend, bool unreadOnly = false}) → Future<List<ConversationInfo>>
获取会话列表 talkMode 0/null=全部,1=私聊,2=群聊。 isFriend 0/null=不筛,1=仅好友私聊,2=仅陌生人私聊。 unreadOnly 为 true 时仅返回未读会话。
getConversationDraft({required int talkMode, required int toFromId}) → Future<ConversationDraft>
读取本机草稿(不跨端)。无草稿时 ConversationDraft.text 为空。
getTotalUnreadMsgCount() → Future<int>
markConversationAsRead({required int talkMode, required int toFromId}) → Future<void>
清除未读(打开会话时调用)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onNewMessage(Message msg, {bool fromSelf = false}) → Future<void>
新消息到达时更新会话预览 / 未读。 新建会话时 ConversationInfo.isFriend 置 0(未知),等后续 session-list 回填, 避免默认成陌生人导致 Tab 错分。
pinConversation({required int talkMode, required int toFromId, required bool isPinned}) → Future<void>
action: 1 取消置顶,2 置顶(YesNo)
removeLocalConversation({required int talkMode, required int toFromId}) → Future<void>
setConversationDraft({required int talkMode, required int toFromId, required String draftText, dynamic ops}) → Future<void>
写入本机草稿,不跨端同步。纯文本只传 draftText;富文本可附 ops (落库为 {"text","ops"},对齐 Web)。
setConversationListener(OnConversationListener listener) → void
setConversationRecvMessageOpt({required int talkMode, required int toFromId, required bool disturb}) → Future<void>
免打扰
toString() → String
A string representation of this object.
inherited
unbindWsEvents() → void

Operators

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