fromJson static method
Inherited by: InputMessageAnimation InputMessageAudio InputMessageChecklist InputMessageContact InputMessageDice InputMessageDocument InputMessageForwarded InputMessageGame InputMessageInvoice InputMessageLiveLocation InputMessageLocation InputMessagePaidMedia InputMessagePhoto InputMessagePoll InputMessageRichMessage InputMessageStakeDice InputMessageSticker InputMessageStory InputMessageText InputMessageVenue InputMessageVideo InputMessageVideoNote InputMessageVoiceNote
Implementation
static InputMessageInvoice? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return InputMessageInvoice(
invoice: Invoice.fromJson(tdMapFromJson(json['invoice'])),
title: (json['title'] as String?) ?? '',
description: (json['description'] as String?) ?? '',
photoUrl: (json['photo_url'] as String?),
photoSize: (json['photo_size'] as int?) ?? 0,
photoWidth: (json['photo_width'] as int?) ?? 0,
photoHeight: (json['photo_height'] as int?) ?? 0,
payload: (json['payload'] as String?) ?? '',
providerToken: (json['provider_token'] as String?) ?? '',
providerData: (json['provider_data'] as String?) ?? '',
startParameter: (json['start_parameter'] as String?) ?? '',
paidMedia: InputPaidMedia.fromJson(tdMapFromJson(json['paid_media'])),
paidMediaCaption: FormattedText.fromJson(
tdMapFromJson(json['paid_media_caption']),
),
);
}