getAllMessageCount function
Get the message count from db.
Returns The message count in db.
Throws A description of the exception. See ChatError.
Implementation
Future<int> getAllMessageCount() async {
try {
Map result = await platform_interface.Client.instance.chatManager
.callNativeMethod(ChatMethodKeys.getMessageCount);
ChatError.hasErrorFromResult(result);
if (result.containsKey(ChatMethodKeys.getMessageCount)) {
return result[ChatMethodKeys.getMessageCount];
} else {
return 0;
}
} catch (e) {
rethrow;
}
}