fetchBlockListFromServer method

Future<List<String>> fetchBlockListFromServer(
  1. String groupId, {
  2. int pageSize = 200,
  3. int pageNum = 1,
})

~english Gets the group block list from server with pagination.

Only the group owner or admin can call this method.

Param groupId The group ID.

Param pageSize The number of groups per page.

Param pageNum The page number, starting from 1.

Return The group block list.

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

~chinese 以分页方式获取群组的黑名单。

仅群主和管理员可调用此方法。

Param groupId 群组 ID。

Param pageSize 每页返回的群组黑名单成员数量。

Param pageNum 当前页码,从 1 开始。

Return 返回的黑名单列表。

Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 EMError。 ~end

Implementation

Future<List<String>> fetchBlockListFromServer(
  String groupId, {
  int pageSize = 200,
  int pageNum = 1,
}) async {
  Map req = {'groupId': groupId, 'pageNum': pageNum, 'pageSize': pageSize};
  Map result = await _channel.invokeMethod(
      ChatMethodKeys.getGroupBlockListFromServer, req);
  try {
    EMError.hasErrorFromResult(result);
    return result[ChatMethodKeys.getGroupBlockListFromServer]
            ?.cast<String>() ??
        [];
  } on EMError catch (e) {
    throw e;
  }
}