Browse SDKs · Flutter
Platform
SDKsFlutter

Create a rich-text quote message

Create a rich-text quoted message with the OpenIM Flutter SDK.

Copy

Construct a reply message that references an existing message alongside rich-text content such as hyperlinks or highlights:

Parameters

ParameterTypeRequiredDescription
textStringYesBody text of the reply message.
quoteMsgMessageYesThe complete original message object being quoted.
listList<RichMessageInfo>?NoList of rich-text entities containing link URLs, highlights, offsets, and length definitions.

Code example

final message = await OpenIM.iMManager.messageManager
    .createAdvancedQuoteMessage(
  text: text,
  quoteMsg: originalMessage,
  list: entities,
);

The offset and length of each rich-text entity must be calculated relative to the final body text string, and the quoted original message must be an authentic message record.

Return value

Returns a Future resolving to an advanced quote Message object ready for transmission. Its quote payload is stored in quoteElem.

State changes after the call

Creating a message only constructs the local message data structure in memory; it does not perform network transmission, does not modify the original message, 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.