getAllMessageCount function

Future<int> getAllMessageCount()

Implementation

Future<int> getAllMessageCount() async {
  try {
    Map result = await Client.instance.chatManager
        .callNativeMethod(ChatMethodKeys.getMessageCount);
    EMError.hasErrorFromResult(result);
    if (result.containsKey(ChatMethodKeys.getMessageCount)) {
      return result[ChatMethodKeys.getMessageCount];
    } else {
      return 0;
    }
  } catch (e) {
    rethrow;
  }
}