Update.fromJson constructor
Creates a Update from json Map.
Implementation
factory Update.fromJson(Map<String, dynamic> json) {
return Update(
updateId: json['update_id']!,
message:
json['message'] != null ? Message.fromJson(json['message']!) : null,
editedMessage: json['edited_message'] != null
? Message.fromJson(json['edited_message']!)
: null,
channelPost: json['channel_post'] != null
? Message.fromJson(json['channel_post']!)
: null,
editedChannelPost: json['edited_channel_post'] != null
? Message.fromJson(json['edited_channel_post']!)
: null,
inlineQuery: json['inline_query'] != null
? InlineQuery.fromJson(json['inline_query']!)
: null,
chosenInlineResult: json['chosen_inline_result'] != null
? ChosenInlineResult.fromJson(json['chosen_inline_result']!)
: null,
callbackQuery: json['callback_query'] != null
? CallbackQuery.fromJson(json['callback_query']!)
: null,
shippingQuery: json['shipping_query'] != null
? ShippingQuery.fromJson(json['shipping_query']!)
: null,
preCheckoutQuery: json['pre_checkout_query'] != null
? PreCheckoutQuery.fromJson(json['pre_checkout_query']!)
: null,
poll: json['poll'] != null ? Poll.fromJson(json['poll']!) : null,
pollAnswer: json['poll_answer'] != null
? PollAnswer.fromJson(json['poll_answer']!)
: null,
myChatMember: json['my_chat_member'] != null
? ChatMemberUpdated.fromJson(json['my_chat_member']!)
: null,
chatMember: json['chat_member'] != null
? ChatMemberUpdated.fromJson(json['chat_member']!)
: null,
chatJoinRequest: json['chat_join_request'] != null
? ChatJoinRequest.fromJson(json['chat_join_request']!)
: null,
messageReaction: json['message_reaction'] != null
? MessageReactionUpdated.fromJson(json['message_reaction']!)
: null,
messageReactionCount: json['message_reaction_count'] != null
? MessageReactionCountUpdated.fromJson(
json['message_reaction_count']!,
)
: null,
chatBoost: json['chat_boost'] != null
? ChatBoostUpdated.fromJson(json['chat_boost']!)
: null,
removedChatBoost: json['chat_boost_removed'] != null
? ChatBoostRemoved.fromJson(json['chat_boost_removed']!)
: null,
businessConnection: json['business_connection'] != null
? BusinessConnection.fromJson(json['business_connection']!)
: null,
businessMessage: json['business_message'] != null
? Message.fromJson(json['business_message'])
: null,
editedBusinessMessage: json['edited_business_message'] != null
? Message.fromJson(json['edited_business_message'])
: null,
deletedBusinessMessages: json['deleted_business_messages'] != null
? BusinessMessagesDeleted.fromJson(json['deleted_business_messages'])
: null,
purchasedPaidMedia: json['purchased_paid_media'] != null
? PaidMediaPurchased.fromJson(json['purchased_paid_media'])
: null,
);
}