|
- class Nursery {
- int cropId;
- String executeDate;
- String description;
- String substrates;
- num quantity;
- num seedLength;
- num seedIncubationTime;
- List<NurseryDetail> nurseryDetail;
-
- Nursery(
- {this.cropId,
- this.executeDate,
- this.description,
- this.substrates,
- this.quantity,
- this.seedLength,
- this.seedIncubationTime,
- this.nurseryDetail});
-
- Nursery.fromJson(Map<String, dynamic> json) {
- cropId = json['cropId'];
- executeDate = json['executeDate'];
- description = json['description'];
- substrates = json['substrates'];
- quantity = json['quantity'];
- seedLength = json['seedLength'];
- seedIncubationTime = json['seedIncubationTime'];
- if (json['nurseryDetail'] != null) {
- nurseryDetail = new List<NurseryDetail>();
- json['nurseryDetail'].forEach((v) {
- nurseryDetail.add(new NurseryDetail.fromJson(v));
- });
- }
- }
-
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['cropId'] = this.cropId;
- data['executeDate'] = this.executeDate;
- data['description'] = this.description;
- data['substrates'] = this.substrates;
- data['quantity'] = this.quantity;
- data['seedLength'] = this.seedLength;
- data['seedIncubationTime'] = this.seedIncubationTime;
- if (this.nurseryDetail != null) {
- data['nurseryDetail'] =
- this.nurseryDetail.map((v) => v.toJson()).toList();
- }
- return data;
- }
- }
-
- class NurseryDetail {
- String workerName;
- String trayNumber;
-
- NurseryDetail({this.workerName, this.trayNumber});
-
- NurseryDetail.fromJson(Map<String, dynamic> json) {
- workerName = json['workerName'];
- trayNumber = json['trayNumber'];
- }
-
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['workerName'] = this.workerName;
- data['trayNumber'] = this.trayNumber;
- return data;
- }
- }
|