EMMessage.createTxtSendMessage constructor Null safety

EMMessage.createTxtSendMessage(
  1. {required String username,
  2. required String content}
)

Creates a text message for sending.

Param username 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.

Return The message instance.

Implementation

EMMessage.createTxtSendMessage({
  required String username,
  required String content,
}) : this.createSendMessage(
        to: username,
        body: EMTextMessageBody(content: content),
      );