45 lines
943 B
Dart
45 lines
943 B
Dart
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() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
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() {
|
|
final Map<String, dynamic> json = <String, dynamic>{};
|
|
json['data'] = data;
|
|
json['name'] = name;
|
|
return json;
|
|
}
|
|
}
|