fromJson static method

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

Implementation

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

  return TrendingStickerSets(
    totalCount: (json['total_count'] as int?) ?? 0,
    sets: List<StickerSetInfo>.from(
      tdListFromJson(json['sets'])
          .map((item) => StickerSetInfo.fromJson(tdMapFromJson(item)))
          .whereType<StickerSetInfo>(),
    ),
    isPremium: (json['is_premium'] as bool?) ?? false,
  );
}