fromMap static method

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

Construct from Map.

Implementation

static CallProtocol? 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 udp_p2p = _map['udp_p2p']! as bool;
  var udp_reflector = _map['udp_reflector']! as bool;
  var min_layer = _map['min_layer']! as int;
  var max_layer = _map['max_layer']! as int;
  var library_versions = List<String>.from(
    (_map["library_versions"] ?? []).map(
      (e) => e as String,
    ),
  );
  return CallProtocol(
    extra: extra,
    clientId: clientId,
    udp_p2p: udp_p2p,
    udp_reflector: udp_reflector,
    min_layer: min_layer,
    max_layer: max_layer,
    library_versions: library_versions,
  );
}