getBlockListFromDB method

  1. @Deprecated('Use getBlockIds instead.')
Future<List<String>> getBlockListFromDB()

~english Gets the block list from the local database.

Return The block list obtained from the local database.

Throws A description of the exception. See EMError. ~end

~chinese 从本地数据库获取黑名单列表。

Return 该方法调用成功会返回黑名单列表。

Throws 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。请参见 EMError。 ~end

Implementation

@Deprecated('Use getBlockIds instead.')

/// ~english
/// Gets the block list from the local database.
///
/// **Return** The block list obtained from the local database.
///
/// **Throws** A description of the exception. See [EMError].
/// ~end
///
/// ~chinese
/// 从本地数据库获取黑名单列表。
///
/// **Return** 该方法调用成功会返回黑名单列表。
///
/// **Throws**  如果有方法调用的异常会在这里抛出,可以看到具体错误原因。请参见 [EMError]。
/// ~end
Future<List<String>> getBlockListFromDB() async {
  try {
    Map result = await Client.instance.contactManager
        .callNativeMethod(ChatMethodKeys.getBlockListFromDB);
    EMError.hasErrorFromResult(result);
    List<String> list = [];
    result[ChatMethodKeys.getBlockListFromDB]?.forEach((element) {
      if (element is String) {
        list.add(element);
      }
    });
    return list;
  } catch (e) {
    rethrow;
  }
}