import 'NurseryDetail.dart'; class Nursery { int id; int activityId; int cropId; String executeDate; String description; String executeBy; String media; String seedName; num substratesId; num seedLength; num quantity; num seedIncubationTime; List nurseryDetail; Nursery( {this.id, this.activityId, this.cropId, this.executeDate, this.description, this.executeBy, this.media, this.seedName, this.substratesId, this.seedLength, this.quantity, this.seedIncubationTime, this.nurseryDetail}); Nursery.fromJson(Map json) { id = json['id']; activityId = json['activityId']; cropId = json['cropId']; executeDate = json['executeDate']; description = json['description']; executeBy = json['executeBy']; media = json['media']; seedName = json['seedName']; substratesId = json['substratesId']; seedLength = json['seedLength']; quantity = json['quantity']; seedIncubationTime = json['seedIncubationTime']; if (json['nurseryDetail'] != null) { nurseryDetail = new List(); json['nurseryDetail'].forEach((v) { nurseryDetail.add(new NurseryDetail.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['activityId'] = this.activityId; data['cropId'] = this.cropId; data['executeDate'] = this.executeDate; data['description'] = this.description; data['executeBy'] = this.executeBy; data['media'] = this.media; data['seedName'] = this.seedName; data['substratesId'] = this.substratesId; data['seedLength'] = this.seedLength; data['quantity'] = this.quantity; data['seedIncubationTime'] = this.seedIncubationTime; if (this.nurseryDetail != null) { data['nurseryDetail'] = this.nurseryDetail.map((v) => v.toJson()).toList(); } return data; } }