fromJson static method

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

Implementation

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

  return InputVideo(
    video: InputFile.fromJson(tdMapFromJson(json['video'])),
    thumbnail: InputThumbnail.fromJson(tdMapFromJson(json['thumbnail'])),
    cover: InputFile.fromJson(tdMapFromJson(json['cover'])),
    startTimestamp: (json['start_timestamp'] as int?) ?? 0,
    addedStickerFileIds: List<int>.from(
      tdListFromJson(
        json['added_sticker_file_ids'],
      ).map((item) => int.tryParse((item as dynamic)?.toString() ?? '') ?? 0),
    ),
    duration: (json['duration'] as int?) ?? 0,
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
    supportsStreaming: (json['supports_streaming'] as bool?) ?? false,
  );
}