ChatViewModel class

Inheritance

Constructors

ChatViewModel(String conversationId, NIMConversationType conversationType, {bool showReadAck = true, NIMMessage? anchorMessage, int? findAnchorDate})

Properties

aiUserRequestSuccess int
getter/setter pair
chatTitle String
getter/setter pair
contactInfo ↔ ContactInfo?
getter/setter pair
conversationId String
final
conversationType → NIMConversationType
final
findAnchorDate int?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasMoreForwardMessages bool
getter/setter pair
hasMoreNewerMessages bool
getter/setter pair
initListener bool
getter/setter pair
isLoading bool
getter/setter pair
isMultiSelected bool
getter/setter pair
isTyping bool
only for p2p
getter/setter pair
markP2PMessageReadReceiptTime int
getter/setter pair
messageList List<ChatMessage>
getter/setter pair
mute bool
getter/setter pair
newMessages List<ChatMessage>
getter/setter pair
p2pUserAccId String?
no setter
receiptTime int
getter/setter pair
reeditMessage ↔ RevokedMessageInfo?
getter/setter pair
replyMessage ↔ ChatMessage?
getter/setter pair
revokeMessageId String?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollToEnd ← void Function()
no getter
selectedMessages List<NIMMessage>
no setter
sessionId String
no setter
showNewMessage bool
getter/setter pair
showReadAck bool
getter/setter pair
showWarningTips bool
getter/setter pair
subscriptions List<StreamSubscription>
final
teamInfo ↔ NIMTeam?
getter/setter pair
translationLanguageRequestId String?
getter/setter pair
voiceFromSpeaker bool
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addMessagePin(NIMMessage message, {String? ext}) Future<NIMResult<void>>
addSelectedMessage(NIMMessage message) → void
添加选中的消息
collectMessage(ChatMessage message) → void
deleteMessage(ChatMessage message) → void
delete message
deleteMessageOneByOne() → void
逐条删除
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
fetchMoreMessage(NIMQueryDirection direction) → dynamic
filterForwardMessage(bool filter(NIMMessage)) bool
forwardMessage(NIMMessage message, String conversationId, {String? postScript}) → void
forwardMessageOneByOne(String conversationId, {String? postScript, bool exitMultiMode = true}) → void
逐条转发 exitMultiMode 是否退出多选模式 postScript 转发后的附言 conversationId 转发的目标会话id
getAIMessages() List<NIMAIModelCallMessage?>?
获取AI消息的上下文 仅对数字人单聊
getAnchor(NIMQueryDirection direction) → NIMMessage?
initData({NIMMessage? anchorMessage}) → dynamic
initUserState(String accountId) → void
初始化用户在线状态
isAIUser() bool
会话对象是否是数字人
isSelectedMessage(NIMMessage message) bool
是否是被选中的消息
loadMessageWithAnchor(NIMMessage anchor) → void
loadMessageWithAnchorDate(int date) → void
mergedMessageForward(String conversationId, {String? postScript, String? errorToast, bool exitMultiMode = true}) → void
合并转发 exitMultiMode 是否退出多选模式 postScript 转发后的附言 conversationId 转发的目标会话id errorToast 转发失败的提示
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeMessagePin(NIMMessage message, {String? ext}) → void
removeSelectedMessage(NIMMessage message) → void
移除选中的消息
removeSelectedMessages(List<NIMMessage> messages) → void
移除选中的消息
resendMessage(ChatMessage message, {NIMMessage? replyMsg}) → void
resetTyping() → void
revokeMessage(ChatMessage message) Future<NIMResult<void>>
撤回消息
sendAudioMessage(String filePath, String? name, int duration, {NIMMessage? replyMsg}) → void
sendFileMessage(String filePath, String name, {NIMMessage? replyMsg}) → void
sendImageMessage(String filePath, String? name, int width, int height, {NIMMessage? replyMsg, String? imageType}) → void
sendInputNotification(bool isTyping) → void
sendLocationMessage(LocationInfo location) → void
sendMessage(NIMMessage message, {NIMMessage? replyMsg, NIMMessagePushConfig? pushConfig}) → void
发送消息最终实现 message 消息 replyMsg 回复消息 pushConfig 推送配置 aiAgent 消息发送的AI代理
sendMessageP2PReceipt(NIMMessage message) → void
sendTeamMessageReceipt(ChatMessage message) → void
sendTextMessage(String text, {NIMMessage? replyMsg, List<String>? pushList, AitContactsModel? aitContactsModel, String? title}) → void
sendVideoMessage(String videoPath, String? name, int duration, int width, int height, {NIMMessage? replyMsg}) → void
srollToNewMessage({bool scrollToEnd = true}) → void
toString() String
A string representation of this object.
inherited
translateInputText(String sourceText, String language) → void
updateContactInfo(ContactInfo? info) → void
更新对方的用户信息
updateVoicePlayModel(bool isVoiceFromSpeaker) → void
更新语音消息的播放模式

Operators

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

Constants

aiMessageSize → const int
logTag → const String
messageLimit → const int
translatePromptKey → const String
translateTemperature → const double
typeState → const String