sendMessage method

Future<void> sendMessage(
  1. Message message
)

Implementation

Future<void> sendMessage(Message message) async {
  Message? willSendMsg = message;
  if (willSendHandler != null) {
    willSendMsg = willSendHandler!(willSendMsg);
    if (willSendMsg == null) {
      return Future(() => null);
    }
  }
  willSendMsg.addProfile();
  willSendMsg.isChatThreadMessage = true;
  willSendMsg.chatType = ChatType.GroupChat;
  final msg = await ChatUIKit.instance.sendMessage(message: willSendMsg);
  if (ChatUIKitProvider.instance.currentUserProfile != null) {
    userMap[ChatUIKit.instance.currentUserId!] =
        ChatUIKitProvider.instance.currentUserProfile!;
  }

  if (loadFinished) {
    msgModelList.add(MessageModel(message: msg));
    refresh();
  }
}