DiscordStickerPack.fromJson constructor

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

Implementation

factory DiscordStickerPack.fromJson(Map<String, dynamic> json) =>
    DiscordStickerPack(
      id: DiscordSnowflake(json[idEntry] as String),
      stickers: List<DiscordSticker>.from(
        (json[stickersEntry] as List<Map<String, dynamic>>)
            .map(DiscordSticker.fromJson),
      ),
      name: json[nameEntry] as String,
      skuId: DiscordSnowflake(json[skuIdEntry] as String),
      coverStickerId: json[coverStickerIdEntry] != null
          ? DiscordSnowflake(json[coverStickerIdEntry] as String)
          : null,
      description: json[descriptionEntry] as String,
      bannerAssetId: json[bannerAssetIdEntry] != null
          ? DiscordSnowflake(json[bannerAssetIdEntry] as String)
          : null,
    );