YoutubeDataModel.fromMap constructor

YoutubeDataModel.fromMap(
  1. Map<String, dynamic> json
)

Implementation

factory YoutubeDataModel.fromMap(Map<String, dynamic> json) =>
    YoutubeDataModel(
      videoId: json['videoId'] ?? null,
      title: json['title'] ?? null,
      authorName: json['author_name'] ?? null,
      authorUrl: json['author_url'] ?? null,
      durationSeconds: int.tryParse(json['lengthSeconds']) ?? null,
      keywords: json['keywords'] ?? null,
      averageRating: json['averageRating']?.toDouble() ?? null,
      viewCount: int.tryParse(json['viewCount']) ?? null,
      type: json['type'] ?? null,
      height: json['height'] ?? null,
      width: json['width'] ?? null,
      version: json['version'] ?? null,
      thumbnailHeight: json['thumbnail_height'] ?? null,
      thumbnailWidth: json['thumbnail_width'] ?? null,
      thumbnailUrl: json['thumbnail_url'] ?? null,
      html: json['html'] ?? null,
      url: json['url'] ?? null,
      description: json['description'] ?? null,
      fullDescription: json['shortDescription'] ?? null,
    );