fromJson static method

Video? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static Video? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return Video(
    duration: (json['duration'] as int?) ?? 0,
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
    fileName: (json['file_name'] as String?) ?? '',
    mimeType: (json['mime_type'] as String?) ?? '',
    hasStickers: (json['has_stickers'] as bool?) ?? false,
    supportsStreaming: (json['supports_streaming'] as bool?) ?? false,
    minithumbnail: Minithumbnail.fromJson(
      tdMapFromJson(json['minithumbnail']),
    ),
    thumbnail: Thumbnail.fromJson(tdMapFromJson(json['thumbnail'])),
    video: File.fromJson(tdMapFromJson(json['video'])),
  );
}