ChatMessage.createCustomSendMessage constructor

ChatMessage.createCustomSendMessage(
  1. {required String targetId,
  2. required dynamic event,
  3. Map<String, String>? params,
  4. ChatType chatType = ChatType.Chat}
)

Creates a custom 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 event The event.

Param params The params map.

Param chatType The chat type, default is single chat, if it is group chat or chat room, see ChatType.

Return The message instance.

Implementation

ChatMessage.createCustomSendMessage({
  required String targetId,
  required event,
  Map<String, String>? params,
  ChatType chatType = ChatType.Chat,
}) : this.createSendMessage(
          chatType: chatType,
          to: targetId,
          body: ChatCustomMessageBody(event: event, params: params));