fromJson static method
Inherited by: TelegramPaymentPurposeGiftedStars TelegramPaymentPurposeJoinChat TelegramPaymentPurposePremiumGiftCodes TelegramPaymentPurposePremiumGift TelegramPaymentPurposePremiumGiveaway TelegramPaymentPurposeStarGiveaway TelegramPaymentPurposeStars
Implementation
static TelegramPaymentPurposePremiumGift? fromJson(
Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return TelegramPaymentPurposePremiumGift(
currency: (json['currency'] as String?) ?? '',
amount: (json['amount'] as int?) ?? 0,
userId: (json['user_id'] as int?) ?? 0,
monthCount: (json['month_count'] as int?) ?? 0,
text: FormattedText.fromJson(json['text'] as Map<String, dynamic>?)!,
);
}