mobile_skt/lib/models/app_config.dart

45 lines
943 B
Dart
Raw Permalink Normal View History

2024-10-16 09:48:17 +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() {
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;
}
}