class RequestActivity { int tbActivityTypeId; int tbCropId; int totalCost; String executeDate; String externalTable; String description; List tbObjectUpdateDTOList; List tbSuppliesUsingDetailsDTOs; List tbNurseryDetailsDTOList; RequestActivity( {this.tbActivityTypeId, this.tbCropId, this.totalCost, this.executeDate, this.externalTable, this.description, this.tbObjectUpdateDTOList, this.tbSuppliesUsingDetailsDTOs, this.tbNurseryDetailsDTOList}); RequestActivity.fromJson(Map json) { tbActivityTypeId = json['tbActivityTypeId']; tbCropId = json['tbCropId']; totalCost = json['totalCost']; executeDate = json['executeDate']; externalTable = json['externalTable']; description = json['description']; if (json['tbObjectUpdateDTOList'] != null) { tbObjectUpdateDTOList = new List(); json['tbObjectUpdateDTOList'].forEach((v) { tbObjectUpdateDTOList.add(new TbObjectUpdateDTO.fromJson(v)); }); } if (json['tbSuppliesUsingDetailsDTOs'] != null) { tbSuppliesUsingDetailsDTOs = new List(); json['tbSuppliesUsingDetailsDTOs'].forEach((v) { tbSuppliesUsingDetailsDTOs .add(new TbSuppliesUsingDetailsDTOs.fromJson(v)); }); } if (json['tbNurseryDetailsDTOList'] != null) { tbNurseryDetailsDTOList = new List(); json['tbNurseryDetailsDTOList'].forEach((v) { tbNurseryDetailsDTOList.add(new TbNurseryDetailsDTO.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['tbActivityTypeId'] = this.tbActivityTypeId; data['tbCropId'] = this.tbCropId; data['totalCost'] = this.totalCost; data['executeDate'] = this.executeDate; data['externalTable'] = this.externalTable; data['description'] = this.description; if (this.tbObjectUpdateDTOList != null) { data['tbObjectUpdateDTOList'] = this.tbObjectUpdateDTOList.map((v) => v.toJson()).toList(); } if (this.tbSuppliesUsingDetailsDTOs != null) { data['tbSuppliesUsingDetailsDTOs'] = this.tbSuppliesUsingDetailsDTOs.map((v) => v.toJson()).toList(); } if (this.tbNurseryDetailsDTOList != null) { data['tbNurseryDetailsDTOList'] = this.tbNurseryDetailsDTOList.map((v) => v.toJson()).toList(); } return data; } } class TbObjectUpdateDTO { int tbObjectParameterId; String index; TbObjectUpdateDTO({this.tbObjectParameterId, this.index}); TbObjectUpdateDTO.fromJson(Map json) { tbObjectParameterId = json['tbObjectParameterId']; index = json['index']; } Map toJson() { final Map data = new Map(); data['tbObjectParameterId'] = this.tbObjectParameterId; data['index'] = this.index; return data; } } class TbSuppliesUsingDetailsDTOs { int tbSuppliesInWarehouseId; String dosage; num quantity; int tbEquipmentOfCustomerId; String howToUse; TbSuppliesUsingDetailsDTOs( {this.tbSuppliesInWarehouseId, this.dosage, this.quantity, this.tbEquipmentOfCustomerId, this.howToUse}); TbSuppliesUsingDetailsDTOs.fromJson(Map json) { tbSuppliesInWarehouseId = json['tbSuppliesInWarehouseId']; dosage = json['dosage']; quantity = json['quantity']; tbEquipmentOfCustomerId = json['tbEquipmentOfCustomerId']; howToUse = json['howToUse']; } Map toJson() { final Map data = new Map(); data['tbSuppliesInWarehouseId'] = this.tbSuppliesInWarehouseId; data['dosage'] = this.dosage; data['quantity'] = this.quantity; data['tbEquipmentOfCustomerId'] = this.tbEquipmentOfCustomerId; data['howToUse'] = this.howToUse; return data; } } class TbNurseryDetailsDTO { String workerName; String trayNumber; TbNurseryDetailsDTO({this.workerName, this.trayNumber}); TbNurseryDetailsDTO.fromJson(Map json) { workerName = json['workerName']; trayNumber = json['trayNumber']; } Map toJson() { final Map data = new Map(); data['workerName'] = this.workerName; data['trayNumber'] = this.trayNumber; return data; } }