SDKsFlutter
Clear conversation messages
Retain the conversation entry while clearing all messages for the current account using the OpenIM Flutter SDK.
Retain the conversation entry in the conversation list while purging all message history locally and on the server:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | String | Yes | Target conversation ID. |
Code example
await OpenIM.iMManager.conversationManager
.clearConversationAndDeleteAllMsg(conversationID: conversationID);Return value
A successful Future indicates that the clear operation has completed. The client should immediately empty its active message view. The SDK emits conversation change events to reset latestMsg, latestMsgSendTime, and unread counters.
State changes after the call
Update the conversation item locally using conversationID as the primary key. For event listener integration, see Retrieve conversation list. To remove the conversation entry alongside its messages, see Delete conversation with messages.
Was this page helpful?