Browse SDKs · Flutter
Platform
SDKsFlutter

Create a merged message

Create a merged forward message card with the OpenIM Flutter SDK.

Copy

Package multiple messages into a merged-forward card message ready for delivery:

Parameters

ParameterTypeRequiredDescription
messageListList<Message>YesList of message objects to merge and forward (must be valid, previously delivered messages).
titleStringYesTitle displayed on the merged message card (for example, "Group Chat History").
summaryListList<String>YesList of preview summary strings displayed on the card in conversation views.

Code example

final message = await OpenIM.iMManager.messageManager.createMergerMessage(
  messageList: selectedMessages,
  title: 'Chat history',
  summaryList: summaries,
);

Messages to merge should come from authentic conversation records. We recommend extracting 2 to 4 summary strings in chronological message order.

Return value

Returns a Future resolving to a merged Message object ready for transmission. Its merged data is stored in mergeElem.

The SDK assigns a fresh client message identifier clientMsgID to the merged message card; original messages remain completely unchanged.

State changes after the call

Creating a message only constructs the local message data structure in memory; it does not perform network transmission and does not trigger new-message event callbacks. Once constructed, pass the returned Message instance to Send a message to deliver it to a direct or group conversation.