fetchBlockListFromServer method

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

获取群组黑名单列表。 仅群主和管理员有权限调用。

Param groupId 群组 ID。 Param pageNum 获取第几页。 Param pageSize 每页获取的数量。

Return 群组黑名单列表。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError.

Implementation

Future<List<String>> fetchBlockListFromServer(
  String groupId, {
  int pageSize = 200,
  int pageNum = 1,
}) async {
  try {
    Map req = {'groupId': groupId, 'pageNum': pageNum, 'pageSize': pageSize};
    Map result = await platform_interface.Client.instance.groupManager
        .callNativeMethod(ChatMethodKeys.getGroupBlockListFromServer, req);
    ChatError.hasErrorFromResult(result);
    return result[ChatMethodKeys.getGroupBlockListFromServer]
            ?.cast<String>() ??
        [];
  } catch (e) {
    rethrow;
  }
}