chatThread method

Future<ChatThread?> chatThread()

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 ChatError

Implementation

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