fromMap static method

StickerSet? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static StickerSet? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var id = _map['id']! as int64;
  var title = _map['title']! as String;
  var name = _map['name']! as String;
  var thumbnail = Thumbnail.fromMap(_map['thumbnail']);
  var thumbnail_outline = List<ClosedVectorPath>.from(
    (_map["thumbnail_outline"] ?? []).map(
      (e) => ClosedVectorPath.fromMap(e),
    ),
  );
  var is_installed = _map['is_installed']! as bool;
  var is_archived = _map['is_archived']! as bool;
  var is_official = _map['is_official']! as bool;
  var sticker_format = StickerFormat.fromMap(_map['sticker_format'])!;
  var sticker_type = StickerType.fromMap(_map['sticker_type'])!;
  var is_viewed = _map['is_viewed']! as bool;
  var stickers = List<Sticker>.from(
    (_map["stickers"] ?? []).map(
      (e) => Sticker.fromMap(e),
    ),
  );
  var emojis = List<List<String>>.from(
    (_map["emojis"] ?? []).map(
      (e) => e as List<String>,
    ),
  );
  return StickerSet(
    extra: extra,
    clientId: clientId,
    id: id,
    title: title,
    name: name,
    thumbnail: thumbnail,
    thumbnail_outline: thumbnail_outline,
    is_installed: is_installed,
    is_archived: is_archived,
    is_official: is_official,
    sticker_format: sticker_format,
    sticker_type: sticker_type,
    is_viewed: is_viewed,
    stickers: stickers,
    emojis: emojis,
  );
}