SDKsFlutter
Create an @ mention message
Create a group @ text message with the OpenIM Flutter SDK.
Construct a group text message that mentions (@) specific group members or all members:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | String | Yes | Body content of the message including the @ mention display text. |
atUserIDList | List<String> | Yes | List of user IDs to mention. Can include the mention-all identifier to notify all members. |
atUserInfoList | List<AtUserInfo>? | No | List of detailed member metadata (user ID and group nickname) used to render mentions in UI. |
quoteMessage | Message? | No | Optional original message to quote alongside the mention; pass null if not quoting. |
Code example
final message = await OpenIM.iMManager.messageManager.createTextAtMessage(
text: '@$userID Please confirm',
atUserIDList: [userID],
atUserInfoList: [AtUserInfo(atUserID: userID, groupNickname: nickname)],
quoteMessage: quotedMessage,
);Return value
Returns a Future resolving to a mention Message object ready for transmission. Its payload is stored in atTextElem.
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, specifying the target group ID.
Was this page helpful?