queryMoreComments method

Future<Result<List<ThreadedCommentData>>> queryMoreComments({
  1. int? limit,
})

Loads more activity comments based on the current pagination state.

If there are no more comments available, it returns an empty list.

Optionally accepts a limit parameter to specify the maximum number of comments to return.

Implementation

Future<Result<List<ThreadedCommentData>>> queryMoreComments({
  int? limit,
}) async {
  // Build the query with the current pagination state (with next page token)
  final next = _stateNotifier.value.pagination?.next;

  // Early return if no more comments available
  if (next == null) return const Result.success([]);

  // Create a new query with the next page token
  final nextQuery = query.copyWith(
    limit: limit ?? query.limit,
    next: next,
    previous: null,
  );

  return _queryComments(nextQuery);
}