getAllContacts method
Gets all contacts from the local database.
Return The contact list.
Throws A description of the exception. See ChatError.
Implementation
Future<List<ChatContact>> getAllContacts() async {
Map result = await _channel.invokeMethod(ChatMethodKeys.getAllContacts);
try {
ChatError.hasErrorFromResult(result);
List<ChatContact> list = [];
result[ChatMethodKeys.getAllContacts]?.forEach((element) {
list.add(ChatContact.fromJson(element));
});
return list;
} on ChatError catch (e) {
throw e;
}
}