EMMessage.createTxtSendMessage constructor Null safety

EMMessage.createTxtSendMessage(
  1. {required String targetId,
  2. required String content,
  3. List<String>? targetLanguages}
)

Creates a text message for sending.

Param targetId The ID of the message recipient.

  • For a one-to-one chat, it is the username of the peer user.
  • For a group chat, it is the group ID.
  • For a chat room, it is the chat room ID.

Param content The text content.

Param targetLanguages Target languages.

Return The message instance.

Implementation

EMMessage.createTxtSendMessage({
  required String targetId,
  required String content,
  List<String>? targetLanguages,
}) : this.createSendMessage(
        to: targetId,
        body: EMTextMessageBody(
          content: content,
          targetLanguages: targetLanguages,
        ),
      );