getAllContactsFromDB method

  1. @Deprecated('Use getAllContactIds instead.')
Future<List<String>> getAllContactsFromDB()

Gets the contact ids from the local database.

Return The contact list ids.

Throws A description of the exception. See ChatError.

Implementation

@Deprecated('Use getAllContactIds instead.')
/// Gets the contact ids from the local database.
///
/// **Return** The contact list ids.
///
/// **Throws** A description of the exception. See [ChatError].
Future<List<String>> getAllContactsFromDB() async {
  Map result = await _channel.invokeMethod(
    ChatMethodKeys.getAllContactsFromDB,
  );
  try {
    ChatError.hasErrorFromResult(result);
    List<String> list = [];
    result[ChatMethodKeys.getAllContactsFromDB]?.forEach((element) {
      if (element is String) {
        list.add(element);
      }
    });

    return list;
  } on ChatError catch (e) {
    throw e;
  }
}