fromJson static method

PremiumGiftPaymentOption? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static PremiumGiftPaymentOption? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return PremiumGiftPaymentOption(
    currency: (json['currency'] as String?) ?? '',
    amount: (json['amount'] as int?) ?? 0,
    starCount: (json['star_count'] as int?) ?? 0,
    discountPercentage: (json['discount_percentage'] as int?) ?? 0,
    monthCount: (json['month_count'] as int?) ?? 0,
    storeProductId: (json['store_product_id'] as String?) ?? '',
    sticker: Sticker.fromJson(tdMapFromJson(json['sticker'])),
  );
}