next method

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

Gets the list of next items.

Implementation

@override
Future<List<User>> next() async {
  sbLog.i(StackTrace.current);

  if (isLoading) throw QueryInProgressException();
  if (!hasNext) return [];

  isLoading = true;

  final res = await chat.apiClient.send<UserListQueryResponse>(
    GroupChannelMemberListRequest(
      chat,
      limit: limit,
      channelUrl: channelUrl,
      token: token,
      nicknameStartsWith: nicknameStartsWith,
      operatorFilter: operatorFilter,
      mutedMemberFilter: mutedMemberFilter,
      memberStateFilter: memberStateFilter,
      order: order,
    ),
  );

  isLoading = false;
  token = res.next;
  hasNext = res.next != '';
  return res.users;
}