onMessageReceived static method

void onMessageReceived(
  1. dynamic chatMessage
)

Implementation

static void onMessageReceived(chatMessage) {
  LogMessage.d("flutter onMessageReceived", chatMessage.toString());
  ChatMessageModel chatMessageModel = sendMessageModelFromJson(chatMessage);
  if (Get.isRegistered<ChatController>(tag: controllerTag)) {
    // debugPrint("basecontroller ChatController registered");
    Get.find<ChatController>(tag: controllerTag)
        .onMessageReceived(chatMessageModel);
  }
  if (Get.isRegistered<DashboardController>()) {
    // debugPrint("basecontroller DashboardController registered");
    Get.find<DashboardController>().onMessageReceived(chatMessageModel);
  }
  if (Get.isRegistered<ArchivedChatListController>()) {
    // debugPrint("basecontroller ArchivedChatListController registered");
    Get.find<ArchivedChatListController>()
        .onMessageReceived(chatMessageModel);
  }

  if (Get.isRegistered<ViewAllMediaController>() &&
      chatMessageModel.isTextMessage() &&
      chatMessageModel.messageTextContent!.contains("http")) {
    Get.find<ViewAllMediaController>().onMessageReceived(chatMessageModel);
  }
}