fromMap static method

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

Construct from Map.

Implementation

static CreateNewStickerSet? 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 user_id = _map['user_id']! as int;
  var title = _map['title']! as String;
  var name = _map['name']! as String;
  var sticker_format = StickerFormat.fromMap(_map['sticker_format'])!;
  var sticker_type = StickerType.fromMap(_map['sticker_type'])!;
  var needs_repainting = _map['needs_repainting']! as bool;
  var stickers = List<InputSticker>.from(
    (_map["stickers"] ?? []).map(
      (e) => InputSticker.fromMap(e),
    ),
  );
  var source = _map['source']! as String;
  return CreateNewStickerSet(
    extra: extra,
    clientId: clientId,
    user_id: user_id,
    title: title,
    name: name,
    sticker_format: sticker_format,
    sticker_type: sticker_type,
    needs_repainting: needs_repainting,
    stickers: stickers,
    source: source,
  );
}