all_cuisine.dart
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class AllCuisineModel {
int ret;
List<AllCuisineSunModel> data;
String msg;
AllCuisineModel({this.ret, this.data, this.msg});
AllCuisineModel.fromJson(Map<String, dynamic> json) {
ret = json['ret'];
if (json['data'] != null) {
data = new List<AllCuisineSunModel>();
json['data'].forEach((v) {
data.add(new AllCuisineSunModel.fromJson(v));
});
}
msg = json['msg'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ret'] = this.ret;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['msg'] = this.msg;
return data;
}
}
class AllCuisineSunModel {
String id;
String name;
String icon;
String weight;
bool select = false;
AllCuisineSunModel({this.id, this.name, this.icon, this.weight});
AllCuisineSunModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
icon = json['icon'];
weight = json['weight'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['icon'] = this.icon;
data['weight'] = this.weight;
return data;
}
}