ChatMessage.createReceiveMessage constructor Null safety

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

Creates a received message instance.

Param body The message body.

Return The message instance.

Implementation

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