fromJson static method

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

Implementation

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

  return StoryVideo(
    duration: ((json['duration'] as num?) ?? 0.0).toDouble(),
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
    hasStickers: (json['has_stickers'] as bool?) ?? false,
    isAnimation: (json['is_animation'] as bool?) ?? false,
    minithumbnail: Minithumbnail.fromJson(
      tdMapFromJson(json['minithumbnail']),
    ),
    thumbnail: Thumbnail.fromJson(tdMapFromJson(json['thumbnail'])),
    preloadPrefixSize: (json['preload_prefix_size'] as int?) ?? 0,
    coverFrameTimestamp: ((json['cover_frame_timestamp'] as num?) ?? 0.0)
        .toDouble(),
    video: File.fromJson(tdMapFromJson(json['video'])),
  );
}