fromJson static method

ProxyType? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static ProxyType? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  switch (json['@type']) {
    case ProxyTypeHttp.constructor:
      return ProxyTypeHttp.fromJson(json);

    case ProxyTypeMtproto.constructor:
      return ProxyTypeMtproto.fromJson(json);

    case ProxyTypeSocks5.constructor:
      return ProxyTypeSocks5.fromJson(json);

    default:
      return null;
  }
}