nextPage method

  1. @override
Future<CommentsList?> nextPage()
override

Fetches the next batch of videos or returns null if there are no more results.

Implementation

@override
Future<CommentsList?> nextPage() async {
  final page = await _client.nextPage(_httpClient);
  if (page == null || page.comments == null) {
    return null;
  }

  return CommentsList(
    page.comments!
        .map(
          (e) => Comment(
            e.author,
            ChannelId(e.channelId),
            e.text,
            e.likeCount ?? 0,
            e.publishTime,
            e.repliesCount ?? 0,
            e.isHearted,
            e.continuation,
          ),
        )
        .toList(growable: false),
    totalLength,
    page,
    _httpClient,
  );
}