import 'dart:convert'; /// /// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/ /// class ServerPrivateInfo { /* { "ip": "", "port": 1, "user": "", "authorization": "" } */ late String name; late String ip; late int port; late String user; late Object authorization; String? pubKeyId; ServerPrivateInfo( {required this.name, required this.ip, required this.port, required this.user, required this.authorization, this.pubKeyId}); ServerPrivateInfo.fromJson(Map json) { name = json["name"].toString(); ip = json["ip"].toString(); port = json["port"].toInt(); user = json["user"].toString(); authorization = json["authorization"]; pubKeyId = json["pubKeyId"]?.toString(); } Map toJson() { final Map data = {}; data["name"] = name; data["ip"] = ip; data["port"] = port; data["user"] = user; data["authorization"] = authorization; data["pubKeyId"] = pubKeyId; return data; } } List getServerInfoList(dynamic data) { List ss = []; if (data is String) { data = json.decode(data); } for (var t in data) { ss.add(ServerPrivateInfo.fromJson(t)); } return ss; }