fromJson static method
Inherited by: StorePaymentPurposeGiftedStars StorePaymentPurposePremiumGiftCodes StorePaymentPurposePremiumGift StorePaymentPurposePremiumGiveaway StorePaymentPurposePremiumSubscription StorePaymentPurposeStarGiveaway StorePaymentPurposeStars
Implementation
static StorePaymentPurposePremiumGiftCodes? fromJson(
Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return StorePaymentPurposePremiumGiftCodes(
boostedChatId: (json['boosted_chat_id'] as int?) ?? 0,
currency: (json['currency'] as String?) ?? '',
amount: (json['amount'] as int?) ?? 0,
userIds: List<int>.from(
((json['user_ids'] as List<dynamic>?) ?? <dynamic>[])
.map((item) =>
(item is int ? item : int.tryParse(item.toString()) ?? 0))
.toList()),
text: FormattedText.fromJson(json['text'] as Map<String, dynamic>?)!,
);
}