Browse SDKs · Flutter
Platform
SDKsFlutter

Clear conversation messages

Retain the conversation entry while clearing all messages for the current account using the OpenIM Flutter SDK.

Copy

Retain the conversation entry in the conversation list while purging all message history locally and on the server:

Parameters

ParameterTypeRequiredDescription
conversationIDStringYesTarget 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.