mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
58 lines
1.1 KiB
Dart
58 lines
1.1 KiB
Dart
import 'dart:convert';
|
|
|
|
///
|
|
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
|
|
///
|
|
class ServerPrivateInfo {
|
|
/*
|
|
{
|
|
"ip": "",
|
|
"port": 1,
|
|
"user": "",
|
|
"authorization": ""
|
|
}
|
|
*/
|
|
|
|
String? name;
|
|
String? ip;
|
|
int? port;
|
|
String? user;
|
|
Object? authorization;
|
|
|
|
ServerPrivateInfo({
|
|
this.name,
|
|
this.ip,
|
|
this.port,
|
|
this.user,
|
|
this.authorization,
|
|
});
|
|
ServerPrivateInfo.fromJson(Map<String, dynamic> json) {
|
|
name = json["name"]?.toString();
|
|
ip = json["ip"]?.toString();
|
|
port = json["port"]?.toInt();
|
|
user = json["user"]?.toString();
|
|
authorization = json["authorization"];
|
|
}
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data["name"] = name;
|
|
data["ip"] = ip;
|
|
data["port"] = port;
|
|
data["user"] = user;
|
|
data["authorization"] = authorization;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
List<ServerPrivateInfo>? getServerInfoList(dynamic data) {
|
|
List<ServerPrivateInfo> ss = [];
|
|
if (data is String) {
|
|
data = json.decode(data);
|
|
}
|
|
for (var t in data) {
|
|
ss.add(ServerPrivateInfo.fromJson(t));
|
|
}
|
|
|
|
return ss;
|
|
}
|