seller_often_model.dart
4.54 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
class SellerOftenModel {
int ret;
List<SellerOftenSunModel> data;
String msg;
SellerOftenModel({this.ret, this.data, this.msg});
SellerOftenModel.fromJson(Map<String, dynamic> json) {
ret = json['ret'];
if (json['data'] != null) {
data = <SellerOftenSunModel>[];
json['data'].forEach((v) {
data.add(new SellerOftenSunModel.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 SellerOftenSunModel {
String pnum;
String sellerid;
String price;
String memberPrice;
String id;
List<SellerOftenCooklist> cooklist;
SellerOftenSunModel(
{this.pnum,
this.sellerid,
this.price,
this.memberPrice,
this.id,
this.cooklist});
SellerOftenSunModel.fromJson(Map<String, dynamic> json) {
pnum = json['pnum'];
sellerid = json['sellerid'];
price = json['price'] == null ? null : '${json['price']}';
memberPrice =
json['member_price'] == null ? null : '${json['member_price']}';
id = json['id'];
if (json['cooklist'] != null) {
cooklist = <SellerOftenCooklist>[];
json['cooklist'].forEach((v) {
cooklist.add(new SellerOftenCooklist.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['pnum'] = this.pnum;
data['sellerid'] = this.sellerid;
data['price'] = this.price;
data['member_price'] = this.memberPrice;
data['id'] = this.id;
if (this.cooklist != null) {
data['cooklist'] = this.cooklist.map((v) => v.toJson()).toList();
}
return data;
}
}
class SellerOftenCooklist {
String classid;
String className;
List<SellerOftenSunCooklist> cooklist;
SellerOftenCooklist({this.classid, this.className, this.cooklist});
SellerOftenCooklist.fromJson(Map<String, dynamic> json) {
classid = json['classid'];
className = json['class_name'];
if (json['cooklist'] != null) {
cooklist = <SellerOftenSunCooklist>[];
json['cooklist'].forEach((v) {
cooklist.add(new SellerOftenSunCooklist.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['classid'] = this.classid;
data['class_name'] = this.className;
if (this.cooklist != null) {
data['cooklist'] = this.cooklist.map((v) => v.toJson()).toList();
}
return data;
}
}
class SellerOftenSunCooklist {
int amount;
String sid;
String cookbookid;
String specid;
String practiceid;
String price;
String memberPrice;
String name;
String unit;
String image;
String className;
String classid;
String classOrder;
String practiceName;
String practice;
SellerOftenSunCooklist(
{this.amount,
this.sid,
this.cookbookid,
this.specid,
this.practiceid,
this.price,
this.memberPrice,
this.name,
this.unit,
this.image,
this.className,
this.classid,
this.classOrder,
this.practiceName,
this.practice});
SellerOftenSunCooklist.fromJson(Map<String, dynamic> json) {
amount = json['amount'] == null || json['amount'] == ''
? 1
: int.parse(json['amount']);
sid = json['sid'];
cookbookid = json['cookbookid'];
specid = json['specid'];
practiceid = json['practiceid'];
price = json['price'];
memberPrice = json['member_price'];
name = json['name'];
unit = json['unit'];
image = json['image'];
className = json['class_name'];
classid = json['classid'];
classOrder = json['class_order'];
practiceName = json['practice_name'];
practice = json['practice'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['amount'] = this.amount;
data['sid'] = this.sid;
data['cookbookid'] = this.cookbookid;
data['specid'] = this.specid;
data['practiceid'] = this.practiceid;
data['price'] = this.price;
data['member_price'] = this.memberPrice;
data['name'] = this.name;
data['unit'] = this.unit;
data['image'] = this.image;
data['class_name'] = this.className;
data['classid'] = this.classid;
data['class_order'] = this.classOrder;
data['practice_name'] = this.practiceName;
data['practice'] = this.practice;
return data;
}
}