fromMap static method

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

Construct from Map.

Implementation

static MessageDice? 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 initial_state = DiceStickers.fromMap(_map['initial_state']);
  var final_state = DiceStickers.fromMap(_map['final_state']);
  var emoji = _map['emoji']! as String;
  var value = _map['value']! as int;
  var success_animation_frame_number =
      _map['success_animation_frame_number']! as int;
  return MessageDice(
    extra: extra,
    clientId: clientId,
    initial_state: initial_state,
    final_state: final_state,
    emoji: emoji,
    value: value,
    success_animation_frame_number: success_animation_frame_number,
  );
}