fromMap static method

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

Construct from Map.

Implementation

static Proxy? 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 id = _map['id']! as int;
  var server = _map['server']! as String;
  var port = _map['port']! as int;
  var last_used_date = _map['last_used_date']! as int;
  var is_enabled = _map['is_enabled']! as bool;
  var type = ProxyType.fromMap(_map['type'])!;
  return Proxy(
    extra: extra,
    clientId: clientId,
    id: id,
    server: server,
    port: port,
    last_used_date: last_used_date,
    is_enabled: is_enabled,
    type: type,
  );
}