diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 6e761991..703f5e3c 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -30,3 +30,4 @@ const NOTIFICATION_COUNT = 'notification-count'; const PHARMACY_SELECTED_ADDRESS = 'selected-address'; const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN'; const H2O_UNIT = 'H2O_UNIT'; +const H2O_REMINDER = 'H2O_REMINDER'; diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart index bb100219..2f4ec9f0 100644 --- a/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart +++ b/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart @@ -49,6 +49,7 @@ class UserDetailModel { this.isNotificationON}); UserDetailModel.fromJson(Map json) { + if(json==null) return; userID = json['UserID']; patientID = json['PatientID']; patientType = json['PatientType']; diff --git a/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart b/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart index 5f41f878..26bf567a 100644 --- a/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart +++ b/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart @@ -1,4 +1,4 @@ -class ReauestInsuranceApprovalModel { +class RequestInsuranceApprovalModel { double versionID; int channel; int languageID; @@ -15,7 +15,7 @@ class ReauestInsuranceApprovalModel { int eXuldAPPNO; int projectID; - ReauestInsuranceApprovalModel( + RequestInsuranceApprovalModel( {this.versionID, this.channel, this.languageID, @@ -32,7 +32,7 @@ class ReauestInsuranceApprovalModel { this.eXuldAPPNO, this.projectID}); - ReauestInsuranceApprovalModel.fromJson(Map json) { + RequestInsuranceApprovalModel.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index 894fad46..27911267 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -1,140 +1,465 @@ -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; + String setupID; int projectID; - String doctorName; - String clinicName; - String patientDescription; int approvalNo; - String approvalStatusDescption; - int unUsedCount; - - //String companyName; + String approvalDate; + int patientType; + int patientID; + int companyID; + int subCategoryID; + int doctorID; + int clinicID; + int approvalType; + String inpatientApprovalSubType; + String validFrom; + String vaildDays; + String validTo; + bool isApprovalOnGross; + bool isPackage; + int requestedAmount; + int actualApprovedAmount; + int aviliableAmount; + String companyApprovalNo; + int progNoteOrderNo; + String submitOn; + String receiptOn; + String remarks1; + String remarks2; + int status; + String feedbackStatusBy; + String feedbackStatus; + String feedbackStatusOn; + int authorizerID; String expiryDate; - String rceiptOn; int appointmentNo; + int admissionNo; + int admissionRequestNo; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + String rowVer; + bool isAddlDiscApplied; + int inProgressReasonID; + String extendedBy; + String extendedOn; + int subPolicyNo; + int noOrderAuthorizerID; + bool isVerbalApproval; + String subStatus; + bool isNotificationSend; + String eApprovalStatus; + String eApprovalRemarks; + bool isEmailSentOnDelayApproval; + int eAuthorizationID; + InsuranceApprovalDetails apporvalDetails; + String approvalStatusDescption; + String clinicName; + String clinicNameN; + String companyName; + String doctorImageURL; + String doctorName; + String doctorNameN; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isLiveCareAppointment; + String projectName; + String projectNameN; + String qR; + List speciality; + String strApprovalDate; + String strExpiryDate; + String strSubmitDate; + int totaUnUsedCount; + int unUsedCount; 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.setupID, this.projectID, - this.doctorName, - this.clinicName, - this.patientDescription, this.approvalNo, - this.approvalStatusDescption, - this.unUsedCount, - //this.companyName, + this.approvalDate, + this.patientType, + this.patientID, + this.companyID, + this.subCategoryID, + this.doctorID, + this.clinicID, + this.approvalType, + this.inpatientApprovalSubType, + this.validFrom, + this.vaildDays, + this.validTo, + this.isApprovalOnGross, + this.isPackage, + this.requestedAmount, + this.actualApprovedAmount, + this.aviliableAmount, + this.companyApprovalNo, + this.progNoteOrderNo, + this.submitOn, + this.receiptOn, + this.remarks1, + this.remarks2, + this.status, + this.feedbackStatusBy, + this.feedbackStatus, + this.feedbackStatusOn, + this.authorizerID, this.expiryDate, - this.rceiptOn, - this.approvalDetails, - this.appointmentNo}); - - InsuranceApprovalDetails x = InsuranceApprovalDetails(); + this.appointmentNo, + this.admissionNo, + this.admissionRequestNo, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.rowVer, + this.isAddlDiscApplied, + this.inProgressReasonID, + this.extendedBy, + this.extendedOn, + this.subPolicyNo, + this.noOrderAuthorizerID, + this.isVerbalApproval, + this.subStatus, + this.isNotificationSend, + this.eApprovalStatus, + this.eApprovalRemarks, + this.isEmailSentOnDelayApproval, + this.eAuthorizationID, + this.apporvalDetails, + this.approvalStatusDescption, + this.clinicName, + this.clinicNameN, + this.companyName, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isLiveCareAppointment, + this.projectName, + this.projectNameN, + this.qR, + this.speciality, + this.strApprovalDate, + this.strExpiryDate, + this.strSubmitDate, + this.totaUnUsedCount, + this.unUsedCount}); 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); + setupID = json['SetupID']; + projectID = json['ProjectID']; + approvalNo = json['ApprovalNo']; + approvalDate = json['ApprovalDate']; + patientType = json['PatientType']; + patientID = json['PatientID']; + companyID = json['CompanyID']; + subCategoryID = json['SubCategoryID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + approvalType = json['ApprovalType']; + inpatientApprovalSubType = json['InpatientApprovalSubType']; + validFrom = json['ValidFrom']; + vaildDays = json['VaildDays']; + validTo = json['ValidTo']; + isApprovalOnGross = json['IsApprovalOnGross']; + isPackage = json['IsPackage']; + requestedAmount = json['RequestedAmount']; + actualApprovedAmount = json['ActualApprovedAmount']; + aviliableAmount = json['AviliableAmount']; + companyApprovalNo = json['CompanyApprovalNo']; + progNoteOrderNo = json['ProgNoteOrderNo']; + submitOn = json['SubmitOn']; + receiptOn = json['ReceiptOn']; + remarks1 = json['Remarks1']; + remarks2 = json['Remarks2']; + status = json['Status']; + feedbackStatusBy = json['FeedbackStatusBy']; + feedbackStatus = json['FeedbackStatus']; + feedbackStatusOn = json['FeedbackStatusOn']; + authorizerID = json['AuthorizerID']; + expiryDate = json['ExpiryDate']; + appointmentNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + admissionRequestNo = json['AdmissionRequestNo']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + rowVer = json['RowVer']; + isAddlDiscApplied = json['IsAddlDiscApplied']; + inProgressReasonID = json['InProgressReasonID']; + extendedBy = json['ExtendedBy']; + extendedOn = json['ExtendedOn']; + subPolicyNo = json['SubPolicyNo']; + noOrderAuthorizerID = json['NoOrderAuthorizerID']; + isVerbalApproval = json['isVerbalApproval']; + subStatus = json['SubStatus']; + isNotificationSend = json['IsNotificationSend']; + eApprovalStatus = json['EApprovalStatus']; + eApprovalRemarks = json['EApprovalRemarks']; + isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval']; + eAuthorizationID = json['EAuthorizationID']; + if (json['ApporvalDetails'] != null) { + apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); } + approvalStatusDescption = json['ApprovalStatusDescption']; + clinicName = json['ClinicName']; + clinicNameN = json['ClinicNameN']; + companyName = json['CompanyName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + qR = json['QR']; + speciality = json['Speciality'].cast(); + strApprovalDate = json['StrApprovalDate']; + strExpiryDate = json['StrExpiryDate']; + strSubmitDate = json['StrSubmitDate']; + totaUnUsedCount = json['TotaUnUsedCount']; + unUsedCount = json['UnUsedCount']; } 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['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ApprovalNo'] = this.approvalNo; + data['ApprovalDate'] = this.approvalDate; data['PatientType'] = this.patientType; - if (appointmentNo == null) { - data['EXuldAPPNO'] = this.eXuldAPPNO; - data['ProjectID'] = this.projectID; - } - if (appointmentNo != null) { - data['AppointmentNo'] = this.appointmentNo; + data['PatientID'] = this.patientID; + data['CompanyID'] = this.companyID; + data['SubCategoryID'] = this.subCategoryID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['ApprovalType'] = this.approvalType; + data['InpatientApprovalSubType'] = this.inpatientApprovalSubType; + data['ValidFrom'] = this.validFrom; + data['VaildDays'] = this.vaildDays; + data['ValidTo'] = this.validTo; + data['IsApprovalOnGross'] = this.isApprovalOnGross; + data['IsPackage'] = this.isPackage; + data['RequestedAmount'] = this.requestedAmount; + data['ActualApprovedAmount'] = this.actualApprovedAmount; + data['AviliableAmount'] = this.aviliableAmount; + data['CompanyApprovalNo'] = this.companyApprovalNo; + data['ProgNoteOrderNo'] = this.progNoteOrderNo; + data['SubmitOn'] = this.submitOn; + data['ReceiptOn'] = this.receiptOn; + data['Remarks1'] = this.remarks1; + data['Remarks2'] = this.remarks2; + data['Status'] = this.status; + data['FeedbackStatusBy'] = this.feedbackStatusBy; + data['FeedbackStatus'] = this.feedbackStatus; + data['FeedbackStatusOn'] = this.feedbackStatusOn; + data['AuthorizerID'] = this.authorizerID; + data['ExpiryDate'] = this.expiryDate; + data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; + data['AdmissionRequestNo'] = this.admissionRequestNo; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['RowVer'] = this.rowVer; + data['IsAddlDiscApplied'] = this.isAddlDiscApplied; + data['InProgressReasonID'] = this.inProgressReasonID; + data['ExtendedBy'] = this.extendedBy; + data['ExtendedOn'] = this.extendedOn; + data['SubPolicyNo'] = this.subPolicyNo; + data['NoOrderAuthorizerID'] = this.noOrderAuthorizerID; + data['isVerbalApproval'] = this.isVerbalApproval; + data['SubStatus'] = this.subStatus; + data['IsNotificationSend'] = this.isNotificationSend; + data['EApprovalStatus'] = this.eApprovalStatus; + data['EApprovalRemarks'] = this.eApprovalRemarks; + data['IsEmailSentOnDelayApproval'] = this.isEmailSentOnDelayApproval; + data['EAuthorizationID'] = this.eAuthorizationID; + if (this.apporvalDetails != null) { + data['ApporvalDetails'] = this.apporvalDetails.toJson; } + data['ApprovalStatusDescption'] = this.approvalStatusDescption; + data['ClinicName'] = this.clinicName; + data['ClinicNameN'] = this.clinicNameN; + data['CompanyName'] = this.companyName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['StrApprovalDate'] = this.strApprovalDate; + data['StrExpiryDate'] = this.strExpiryDate; + data['StrSubmitDate'] = this.strSubmitDate; + data['TotaUnUsedCount'] = this.totaUnUsedCount; + data['UnUsedCount'] = this.unUsedCount; + return data; + } +} + +class InsuranceApprovalDetails { + int setupID; + int projectID; + int approvalNo; + int lineItemNo; + int orderType; + int procedureID; + int toothNo; + int price; + int approvedAmount; + String unapprovedPatientShare; + int waivedAmount; + String discountType; + int discountValue; + String shareType; + String patientShareTypeValue; + String companyShareTypeValue; + String patientShare; + String companyShare; + int deductableAmount; + String disapprovedRemarks; + int progNoteOrderNo; + int progNoteLineItemNo; + String invoiceTransactionType; + int invoiceNo; + String procedureName; + String procedureNameN; + String status; + bool isInvoiced; + String isInvoicedDesc; + + InsuranceApprovalDetails( + {this.setupID, + this.projectID, + this.approvalNo, + this.lineItemNo, + this.orderType, + this.procedureID, + this.toothNo, + this.price, + this.approvedAmount, + this.unapprovedPatientShare, + this.waivedAmount, + this.discountType, + this.discountValue, + this.shareType, + this.patientShareTypeValue, + this.companyShareTypeValue, + this.patientShare, + this.companyShare, + this.deductableAmount, + this.disapprovedRemarks, + this.progNoteOrderNo, + this.progNoteLineItemNo, + this.invoiceTransactionType, + this.invoiceNo, + this.procedureName, + this.procedureNameN, + this.status, + this.isInvoiced, + this.isInvoicedDesc}); + + InsuranceApprovalDetails.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + approvalNo = json['ApprovalNo']; + lineItemNo = json['LineItemNo']; + orderType = json['OrderType']; + procedureID = json['ProcedureID']; + toothNo = json['ToothNo']; + price = json['Price']; + approvedAmount = json['ApprovedAmount']; + unapprovedPatientShare = json['UnapprovedPatientShare']; + waivedAmount = json['WaivedAmount']; + discountType = json['DiscountType']; + discountValue = json['DiscountValue']; + shareType = json['ShareType']; + patientShareTypeValue = json['PatientShareTypeValue']; + companyShareTypeValue = json['CompanyShareTypeValue']; + patientShare = json['PatientShare']; + companyShare = json['CompanyShare']; + deductableAmount = json['DeductableAmount']; + disapprovedRemarks = json['DisapprovedRemarks']; + progNoteOrderNo = json['ProgNoteOrderNo']; + progNoteLineItemNo = json['ProgNoteLineItemNo']; + invoiceTransactionType = json['InvoiceTransactionType']; + invoiceNo = json['InvoiceNo']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + status = json['Status']; + isInvoiced = json['IsInvoiced']; + isInvoicedDesc = json['IsInvoicedDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ApprovalNo'] = this.approvalNo; + data['LineItemNo'] = this.lineItemNo; + data['OrderType'] = this.orderType; + data['ProcedureID'] = this.procedureID; + data['ToothNo'] = this.toothNo; + data['Price'] = this.price; + data['ApprovedAmount'] = this.approvedAmount; + data['UnapprovedPatientShare'] = this.unapprovedPatientShare; + data['WaivedAmount'] = this.waivedAmount; + data['DiscountType'] = this.discountType; + data['DiscountValue'] = this.discountValue; + data['ShareType'] = this.shareType; + data['PatientShareTypeValue'] = this.patientShareTypeValue; + data['CompanyShareTypeValue'] = this.companyShareTypeValue; + data['PatientShare'] = this.patientShare; + data['CompanyShare'] = this.companyShare; + data['DeductableAmount'] = this.deductableAmount; + data['DisapprovedRemarks'] = this.disapprovedRemarks; + data['ProgNoteOrderNo'] = this.progNoteOrderNo; + data['ProgNoteLineItemNo'] = this.progNoteLineItemNo; + data['InvoiceTransactionType'] = this.invoiceTransactionType; + data['InvoiceNo'] = this.invoiceNo; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + data['Status'] = this.status; + data['IsInvoiced'] = this.isInvoiced; + data['IsInvoicedDesc'] = this.isInvoicedDesc; return data; } } diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 0b626342..6eb1f415 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/ReauestInsuranceApprovalModel.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; @@ -25,8 +26,7 @@ class InsuranceCardService extends BaseService { List insuranceCardDetailsList = List(); bool isHaveInsuranceCard = false; - GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = - GetAllSharedRecordsByStatusResponse(); + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); clearInsuranceCard() { _cardList.clear(); @@ -36,19 +36,12 @@ class InsuranceCardService extends BaseService { _cardUpdated.clear(); } - - InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( - isDentalAllowedBackend: false, - patientTypeID: 1, - patientType: 1, - eXuldAPPNO: 0, - projectID: 0); + RequestInsuranceApprovalModel _requestInsuranceApprovalModel = RequestInsuranceApprovalModel(isDentalAllowedBackend: false, patientTypeID: 1, patientType: 1, eXuldAPPNO: 0, projectID: 0); Future getInsurance() async { hasError = false; _cardList.clear(); - await baseAppClient.post(GET_PAtIENTS_INSURANCE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PAtIENTS_INSURANCE, onSuccess: (dynamic response, int statusCode) { response['List_PatientInsuranceCard'].forEach((item) { _cardList.add(InsuranceCardModel.fromJson(item)); }); @@ -60,10 +53,9 @@ class InsuranceCardService extends BaseService { Future getInsuranceUpdate() async { hasError = false; - _cardList.clear(); - await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED, - onSuccess: (dynamic response, int statusCode) { - _cardUpdated.clear(); + _cardList.clear(); + await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED, onSuccess: (dynamic response, int statusCode) { + _cardUpdated.clear(); response['List_PatientInsuranceCardHistory'].forEach((item) { _cardUpdated.add(InsuranceUpdateModel.fromJson(item)); }); @@ -77,17 +69,16 @@ class InsuranceCardService extends BaseService { hasError = false; // _cardList.clear(); if (appointmentNo != null) { - _insuranceApprovalModel.appointmentNo = appointmentNo; - _insuranceApprovalModel.eXuldAPPNO = null; - _insuranceApprovalModel.projectID = null; + // _requestInsuranceApprovalModel.appointmentNo = appointmentNo; + _requestInsuranceApprovalModel.eXuldAPPNO = null; + _requestInsuranceApprovalModel.projectID = null; } else { - _insuranceApprovalModel.appointmentNo = null; - _insuranceApprovalModel.eXuldAPPNO = 0; - _insuranceApprovalModel.projectID = 0; + // _requestInsuranceApprovalModel.appointmentNo = null; + _requestInsuranceApprovalModel.eXuldAPPNO = 0; + _requestInsuranceApprovalModel.projectID = 0; } - await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, onSuccess: (dynamic response, int statusCode) { print(response['HIS_Approval_List'].length); _insuranceApproval.clear(); _insuranceApproval.length = 0; @@ -97,14 +88,13 @@ class InsuranceCardService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _insuranceApprovalModel.toJson()); + }, body: _requestInsuranceApprovalModel.toJson()); } Future getFamilyFiles() async { var myFamily = await sharedPref.getObject(FAMILY_FILE); if (myFamily != null) { - getAllSharedRecordsByStatusResponse = - GetAllSharedRecordsByStatusResponse.fromJson(myFamily); + getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(myFamily); } else { getSharedRecordByStatus(); } @@ -115,68 +105,75 @@ class InsuranceCardService extends BaseService { dynamic localRes; var request = GetAllSharedRecordsByStatusReq(); request.status = 0; - await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { AppToast.showErrorToast(message: error); throw error; }, body: request.toJson()); sharedPref.setObject(FAMILY_FILE, localRes); - getAllSharedRecordsByStatusResponse = - GetAllSharedRecordsByStatusResponse.fromJson(localRes); + getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes); } catch (error) { print(error); throw error; } } - Future getInsuranceDetails(data) async{ + + Future getInsuranceDetails(data) async { dynamic localRes; - await baseAppClient.post(INSURANCE_DETAILS, - onSuccess: (dynamic response, int statusCode) { - localRes = response['List_InsuranceCheckList']; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },); + await baseAppClient.post( + INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + localRes = response['List_InsuranceCheckList']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {'CompanyID': data.companyID, 'SubCategoryID': data.subCategoryID}, + ); return Future.value(localRes); } - Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID,int patientID}) async{ + Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID, int patientID}) async { error = ""; hasError = false; insuranceCardDetails = null; isHaveInsuranceCard = false; - await baseAppClient.post(GET_PATIENT_INSURANCE_DETAILS, - onSuccess: (dynamic response, int statusCode) { - insuranceCardDetailsList.clear(); - isHaveInsuranceCard = true; - response['List_PatientInsuranceDetails'].forEach((item) { - insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body:{'SetupID': setupID,'ProjectID':projectID,'PatientIdentificationID':patientIdentificationID ,'isDentalAllowedBackend':false,'PatientID':patientID},); - + await baseAppClient.post( + GET_PATIENT_INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + insuranceCardDetailsList.clear(); + isHaveInsuranceCard = true; + response['List_PatientInsuranceDetails'].forEach((item) { + insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {'SetupID': setupID, 'ProjectID': projectID, 'PatientIdentificationID': patientIdentificationID, 'isDentalAllowedBackend': false, 'PatientID': patientID}, + ); } - Future uploadInsuranceCard({ String patientIdentificationID,int patientID,String image=""}) async{ + Future uploadInsuranceCard({String patientIdentificationID, int patientID, String image = ""}) async { error = ""; - Map body = Map(); - body['PatientID']=patientID; - body['PatientType']=user.patientType; - body['MobileNo']=user.mobileNumber; - body['PatientIdentificationID']=patientIdentificationID; - body['InsuranceCardImage']= image; - - await baseAppClient.post(UPLOAD_INSURANCE_CARD, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body:body,); - + Map body = Map(); + body['PatientID'] = patientID; + body['PatientType'] = user.patientType; + body['MobileNo'] = user.mobileNumber; + body['PatientIdentificationID'] = patientIdentificationID; + body['InsuranceCardImage'] = image; + + await baseAppClient.post( + UPLOAD_INSURANCE_CARD, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index 4acc7eaf..b8be6539 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -14,6 +14,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +import 'package:manage_calendar_events/manage_calendar_events.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'Dialog/setting_page_radio_button_list_dialog.dart'; @@ -53,14 +54,14 @@ class _H2oSettingState extends State { void initState() { super.initState(); _userDetailModel = widget.userDetailModel; - _heightValue = _userDetailModel.height; - _weightValue = _userDetailModel.weight; + _heightValue = _userDetailModel?.height ?? 100; + _weightValue = _userDetailModel?.weight ?? 50; _heightController.text = _heightValue.toStringAsFixed(0); _weightController.text = _weightValue.toStringAsFixed(0); _nameController.text = _userDetailModel.firstName; - _isWeightKG = _userDetailModel.isWeightInKG; - _isHeightCM = _userDetailModel.isHeightInCM; - _isGenderMale = _userDetailModel.gender == "M" ? true : false; + _isWeightKG = _userDetailModel?.isWeightInKG ?? true; + _isHeightCM = _userDetailModel?.isHeightInCM ?? true; + _isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false; _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB); _selectedActiveLevel = _userDetailModel.activityID ?? 1; readPrefs(); @@ -70,6 +71,7 @@ class _H2oSettingState extends State { void readPrefs() async { prefs = await SharedPreferences.getInstance(); _isUnitML = (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false; + _selectedRemindedTime = prefs.getInt(H2O_REMINDER) ?? 0; setState(() {}); } @@ -450,14 +452,35 @@ class _H2oSettingState extends State { _userDetailModel.dOB = tempDate; _userDetailModel.activityID = _selectedActiveLevel; GifLoaderDialogUtils.showMyDialog(context); - await prefs.setString(H2O_UNIT, _isUnitML ? "ml" : "l"); - await widget.viewModel.updateUserDetail(_userDetailModel, (tag) { + await widget.viewModel.updateUserDetail(_userDetailModel, (tag) async { if (tag) { AppToast.showSuccessToast(message: TranslationBase.of(context).success); + await prefs.setString(H2O_UNIT, _isUnitML ? "ml" : "l"); + int _tempRemindTime = prefs.getInt(H2O_REMINDER) ?? _selectedRemindedTime; + if (_tempRemindTime != _selectedRemindedTime) { + await prefs.setInt(H2O_REMINDER, _selectedRemindedTime); + _addReminderToCalender(_selectedRemindedTime); + } } GifLoaderDialogUtils.hideDialog(context); }); Navigator.pop(context); } + + final CalendarPlugin _myPlugin = CalendarPlugin(); + void _addReminderToCalender(int _selectedRemindedTime) async { + bool _calendarPermission = await _myPlugin.hasPermissions(); + if (_calendarPermission) { + } else { + await _myPlugin.requestPermissions(); + } + _myPlugin.hasPermissions().then((value) { + if (!value) { + _myPlugin.requestPermissions(); + } else { + _myPlugin.getCalendars().then((value) => {print(value.length)}); + } + }); + } } diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index d81e704e..7283abf8 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -24,23 +24,13 @@ class _InsuranceApprovalState extends State { @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); + imagesInfo + .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); + imagesInfo + .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); return BaseView( - onModelReady: widget.appointmentNo != null - ? (model) => - model.getInsuranceApproval(appointmentNo: widget.appointmentNo) - : (model) => model.getInsuranceApproval(), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( + onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(), + builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, @@ -65,153 +55,121 @@ class _InsuranceApprovalState extends State { children: [ Texts( TranslationBase.of(context).totalApproval, - color: Color(0xff60688B), - fontSize: 19.0, - fontWeight: FontWeight.w600, + color: Color(0xff60688B), + fontSize: 19.0, + fontWeight: FontWeight.w600, ), if (model.insuranceApproval.length > 0) Container( width: 60, height: 40, - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.circular(19.0)), + decoration: BoxDecoration(color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)), child: Center( child: Texts( - model.insuranceApproval[0].unUsedCount - .toString(), - color: Colors.white, fontSize: 17.0, + model.insuranceApproval[0].unUsedCount.toString(), + color: Colors.white, + fontSize: 17.0, ), )) ], )), - ...List.generate( - model.insuranceApproval.length, - (index) => RoundedContainer( - backgroundColor: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - //height: 120.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - model.insuranceApproval[index].patientDescription == "In Patient" - ? Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: - BorderRadius.circular( - 16.0)), - width: 115.0, - padding: - EdgeInsets.only(left: 11.5), - child: Center( - child: Texts( - TranslationBase.of(context).inPatient, - color: Colors.white, - ), - ), - ) - : Container( - decoration: BoxDecoration( - color: Color(0xff505A5D), - borderRadius: - BorderRadius.circular( - 16.0)), - width: 115.0, - padding: - EdgeInsets.only(left: 11.5), - child: Center( - child: Texts( - TranslationBase.of(context).outpatient, - color: Colors.white, - ), - ), - ), - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0), - child: Texts( - model.insuranceApproval[index] - .clinicName, - fontSize: 20.0, - color: Color(0xff60686B), - fontWeight: FontWeight.w600, - ), + ...List.generate(model.insuranceApproval.length, (index) { + print(model.insuranceApproval[index].isLiveCareAppointment); + return RoundedContainer( + backgroundColor: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + //height: 120.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + model.insuranceApproval[index].isLiveCareAppointment + ? sideBadge(TranslationBase.of(context).liveCare, 0xffA9A089) + : model.insuranceApproval[index].isInOutPatient + ? sideBadge(TranslationBase.of(context).outpatient, 0xff505a5d) + : sideBadge(TranslationBase.of(context).inPatient, 0xffb8372c), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.0), + child: Texts( + model.insuranceApproval[index].clinicName, + fontSize: 20.0, + color: Color(0xff60686B), + fontWeight: FontWeight.w600, + ), + ), + Texts( + model.insuranceApproval[index].doctorName, + fontSize: 17.0, + ), + ], + ), + ), + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context).approvalNo, + fontSize: 18.0, ), Texts( - model.insuranceApproval[index] - .doctorName, - fontSize: 17.0, + model.insuranceApproval[index].approvalNo.toString(), + fontSize: 18.0, + fontWeight: FontWeight.w600, ), ], ), - ), - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 12.0, horizontal: 12.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - Texts( - TranslationBase.of(context).approvalNo, - fontSize: 18.0, - ), - Texts(model.insuranceApproval[index].approvalNo.toString(), - fontSize: 18.0, - fontWeight: FontWeight.w600,), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).procedureStatus , - fontSize: 17.5, - ), - SizedBox(width: 12,), - Texts( - model.insuranceApproval[index].approvalStatusDescption, - fontWeight: FontWeight.w600, - fontSize: 17.5, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).unusedCount, - fontSize: 17.5, - ), - Texts( - model.insuranceApproval[index].unUsedCount.toString(), - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).procedureStatus, + fontSize: 17.5, + ), + SizedBox( + width: 12, + ), + Texts( + model.insuranceApproval[index].approvalStatusDescption, + fontWeight: FontWeight.w600, + fontSize: 17.5, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).unusedCount, + fontSize: 17.5, + ), + Texts( + model.insuranceApproval[index].unUsedCount.toString(), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), // Text( // 'Company Name: ' + // model.insuranceApproval[index] @@ -224,190 +182,131 @@ class _InsuranceApprovalState extends State { // fontSize: 17.5, // fontWeight: FontWeight.w600), // ), - Texts( - TranslationBase.of(context).companyName, - fontWeight: FontWeight.w600, - fontSize: 17.5, - ), - - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).receiptOn , - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - Texts( - convertDateFormat(model.insuranceApproval[index].rceiptOn), - fontSize: 17.5, - fontWeight: FontWeight.w600, + Texts( + TranslationBase.of(context).companyName, + fontWeight: FontWeight.w600, + fontSize: 17.5, + ), - ), - ], + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).receiptOn, + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + Texts( + convertDateFormat(model.insuranceApproval[index].receiptOn), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).expiryDate, + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + Texts( + convertDateFormat(model.insuranceApproval[index].expiryDate), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], + ), + Divider( + color: Colors.black, + height: 55.0, + thickness: 1.2, + ), + IntrinsicHeight( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of(context).procedureName), + Padding( + padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), + child: Text( + model.insuranceApproval[index].apporvalDetails?.procedureName ?? '', + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.5), + ), + ), + ], + ), ), - Divider( + VerticalDivider( + width: 10.0, + thickness: 1.2, color: Colors.black, - height: 25.0, - thickness: 1.0, ), - Row( - children: [ - Texts( - TranslationBase.of(context).expiryDate, - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - Texts( - convertDateFormat(model.insuranceApproval[index].expiryDate), - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - ], + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of(context).procedureStatus), + Padding( + padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), + child: Text( + model.insuranceApproval[index].apporvalDetails?.status ?? '', + style: TextStyle(fontSize: 17.5, fontWeight: FontWeight.w600), + ), + ), + ], + ), ), - Divider( - color: Colors.black, - height: 55.0, + VerticalDivider( + width: 2.3, thickness: 1.2, + color: Colors.black, ), - IntrinsicHeight( - child: Row( - crossAxisAlignment: - CrossAxisAlignment.center, + Expanded( + flex: 1, + child: Column( children: [ - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .procedureName), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .procedureName, - style: TextStyle( - fontWeight: - FontWeight.w600, - fontSize: 15.5), - ), - ), - ], - ), - ), - VerticalDivider( - width: 10.0, - thickness: 1.2, - color: Colors.black, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .procedureStatus), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .status, - style: TextStyle( - fontSize: 17.5, - fontWeight: - FontWeight - .w600), - ), - ), - ], - ), - ), - VerticalDivider( - width: 2.3, - thickness: 1.2, - color: Colors.black, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .usageStatus), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .isInvoicedDesc, - style: TextStyle( - fontWeight: - FontWeight.w600, - fontSize: 17.5), - ), - ), - ], + Text(TranslationBase.of(context).usageStatus), + Padding( + padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), + child: Text( + model.insuranceApproval[index].apporvalDetails?.isInvoicedDesc ?? '', + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 17.5), ), ), ], ), ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), ], ), ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), ], ), - ], - ), - )), + ), + ], + ), + ], + ), + ); + }), ], ), ), @@ -416,6 +315,22 @@ class _InsuranceApprovalState extends State { ); } + Widget sideBadge(String title, int color) { + return Container( + decoration: BoxDecoration( + color: Color(color), + borderRadius: BorderRadius.circular(16.0), + ), + width: 115.0, + padding: EdgeInsets.only(top: 1, bottom: 1), + alignment: Alignment.center, + child: Texts( + title, + color: Colors.white, + ), + ); + } + convertDateFormat(String Date) { const start = "/Date("; const end = "+0300)"; @@ -423,13 +338,8 @@ class _InsuranceApprovalState extends State { final startIndex = Date.indexOf(start); final endIndex = Date.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(Date.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(Date.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + "-" + date.month.toString().padLeft(2, '0') + "-" + date.day.toString().padLeft(2, '0'); return newDate.toString(); } diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 43fdc456..3ad128d4 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -117,8 +117,8 @@ class AuthProvider with ChangeNotifier { var imei = await sharedPref.getString(PUSH_TOKEN); // if (!request.) { newRequest.iMEI = imei; //imei!=null ? imei : ''; - newRequest.firstName = request.firstName + " " + request.lastName; - newRequest.firstNameN = request.firstNameN + " " + request.lastNameN; + newRequest.firstName = request.firstName??"" + " " + request.lastName??""; + newRequest.firstNameN = request.firstNameN??"" + " " + request.lastNameN??""; newRequest.lastNameN = request.lastNameN ?? ""; newRequest.outSA = request.outSA == 1 ? true : false; newRequest.biometricEnabled = false;