EMConversation class
Properties
-
conversationId
→ String
-
会话id
read-only
-
extField
↔ String
-
会话扩展
read / write
-
type
→ EMConversationType
-
会话类型
read-only
-
hashCode
→ int
-
The hash code for this object. [...]
read-only, inherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
appendMessage(EMMessage msg)
→ void
-
插入一条消息到会话尾部
msg
-
clear()
→ void
-
清除对话中的所有消息,只清除内存的,不清除db的消息 在退出会话的时候清除内存缓存,减小内存消耗
-
clearAllMessages()
→ void
-
删除该会话所有消息,同时清除内存和数据库中的消息
-
getLastMessage()
→ Future<EMMessage>
-
获取对话的最后一条消息
-
getLatestMessageFromOthers()
→ Future<EMMessage>
-
获取其他人发送的最新消息。
-
getMessage(String messageId, { bool markAsRead: true })
→ Future<EMMessage>
-
通过
mesasgeId
获取消息,markAsRead
将其设置为已读.
-
getUnreadMsgCount()
→ Future<int>
-
获取此对话中未读取的消息数量.
-
insertMessage(EMMessage msg)
→ void
-
插入一条消息
msg
-
isGroup()
→ bool
-
群组和聊天室类型都会返回true
-
loadMoreMsgFromDB({String startMsgId, int pageSize: 10 })
→ Future<List<EMMessage>>
-
根据传入的参数从db加载startMsgId之前(存储顺序)指定数量的message
startMsgId
, pageSize
-
markAllMessagesAsRead()
→ void
-
将所有未读消息设置为已读.
-
markMessageAsRead({String messageId })
→ void
-
将id是
messageId
的消息标记为已读。
-
removeMessage({String messageId })
→ void
-
从对话中删除id是
messageId
的消息。
-
searchMsgFromDB(EMMessageType type, String keywords, int timeStamp, int maxCount, EMSearchDirection direction)
→ Future<List<EMMessage>>
-
根据传入的参数从本地存储中搜索指定数量的消息
type
消息类型,文本、图片、语音等等
keywords
, 搜索消息中的关键词
timeStamp
,搜索消息的时间点
maxCount
搜索结果的最大条数
direction
. 方向
-
searchMsgFromDBByType(EMMessageType type, String keywords, int timeStamp, int maxCount, EMSearchDirection direction)
→ Future<List<EMMessage>>
-
搜索来自DB的消息,类型为
type
,匹配keywords
,在timeStamp
之后,maxCount
返回的大多数消息,方向为direction
。
-
updateMessage(EMMessage msg)
→ Future<bool>
-
更新本地的消息
msg
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString()
→ String
-
Returns a string representation of this object.
inherited
Operators
-
operator ==(dynamic other)
→ bool
-
The equality operator. [...]
inherited