chatThread method

Future<EMChatThread?> chatThread()

~english Get an overview of the thread in the message (currently only supported by group messages)

Return overview of the thread

Throws A description of the exception. See EMError ~end

~chinese 获得消息中的子区概述。

@note 目前,该方法只适用于群组消息。

Return 子区概述内容。

Throws 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。请参见 EMError。 ~end

Implementation

Future<EMChatThread?> chatThread() async {
  Map req = {"msgId": msgId};
  Map result =
      await _emMessageChannel.invokeMethod(ChatMethodKeys.getChatThread, req);
  try {
    EMError.hasErrorFromResult(result);
    if (result.containsKey(ChatMethodKeys.getChatThread)) {
      return result.getValue<EMChatThread>(ChatMethodKeys.getChatThread,
          callback: (obj) => EMChatThread.fromJson(obj));
    } else {
      return null;
    }
  } on EMError catch (e) {
    throw e;
  }
}