fromMap static method

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

Construct from Map.

Implementation

static EmojiCategory? 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 name = _map['name']! as String;
  var icon = Sticker.fromMap(_map['icon'])!;
  var emojis = List<String>.from(
    (_map["emojis"] ?? []).map(
      (e) => e as String,
    ),
  );
  return EmojiCategory(
    extra: extra,
    clientId: clientId,
    name: name,
    icon: icon,
    emojis: emojis,
  );
}