IpInfo.fromJson constructor

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

Creates an IpInfo from a JSON object.

Implementation

factory IpInfo.fromJson(Map<String, dynamic> json) => IpInfo(
      ip: json['ip'] ?? '',
      isp: json['isp'] != null ? IspInfo.fromJson(json['isp']) : null,
      location: json['location'] != null
          ? LocationInfo.fromJson(json['location'])
          : null,
      risk: json['risk'] != null ? RiskInfo.fromJson(json['risk']) : null,
    );