fromJson static method

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

Implementation

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

  return InputPaidMedia(
    type: InputPaidMediaType.fromJson(tdMapFromJson(json['type'])),
    media: InputFile.fromJson(tdMapFromJson(json['media'])),
    thumbnail: InputThumbnail.fromJson(tdMapFromJson(json['thumbnail'])),
    addedStickerFileIds: List<int>.from(
      tdListFromJson(
        json['added_sticker_file_ids'],
      ).map((item) => int.tryParse((item as dynamic)?.toString() ?? '') ?? 0),
    ),
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
  );
}