loadNext method

  1. @override
Future<List<User>> loadNext()
override

Load next items asynchronously

Implementation

@override
Future<List<User>> loadNext() async {
  if (loading) throw QueryInProgressError();
  if (!hasNext) return [];

  loading = true;

  final req = OpenChannelParticipantListRequest(
    channelUrl: channelUrl,
    token: token,
    limit: limit,
  );

  final sdk = SendbirdSdk().getInternal();
  final res = await sdk.api.send<UserListQueryResponse<User>>(req);
  loading = false;
  token = res.next;
  hasNext = res.next != '';
  return res.users;
}