reactionList method

Future<List<ChatMessageReaction>> reactionList()

~english Gets the Reaction list.

Return The Reaction list

Throws A description of the exception. See ChatError ~end

~chinese 获取 Reaction 列表。

Return Reaction 列表。

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

Implementation

Future<List<ChatMessageReaction>> reactionList() async {
  Map req = {"msgId": msgId};
  Map result = await _emMessageChannel.invokeMethod(
    ChatMethodKeys.getReactionList,
    req,
  );
  try {
    ChatError.hasErrorFromResult(result);
    List<ChatMessageReaction> list = [];
    result[ChatMethodKeys.getReactionList]?.forEach(
      (element) => list.add(
        ChatMessageReaction.fromJson(element),
      ),
    );
    return list;
  } on ChatError catch (e) {
    throw e;
  }
}