You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.5 KiB

/// code : 200
/// msg : "success"
/// ip : "27.17.85.129"
/// country : "中国"
/// province : "湖北"
/// city : "武汉市"
/// isp : "电信"
class IpData {
IpData({
num code,
String msg,
String ip,
String country,
String province,
String city,
String isp,}){
_code = code;
_msg = msg;
_ip = ip;
_country = country;
_province = province;
_city = city;
_isp = isp;
}
IpData.fromJson(dynamic json) {
_code = json['code'];
_msg = json['msg'];
_ip = json['ip'];
_country = json['country'];
_province = json['province'];
_city = json['city'];
_isp = json['isp'];
}
num _code;
String _msg;
String _ip;
String _country;
String _province;
String _city;
String _isp;
IpData copyWith({ num code,
String msg,
String ip,
String country,
String province,
String city,
String isp,
}) => IpData( code: code ?? _code,
msg: msg ?? _msg,
ip: ip ?? _ip,
country: country ?? _country,
province: province ?? _province,
city: city ?? _city,
isp: isp ?? _isp,
);
num get code => _code;
String get msg => _msg;
String get ip => _ip;
String get country => _country;
String get province => _province;
String get city => _city;
String get isp => _isp;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['code'] = _code;
map['msg'] = _msg;
map['ip'] = _ip;
map['country'] = _country;
map['province'] = _province;
map['city'] = _city;
map['isp'] = _isp;
return map;
}
}