messagesCount method

Future<int> messagesCount()

~english Message count ~end

~chinese 会话中的消息数 ~end

Implementation

Future<int> messagesCount() async {
  Map req = this._toJson();
  Map<String, dynamic> result = await _emConversationChannel.invokeMethod(
    ChatMethodKeys.messageCount,
    req,
  );

  try {
    EMError.hasErrorFromResult(result);
    int count = result[ChatMethodKeys.messageCount];
    return count;
  } on EMError catch (e) {
    throw e;
  }
}