getUploadsFromPage method Null safety

Future<ChannelUploadsList> getUploadsFromPage(
  1. dynamic channelId,
  2. [VideoSorting videoSorting = VideoSorting.newest]
)

Enumerates videos uploaded by the specified channel. This fetches thru all the uploads pages of the channel so it is recommended to use .take (or any other method) to limit the search result. Every page has 30 results.

Note that this endpoint provides less info about each video (only the Title and VideoId).

Implementation

Future<ChannelUploadsList> getUploadsFromPage(dynamic channelId,
    [VideoSorting videoSorting = VideoSorting.newest]) async {
  channelId = ChannelId.fromString(channelId);
  final page = await ChannelUploadPage.get(
      _httpClient, (channelId as ChannelId).value, videoSorting.code);

  final channel = await get(channelId);

  return ChannelUploadsList(
      page.uploads
          .map((e) => Video(
              e.videoId,
              e.videoTitle,
              channel.title,
              channelId,
              e.videoUploadDate.toDateTime(),
              null,
              '',
              e.videoDuration,
              ThumbnailSet(e.videoId.value),
              null,
              Engagement(e.videoViews, null, null),
              false))
          .toList(),
      channel.title,
      channelId,
      page,
      _httpClient);
}