fromMap static method

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

Construct from Map.

Implementation

static UpdatePollAnswer? 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 poll_id = _map['poll_id']! as int64;
  var voter_id = MessageSender.fromMap(_map['voter_id'])!;
  var option_ids = List<int>.from(
    (_map["option_ids"] ?? []).map(
      (e) => e as int,
    ),
  );
  return UpdatePollAnswer(
    extra: extra,
    clientId: clientId,
    poll_id: poll_id,
    voter_id: voter_id,
    option_ids: option_ids,
  );
}