2024-03-18 13:23:58 +08:00
|
|
|
class AppConfig {
|
|
|
|
String? ver;
|
|
|
|
List<AppConfigItem>? items;
|
|
|
|
|
|
|
|
AppConfig({this.ver, this.items});
|
|
|
|
|
|
|
|
AppConfig.fromJson(Map<String, dynamic> json) {
|
|
|
|
ver = json['ver'];
|
|
|
|
if (json['items'] != null) {
|
|
|
|
items = <AppConfigItem>[];
|
|
|
|
json['items'].forEach((v) {
|
|
|
|
items!.add(AppConfigItem.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
2024-03-31 17:13:29 +08:00
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
2024-03-18 13:23:58 +08:00
|
|
|
data['ver'] = ver;
|
|
|
|
if (items != null) {
|
|
|
|
data['items'] = items!.map((v) => v.toJson()).toList();
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class AppConfigItem {
|
|
|
|
dynamic data;
|
|
|
|
String? name;
|
|
|
|
|
|
|
|
AppConfigItem({this.data, name});
|
|
|
|
|
|
|
|
AppConfigItem.fromJson(Map<String, dynamic> json) {
|
|
|
|
data = json['data'];
|
|
|
|
name = json['name'];
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
2024-03-31 17:13:29 +08:00
|
|
|
final Map<String, dynamic> json = <String, dynamic>{};
|
2024-03-18 13:23:58 +08:00
|
|
|
json['data'] = data;
|
|
|
|
json['name'] = name;
|
|
|
|
return json;
|
|
|
|
}
|
|
|
|
}
|