Medicine.dart
933 Bytes
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
class Medicine {
final int medicineId;
final String antiEffect;
final String company;
final String dosage;
final String name;
final String target;
final String warn;
Medicine(
{this.medicineId,
this.antiEffect,
this.company,
this.dosage,
this.name,
this.target,
this.warn});
factory Medicine.fromJson(Map<String, dynamic> parsedJson) {
return Medicine(
medicineId: parsedJson['medicineId'],
antiEffect: parsedJson['antiEffect'],
company: parsedJson['company'],
dosage: parsedJson['dosage'],
name: parsedJson['name'],
target: parsedJson['target'],
warn: parsedJson['warn'],
);
}
Map<String, dynamic> toJson() => {
"medicineId": medicineId,
"antiEffect": antiEffect,
"company": company,
"dosage": dosage,
"name": name,
"target": target,
"warn": warn,
};
}