fromJson static method

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

Implementation

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

  return GiftsForResale(
    totalCount: (json['total_count'] as int?) ?? 0,
    gifts: List<GiftForResale>.from(
      tdListFromJson(json['gifts'])
          .map((item) => GiftForResale.fromJson(tdMapFromJson(item)))
          .whereType<GiftForResale>(),
    ),
    models: List<UpgradedGiftModelCount>.from(
      tdListFromJson(json['models'])
          .map((item) => UpgradedGiftModelCount.fromJson(tdMapFromJson(item)))
          .whereType<UpgradedGiftModelCount>(),
    ),
    symbols: List<UpgradedGiftSymbolCount>.from(
      tdListFromJson(json['symbols'])
          .map(
            (item) => UpgradedGiftSymbolCount.fromJson(tdMapFromJson(item)),
          )
          .whereType<UpgradedGiftSymbolCount>(),
    ),
    backdrops: List<UpgradedGiftBackdropCount>.from(
      tdListFromJson(json['backdrops'])
          .map(
            (item) => UpgradedGiftBackdropCount.fromJson(tdMapFromJson(item)),
          )
          .whereType<UpgradedGiftBackdropCount>(),
    ),
    nextOffset: (json['next_offset'] as String?) ?? '',
  );
}