ChannelSnippet.fromJsonData constructor

ChannelSnippet.fromJsonData(
  1. Map<String, dynamic> data
)

Implementation

factory ChannelSnippet.fromJsonData(Map<String, dynamic> data) {
  final thumbnails = Thumbnail.thumbnailsFromMap(data['thumbnails']);
  final publishedAt = DateTime.tryParse(data['publishedAt']);
  final description = data['description'];
  final title = data['title'];
  final customUrl = data['customUrl'];
  final country = data['country'];

  return ChannelSnippet(
    thumbnails: thumbnails,
    publishedAt: publishedAt,
    description: description,
    title: title,
    customUrl: customUrl,
    country: country,
  );
}