ChatMessage.createReceiveMessage constructor

ChatMessage.createReceiveMessage({
  1. required ChatMessageBody body,
  2. ChatType chatType = ChatType.Chat,
})

Creates a received message instance.

Param body The message body.

Param chatType The chat type. The default chat type is one-to-one chat. For the group chat or chat room, see ChatType.

Return The message instance.

Implementation

ChatMessage.createReceiveMessage({
  required this.body,
  this.chatType = ChatType.Chat,
}) {
  onlineState = true;
  direction = MessageDirection.RECEIVE;
}