fromMap static method

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

Construct from Map.

Implementation

static MessageCall? 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 is_video = _map['is_video']! as bool;
  var discard_reason = CallDiscardReason.fromMap(_map['discard_reason'])!;
  var duration = _map['duration']! as int;
  return MessageCall(
    extra: extra,
    clientId: clientId,
    is_video: is_video,
    discard_reason: discard_reason,
    duration: duration,
  );
}