fromJson static method
Inherited by: InputMessageAnimation InputMessageAudio InputMessageChecklist InputMessageContact InputMessageDice InputMessageDocument InputMessageForwarded InputMessageGame InputMessageInvoice InputMessageLiveLocation InputMessageLocation InputMessagePaidMedia InputMessagePhoto InputMessagePoll InputMessageRichMessage InputMessageSharedWidget InputMessageStakeDice InputMessageSticker InputMessageStory InputMessageText InputMessageVenue InputMessageVideoNote InputMessageVideo InputMessageVoiceNote InputMessageWidget
Implementation
static InputMessageSharedWidget? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return InputMessageSharedWidget(
widgetId: (json['widget_id'] is int
? json['widget_id'] as int
: int.tryParse(json['widget_id']?.toString() ?? '')) ??
0,
chatData: (json['chat_data'] as String?) ?? '',
caption: FormattedText.fromJson(json['caption'] as Map<String, dynamic>?),
showCaptionAboveMedia:
(json['show_caption_above_media'] as bool?) ?? false,
);
}