class InsuranceApprovalDetails { String procedureName; String status; String isInvoicedDesc; InsuranceApprovalDetails({ this.procedureName, this.status, this.isInvoicedDesc, }); InsuranceApprovalDetails.fromJson(Map json) { try { isInvoicedDesc = json['IsInvoicedDesc']; status = json['Status']; procedureName = json['ProcedureName']; } catch (e) { print(e); } } } class InsuranceApprovalModel { InsuranceApprovalDetails approvalDetails; double versionID; int channel; int languageID; String iPAdress; String generalid; int patientOutSA; String sessionID; bool isDentalAllowedBackend; int deviceTypeID; int patientID; String tokenID; int patientTypeID; int patientType; int eXuldAPPNO; int projectID; String doctorName; String clinicName; String patientDescription; int approvalNo; String approvalStatusDescption; int unUsedCount; //String companyName; String expiryDate; String rceiptOn; int appointmentNo; InsuranceApprovalModel( {this.versionID, this.channel, this.languageID, this.iPAdress, this.generalid, this.patientOutSA, this.sessionID, this.isDentalAllowedBackend, this.deviceTypeID, this.patientID, this.tokenID, this.patientTypeID, this.patientType, this.eXuldAPPNO, this.projectID, this.doctorName, this.clinicName, this.patientDescription, this.approvalNo, this.approvalStatusDescption, this.unUsedCount, //this.companyName, this.expiryDate, this.rceiptOn, this.approvalDetails, this.appointmentNo}); InsuranceApprovalDetails x = InsuranceApprovalDetails(); InsuranceApprovalModel.fromJson(Map json) { try { rceiptOn = json['ReceiptOn']; expiryDate = json['ExpiryDate']; //companyName = json['CompanyName']; unUsedCount = json['TotaUnUsedCount']; approvalStatusDescption = json['ApprovalStatusDescption']; approvalNo = json['ApprovalNo']; patientDescription = json['IsInOutPatientDescription']; versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; iPAdress = json['IPAdress']; generalid = json['generalid']; patientOutSA = json['PatientOutSA']; sessionID = json['SessionID']; isDentalAllowedBackend = json['isDentalAllowedBackend']; deviceTypeID = json['DeviceTypeID']; patientID = json['PatientID']; tokenID = json['TokenID']; patientTypeID = json['PatientTypeID']; patientType = json['PatientType']; eXuldAPPNO = json['EXuldAPPNO']; projectID = json['ProjectID']; doctorName = json['DoctorName']; clinicName = json['ClinicName']; approvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); appointmentNo = json['AppointmentNo']; } catch (e) { print(e); } } Map toJson() { final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; data['generalid'] = this.generalid; data['PatientOutSA'] = this.patientOutSA; data['SessionID'] = this.sessionID; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['DeviceTypeID'] = this.deviceTypeID; data['PatientID'] = this.patientID; data['TokenID'] = this.tokenID; data['PatientTypeID'] = this.patientTypeID; data['PatientType'] = this.patientType; if (appointmentNo == null) { data['EXuldAPPNO'] = this.eXuldAPPNO; data['ProjectID'] = this.projectID; } if (appointmentNo != null) { data['AppointmentNo'] = this.appointmentNo; } return data; } }