diff --git a/android/app/build.gradle b/android/app/build.gradle index e863c41b..fb77f0ae 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -34,23 +34,18 @@ apply plugin: 'com.google.gms.google-services' //apply plugin: 'com.google.firebase.crashlytics' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + configurations.all { - resolutionStrategy { - force 'androidx.core:core-ktx:1.6.0' + c -> c.resolutionStrategy.eachDependency { + DependencyResolveDetails dependency -> + println dependency.requested.group + if (dependency.requested.group == 'org.bouncycastle') { + dependency.useTarget 'org.bouncycastle:bcprov-jdk15to18:1.68' + } } } -//configurations.all { -// c -> c.resolutionStrategy.dependencySubstitution { -// all { DependencySubstitution dependency -> -// if (dependency.requested.group == 'org.bouncycastle') { -// dependency.useTarget 'org.bouncycastle:bcprov-jdk15to18:1.68' -// } -// } -// } -//} - android { compileSdkVersion 34 @@ -113,21 +108,6 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - - - - configurations.all { - c -> c.resolutionStrategy.eachDependency { - DependencyResolveDetails dependency -> - println dependency.requested.group - if (dependency.requested.group == 'org.bouncycastle') { - dependency.useTarget 'org.bouncycastle:bcprov-jdk15to18:1.68' - } - } - } - - - } flutter { diff --git a/lib/config/config.dart b/lib/config/config.dart index f979a291..aeda4284 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,12 +20,12 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; - // var BASE_URL = 'http://10.50.100.198:2018/'; +// var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:4422/'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -77,14 +77,19 @@ var WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; var GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; // Wifi Credentials -var WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; +var WIFI_CREDENTIALS = + "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; ///Doctor -var GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +var GET_MY_DOCTOR = + 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; var GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; -var GET_DOCTOR_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; -var GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; -var GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; +var GET_DOCTOR_PRE_POST_IMAGES = + 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; +var GET_DOCTOR_RATING_NOTES = + 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; +var GET_DOCTOR_RATING_DETAILS = + 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; var GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; @@ -92,31 +97,46 @@ var GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; // var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async'; -var GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -var GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -var SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -var GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +var GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +var GET_PRESCRIPTION_REPORT = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +var SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +var GET_PRESCRIPTION_REPORT_ENH = + 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; ///Lab Order var GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -var GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -var SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +var GET_Patient_LAB_SPECIAL_RESULT = + 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +var SEND_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/SendLabReportEmail'; var GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; -var GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; -var SEND_COVID_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/GenerateCOVIDReport'; -var COVID_PASSPORT_UPDATE = 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; -var GET_PATIENT_PASSPORT_NUMBER = 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport'; - -var UPDATE_WORKPLACE_NAME = 'Services/Patients.svc/REST/ActivateSickLeave_FromVida'; -var GET_SICKLEAVE_STATUS_ADMISSION_NO = 'Services/ChatBot_Service.svc/REST/GetSickLeaveStatusByAdmissionNo'; +var GET_Patient_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +var SEND_COVID_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/GenerateCOVIDReport'; +var COVID_PASSPORT_UPDATE = + 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; +var GET_PATIENT_PASSPORT_NUMBER = + 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport'; + +var UPDATE_WORKPLACE_NAME = + 'Services/Patients.svc/REST/ActivateSickLeave_FromVida'; +var GET_SICKLEAVE_STATUS_ADMISSION_NO = + 'Services/ChatBot_Service.svc/REST/GetSickLeaveStatusByAdmissionNo'; /// var GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -var GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; +var GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = + 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; -var GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; +var GET_PATIENT_ORDERS_DETAILS = + 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; var GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; -var SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; +var SEND_RAD_REPORT_EMAIL = + 'Services/Notifications.svc/REST/SendRadReportEmail'; ///Feedback var SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; @@ -128,28 +148,39 @@ var GET_PATIENT_AppointmentHistory = 'Services' '/Doctors.svc/REST/PateintHasAppoimentHistory_Async'; ///VITAL SIGN -var GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +var GET_PATIENT_VITAL_SIGN = + 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; ///Er Nearest -var GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; +var GET_NEAREST_HOSPITAL = + 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///ED Online -var ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; -var ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; -var ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; +var ER_GET_VISUAL_TRIAGE_QUESTIONS = + "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; +var ER_SAVE_TRIAGE_INFORMATION = + "services/Doctors.svc/REST/ER_SaveTriageInformation"; +var ER_GetPatientPaymentInformationForERClinic = + "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; ///Er Nearest -var GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; -var GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -var GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; +var GET_AMBULANCE_REQUEST = + 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +var GET_PATIENT_ALL_PRES_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +var GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = + 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; var UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; -var INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +var INSERT_ER_INERT_PRES_ORDER = + 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; /// ER RRT var GET_ALL_RC_TRANSPORTATION = 'api/Transportation/getalltransportation'; var GET_ALL_TRANSPORTATIONS_RC = 'api/Transportation/getalltransportation'; -var GET_ALL_RRT_QUESTIONS = 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; -var GET_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; +var GET_ALL_RRT_QUESTIONS = + 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; +var GET_RRT_SERVICE_PRICE = + 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; var GET_ALL_TRANSPORTATIONS_ORDERS = 'api/Transportation/get'; @@ -170,7 +201,8 @@ var GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID'; var GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation -var GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; +var GET_USERINFORMATION_REQUEST = + 'Services/Community.svc/REST/GetUserInformation_New'; ///Update email var UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; @@ -192,26 +224,37 @@ var GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable'; var GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; ///BloodDetails -var GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; +var GET_BLOOD_REQUEST = + 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; -var SAVE_BLOOD_REQUEST = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +var SAVE_BLOOD_REQUEST = + 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; -var GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; -var SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +var GET_BLOOD_AGREEMENT = + 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; +var SAVE_BLOOD_AGREEMENT = + 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; ///Reports var REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; -var INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; -var SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; -var GET_INPATIENT_ADMISSIONS = 'Services/inps.svc/REST/getAdmissionForMedicalReport'; +var INSERT_REQUEST_FOR_MEDICAL_REPORT = + 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; +var SEND_MEDICAL_REPORT_EMAIL = + 'Services/Notifications.svc/REST/SendMedicalReportEmail'; +var GET_INPATIENT_ADMISSIONS = + 'Services/inps.svc/REST/getAdmissionForMedicalReport'; var GET_MEDICAL_REPORT_PDF = 'Services/inps.svc/REST/getMedicalReportPDF'; ///Rate // var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; -var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async'; -var GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; -var NEW_RATE_APPOINTMENT_URL = "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate"; -var NEW_RATE_DOCTOR_URL = "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate"; +var IS_LAST_APPOITMENT_RATED = + 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async'; +var GET_APPOINTMENT_DETAILS_BY_NO = + 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; +var NEW_RATE_APPOINTMENT_URL = + "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate"; +var NEW_RATE_DOCTOR_URL = + "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate"; var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; @@ -219,7 +262,8 @@ var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; var GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; //URL to get active appointment list -var GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; +var GET_ACTIVE_APPOINTMENTS_LIST_URL = + "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; //URL to get projects list var GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; @@ -228,119 +272,165 @@ var GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; var GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; //URL to dental doctors list -var GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; +var GET_DENTAL_DOCTORS_LIST_URL = + "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; //URL to get doctor free slots var GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; //URL to insert appointment -var INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment"; +var INSERT_SPECIFIC_APPOINTMENT = + "Services/Doctors.svc/REST/InsertSpecificAppointment"; //URL to get patient share -var GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; +var GET_PATIENT_SHARE = + "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; //URL to get patient appointment history -var GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; +var GET_PATIENT_APPOINTMENT_HISTORY = + "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; -var GET_OBGYNE_ORDERS_LIST = "services/Patients.svc/REST/HIS_OBGYNEProcedureGet"; +var GET_OBGYNE_ORDERS_LIST = + "services/Patients.svc/REST/HIS_OBGYNEProcedureGet"; -var GET_OBGYNE_DOCTORS_LIST = "services/Doctors.svc/REST/HIS_ObgyneUltrasoundDoctors"; +var GET_OBGYNE_DOCTORS_LIST = + "services/Doctors.svc/REST/HIS_ObgyneUltrasoundDoctors"; -var OBGYNE_PROCEDURE_UPDATE = "services/Patients.svc/REST/HIS_OBGYNEProcedure_Update"; +var OBGYNE_PROCEDURE_UPDATE = + "services/Patients.svc/REST/HIS_OBGYNEProcedure_Update"; -var GET_RRT_PROCEDURE_LIST = "Services/Patients.svc/REST/GetRRTProcedureDetailsListFromVida"; +var GET_RRT_PROCEDURE_LIST = + "Services/Patients.svc/REST/GetRRTProcedureDetailsListFromVida"; -var DOCTOR_SCHEDULE_URL = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +var DOCTOR_SCHEDULE_URL = + 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -var SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; +var SEND_REPORT_EYE_EMAIL = + "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; -var SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; +var SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = + "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; //URL to get patient appointment curfew history // var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; -var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async"; +var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = + "Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async"; //URL to confirm appointment -var CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; +var CONFIRM_APPOINTMENT = + "Services/MobileNotifications.svc/REST/ConfirmAppointment"; -var INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; +var INSERT_VIDA_REQUEST = + "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; //URL to cancel appointment var CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; //URL get appointment QR -var GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; +var GENERATE_QR_APPOINTMENT = + "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; //URL send email appointment QR -var EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; +var EMAIL_QR_APPOINTMENT = + "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; //URL check payment status -var CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; +var CHECK_PAYMENT_STATUS = + "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; //URL create advance payment var CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; -var HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; +var HIS_CREATE_ADVANCE_PAYMENT = + "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; -var ER_CREATE_ADVANCE_PAYMENT = "services/Doctors.svc/REST/ER_CreateAdvancePaymentForClinic"; +var ER_CREATE_ADVANCE_PAYMENT = + "services/Doctors.svc/REST/ER_CreateAdvancePaymentForClinic"; -var ER_INSERT_ADVANCE_PAYMENT = "services/Doctors.svc/REST/ER_InsertEROnlinePaymentDetails"; +var ER_INSERT_ADVANCE_PAYMENT = + "services/Doctors.svc/REST/ER_InsertEROnlinePaymentDetails"; -var ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; +var ADD_ADVANCE_NUMBER_REQUEST = + 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; -var GENERATE_ANCILLARY_ORDERS_INVOICE = 'Services/Doctors.svc/REST/AutoGenerateAncillaryOrderInvoice'; +var GENERATE_ANCILLARY_ORDERS_INVOICE = + 'Services/Doctors.svc/REST/AutoGenerateAncillaryOrderInvoice'; -var IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +var IS_ALLOW_ASK_DOCTOR = + 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; var GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; -var ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; +var ADD_VIDA_REQUEST = + 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; var SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; -var GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; +var GET_LIVECARE_CLINICS = + 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; -var GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; +var GET_LIVECARE_SCHEDULE_CLINICS = + 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; -var GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; +var GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = + 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; -var GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; +var GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = + 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; -var INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; +var INSERT_LIVECARE_SCHEDULE_APPOINTMENT = + 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; -var GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; +var GET_PATIENT_SHARE_LIVECARE = + "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; -var SET_ONLINE_CHECKIN_FOR_APPOINTMENT = "Services/Patients.svc/REST/SetOnlineCheckInForAppointment"; +var SET_ONLINE_CHECKIN_FOR_APPOINTMENT = + "Services/Patients.svc/REST/SetOnlineCheckInForAppointment"; -var GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; +var GET_LIVECARE_CLINIC_TIMING = + 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; -var GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; +var GET_ER_APPOINTMENT_FEES = + 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; var GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; -var ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; +var ADD_NEW_CALL_FOR_PATIENT_ER = + 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; -var GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; -var CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; -var SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; +var GET_LIVECARE_HISTORY = + 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; +var CANCEL_LIVECARE_REQUEST = + 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; +var SEND_LIVECARE_INVOICE_EMAIL = + 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; -var CHANGE_PATIENT_ER_SESSION = 'Services/DoctorApplication.svc/REST/ChangePatientERSession'; +var CHANGE_PATIENT_ER_SESSION = + 'Services/DoctorApplication.svc/REST/ChangePatientERSession'; -var APPLE_PAY_INSERT_REQUEST = 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert'; +var APPLE_PAY_INSERT_REQUEST = + 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert'; var GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; var TAMARA_REQUEST_INSERT = 'Services/PayFort_Serv.svc/REST/AddTamaraRequest'; -var UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; +var UPDATE_HEALTH_TERMS = + 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; -var GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts'; +var GET_PATIENT_HEALTH_STATS = + 'Services/Patients.svc/REST/Med_GetTransactionsSts'; -var SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; +var SEND_CHECK_IN_NFC_REQUEST = + 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; -var HAS_DENTAL_PLAN = 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation'; +var HAS_DENTAL_PLAN = + 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation'; -var LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory'; +var LASER_BODY_PARTS = + 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory'; -var INSERT_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Insert'; -var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Update'; +var INSERT_COVID_QUESTIONNAIRE = + 'Services/Doctors.svc/REST/COVID19_Questionnarie_Insert'; +var UPDATE_COVID_QUESTIONNAIRE = + 'Services/Doctors.svc/REST/COVID19_Questionnarie_Update'; //URL to get medicine and pharmacies list var CHANNEL = 3; @@ -362,19 +452,27 @@ var IS_TEXT_COMPLETED = false; var GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; var GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -var GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; -var GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; +var GET_PAtIENTS_INSURANCE = + "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; +var GET_PAtIENTS_INSURANCE_UPDATED = + "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; var INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; -var INSURANCE_SCHEMES = "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet"; -var UPDATE_MANUAL_INSURANCE = "Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate"; -var INSURANCE_COMPANIES = "Services/Patients.svc/REST/PatientER_InsuranceCompanyGet"; -var GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; -var UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; +var INSURANCE_SCHEMES = + "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet"; +var UPDATE_MANUAL_INSURANCE = + "Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate"; +var INSURANCE_COMPANIES = + "Services/Patients.svc/REST/PatientER_InsuranceCompanyGet"; +var GET_PATIENT_INSURANCE_DETAILS = + "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; +var UPLOAD_INSURANCE_CARD = + 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; var GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; var GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; -var GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_Async"; +var GET_PAtIENTS_INSURANCE_APPROVALS = + "Services/Patients.svc/REST/GetApprovalStatus_Async"; // var GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; var SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; @@ -383,89 +481,132 @@ var GET_VACCINATION_ONHAND = "/Services/ERP.svc/REST/GET_VACCINATION_ONHAND"; var GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; -var GET_PATIENT_SICK_LEAVE_STATUS = 'Services/Patients.svc/REST/GetPatientSickLeave_Status'; +var GET_PATIENT_SICK_LEAVE_STATUS = + 'Services/Patients.svc/REST/GetPatientSickLeave_Status'; var SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; -var GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; -var GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; -var GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; -var SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; -var CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; +var GET_PATIENT_AdVANCE_BALANCE_AMOUNT = + 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +var GET_PATIENT_INFO_BY_ID = + 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +var GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = + 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; +var SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = + 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; +var CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = + 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; -var GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; +var GET_COVID_DRIVETHRU_PROJECT_LIST = + 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; -var GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; +var GET_COVID_DRIVETHRU_PAYMENT_INFO = + 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; -var GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; +var GET_COVID_DRIVETHRU_FREE_SLOTS = + 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; -var GET_COVID_DRIVETHRU_PROCEDURES_LIST = 'Services/Doctors.svc/REST/COVID19_GetTestProcedures'; +var GET_COVID_DRIVETHRU_PROCEDURES_LIST = + 'Services/Doctors.svc/REST/COVID19_GetTestProcedures'; ///Smartwatch Integration Services -var GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; -var INSERT_PATIENT_HEALTH_DATA = 'Services/Patients.svc/REST/Med_InsertTransactions'; +var GET_PATIENT_LAST_RECORD = + 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; +var INSERT_PATIENT_HEALTH_DATA = + 'Services/Patients.svc/REST/Med_InsertTransactions'; ///My Trackers -var GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; +var GET_DIABETIC_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; var GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; var ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; -var GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; -var GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; -var ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; +var GET_BLOOD_PRESSURE_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +var GET_BLOOD_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; +var ADD_BLOOD_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; -var GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; -var GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; -var ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; +var GET_WEIGHT_PRESSURE_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +var GET_WEIGHT_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; +var ADD_WEIGHT_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; -var ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; +var ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = + 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; -var GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; -var GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +var GET_CALL_INFO_HOURS_RESULT = + 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; +var GET_CALL_REQUEST_TYPE_LOV = + 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; var GET_QUESTION_TYPES = 'Services/OUTPs.svc/REST/getQuestionsTypes'; -var UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; - -var SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; -var DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; -var DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; - -var UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult'; -var SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; -var SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; - -var UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; -var DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; +var UPDATE_DIABETIC_RESULT = + 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; + +var SEND_AVERAGE_BLOOD_SUGAR_REPORT = + 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; +var DEACTIVATE_DIABETIC_STATUS = + 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; +var DEACTIVATE_BLOOD_PRESSURES_STATUS = + 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; + +var UPDATE_BLOOD_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult'; +var SEND_AVERAGE_BLOOD_WEIGHT_REPORT = + 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; +var SEND_AVERAGE_BLOOD_PRESSURE_REPORT = + 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; + +var UPDATE_WEIGHT_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; +var DEACTIVATE_WEIGHT_PRESSURE_RESULT = + 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; var GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; var UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; var INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; -var INSERT_APPOINTMENT_QUESTION = 'Services/OUTPs.svc/REST/insertAppointmentQuestion'; -var RATE_DOCTOR_RESPONSE = 'Services/OUTPs.svc/REST/insertAppointmentQuestionRating'; +var INSERT_APPOINTMENT_QUESTION = + 'Services/OUTPs.svc/REST/insertAppointmentQuestion'; +var RATE_DOCTOR_RESPONSE = + 'Services/OUTPs.svc/REST/insertAppointmentQuestionRating'; var GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; // H2O -var H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; -var H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; -var H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; -var H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; -var H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; +var H2O_GET_USER_PROGRESS = + "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; +var H2O_INSERT_USER_ACTIVITY = + "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; +var H2O_GET_USER_DETAIL = + "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; +var H2O_UPDATE_USER_DETAIL = + "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; +var H2O_UNDO_USER_ACTIVITY = + "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; //E_Referral Services -var GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; -var SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; -var CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; +var GET_ALL_RELATIONSHIP_TYPES = + "Services/Patients.svc/REST/GetAllRelationshipTypes"; +var SEND_ACTIVATION_CODE_FOR_E_REFERRAL = + 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; +var CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = + 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; var GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; var CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; var GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; // Encillary Orders -var GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; +var GET_ANCILLARY_ORDERS = + 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; -var GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; +var GET_ANCILLARY_ORDERS_DETAILS = + 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; //Pharmacy wishlist // var GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; @@ -498,13 +639,19 @@ var GET_SHIPPING_OPTIONS = "get_shipping_option/"; var DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; var DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; var ORDER_SHOPPING_CART = "orders"; -var GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; -var GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; -var LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation"; -var LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation"; +var GET_LACUM_ACCOUNT_INFORMATION = + "Services/Patients.svc/REST/GetLakumAccountInformation"; +var GET_LACUM_GROUP_INFORMATION = + "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; +var LACUM_ACCOUNT_ACTIVATE = + "Services/Patients.svc/REST/LakumAccountActivation"; +var LACUM_ACCOUNT_DEACTIVATE = + "Services/Patients.svc/REST/LakumAccountDeactivation"; var CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount"; -var TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; -var LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; +var TRANSFER_YAHALA_LOYALITY_POINTS = + "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; +var LAKUM_GET_USER_TERMS_AND_CONDITIONS = + "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; // var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async'; @@ -514,18 +661,29 @@ var GET_MOST_VIEWED_PRODUCTS = "mostview"; var GET_NEW_PRODUCTS = "newproducts"; // Home Health Care -var HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; -var HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; -var PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; -var GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; -var GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; +var HHC_GET_ALL_SERVICES = + "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; +var HHC_GET_ALL_CMC_SERVICES = + "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; +var PATIENT_ER_UPDATE_PRES_ORDER = + "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; +var GET_ORDER_DETAIL_BY_ID = + "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; +var GET_CMC_ORDER_DETAIL_BY_ID = + "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; var GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; -var PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; -var PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; -var GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -var PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; -var BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; -var ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +var PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = + 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; +var PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = + 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; +var GET_PATIENT_ALL_PRES_ORD = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +var PATIENT_ER_INSERT_PRES_ORDER = + 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +var BLOOD_DONATION_REGISTER_BLOOD_TYPE = + 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +var ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = + 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; // HHC RC SERVICES var HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc"; @@ -569,17 +727,21 @@ var GET_CUSTOMER_INFO = "VerifyCustomer"; //Pharmacy -var GET_PHARMACY_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; +var GET_PHARMACY_CATEGORISE = + 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; var GET_OFFERS_CATEGORISE = 'discountcategories'; var GET_OFFERS_PRODUCTS = 'offerproducts/'; -var GET_CATEGORISE_PARENT = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; +var GET_CATEGORISE_PARENT = + 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; var GET_PARENT_PRODUCTS = 'products?categoryid='; -var GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; +var GET_SUB_CATEGORISE = + 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; var GET_SUB_PRODUCTS = 'products?categoryid='; var GET_FINAL_PRODUCTS = 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; var GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; -var GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; +var GET_DISEASE_BY_CLINIC_ID = + 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; var SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; var TIMER_MIN = 10; @@ -595,80 +757,105 @@ var SCAN_QR_CODE = 'productbysku/'; var FILTERED_PRODUCTS = 'products?categoryids='; -var GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; +var GET_DOCTOR_LIST_CALCULATION = + "Services/Doctors.svc/REST/GetCallculationDoctors"; -var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = "Services/Patients.svc/REST/GetDentalAppointments"; +var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = + "Services/Patients.svc/REST/GetDentalAppointments"; -var GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo"; +var GET_DENTAL_APPOINTMENT_INVOICE = + "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo"; -var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental"; +var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = + "Services/Notifications.svc/REST/SendInvoiceForDental"; -var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamaralive/Home/GetInstallments'; +var GET_TAMARA_PLAN = + 'https://mdlaboratories.com/tamaralive/Home/GetInstallments'; -var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid='; +var GET_TAMARA_PAYMENT_STATUS = + 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid='; -var UPDATE_TAMARA_STATUS = 'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus'; +var UPDATE_TAMARA_STATUS = + 'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus'; -var MARK_APPOINTMENT_TAMARA_STATUS = 'Services/Patients.svc/REST/MarkAppointmentForTamaraPayment_FromVida'; +var MARK_APPOINTMENT_TAMARA_STATUS = + 'Services/Patients.svc/REST/MarkAppointmentForTamaraPayment_FromVida'; -var AUTO_GENERATE_INVOICE_TAMARA = 'Services/PayFort_Serv.svc/REST/Tamara_GetinfoByAppointmentNo_AutoGenerateInvoice'; +var AUTO_GENERATE_INVOICE_TAMARA = + 'Services/PayFort_Serv.svc/REST/Tamara_GetinfoByAppointmentNo_AutoGenerateInvoice'; var GET_ONESIGNAL_VOIP_TOKEN = 'https://onesignal.com/api/v1/players'; -var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCare/SendPaymentStatus'; +var CANCEL_PHARMA_LIVECARE_REQUEST = + 'https://vcallapi.hmg.com/api/PharmaLiveCare/SendPaymentStatus'; -var INSERT_FREE_SLOTS_LOGS = 'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs'; +var INSERT_FREE_SLOTS_LOGS = + 'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs'; var GET_NATIONALITY = 'Services/Lists.svc/REST/GetNationality'; -var PAYFORT_TEST_URL = 'https://sbpaymentservices.payfort.com/FortAPI/paymentApi'; +var PAYFORT_TEST_URL = + 'https://sbpaymentservices.payfort.com/FortAPI/paymentApi'; var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi'; // Check If InPatient API var CHECK_IF_INPATIENT = 'Services/Patients.svc/REST/GetInPatientAdmissionInfo'; -var CHECK_IF_PATIENT_ADMITTED = 'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest'; - - +var CHECK_IF_PATIENT_ADMITTED = + 'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest'; // Get General Instructions API var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions'; // Get Medical Instructions API -var GET_MEDICAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getPatientAdmissionRequest'; +var GET_MEDICAL_INSTRUCTIONS = + 'Services/INPs.svc/REST/getPatientAdmissionRequest'; -var GET_INPATIENT_ADVANCE_PAYMENT_REQUESTS = 'Services/INPs.svc/REST/getInpatientAdvancePendingPayment'; +var GET_INPATIENT_ADVANCE_PAYMENT_REQUESTS = + 'Services/INPs.svc/REST/getInpatientAdvancePendingPayment'; -var GET_INPATIENT_PAID_ADVANCE_PAYMENT = 'Services/INPs.svc/REST/getInpatientAdvanceHistory'; +var GET_INPATIENT_PAID_ADVANCE_PAYMENT = + 'Services/INPs.svc/REST/getInpatientAdvanceHistory'; -var GET_INPATIENT_ADVANCE_PAYMENT_LINK = 'Services/PayFort_Serv.svc/REST/InsertInPatientAdvanceDetails'; +var GET_INPATIENT_ADVANCE_PAYMENT_LINK = + 'Services/PayFort_Serv.svc/REST/InsertInPatientAdvanceDetails'; var INSERT_INPATIENT_ORDER = 'Services/INPs.svc/REST/Inpcp_insertOrder'; -var INPATIENT_DISCHARGE_MEDICATIONS = 'Services/INPs.svc/REST/chekPatientHasDischargeMedicine'; +var INPATIENT_DISCHARGE_MEDICATIONS = + 'Services/INPs.svc/REST/chekPatientHasDischargeMedicine'; -var GET_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/getBirthNotification_bymothermrn'; +var GET_BIRTH_NOTIFICATION = + 'Services/INPs.svc/REST/getBirthNotification_bymothermrn'; var SAVE_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/SaveBirthNotification'; //Meal Plan APIs var GET_ADMITTED_PATIENTS = 'Services/MOP.svc/REST/GetAdmittedPatients'; -var GET_CURRENT_WEEKID_WEEKDAY = 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP'; -var GET_MEALS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetMealsOfScheduleID_Mobile'; -var GET_MEAL_ITEMS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetDefaultItemsOfScheduleID'; +var GET_CURRENT_WEEKID_WEEKDAY = + 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP'; +var GET_MEALS_OF_SCHEDULE_ID = + 'Services/MOP.svc/REST/GetMealsOfScheduleID_Mobile'; +var GET_MEAL_ITEMS_OF_SCHEDULE_ID = + 'Services/MOP.svc/REST/GetDefaultItemsOfScheduleID'; var PLACE_MEAL_PLAN_ORDER = 'Services/MOP.svc/REST/UpdateOrMakeNewOrder'; -var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; -var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; +var CHECK_PATIENT_NPHIES_ELIGIBILITY = + 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; +var CONVERT_PATIENT_TO_CASH = + 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; //PAYFORT -var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; +var getPayFortProjectDetails = + "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; // var payFortEnvironment = FortEnvironment.production; // var applePayMerchantId = "merchant.com.hmgwebservices"; var payFortEnvironment = FortEnvironment.test; var applePayMerchantId = "merchant.com.hmgwebservices.uat"; +bool apiStatus = false; + class AppGlobal { static var context; diff --git a/lib/core/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart index e909bbda..6c17a750 100644 --- a/lib/core/service/AlHabibMedicalService/H2O_service.dart +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; class H2OService extends BaseService { List userProgressForTodayDataList = []; - List userProgressForWeekDataList =[]; + List userProgressForWeekDataList = []; List userProgressForMonthDataList = []; UserProgressRequestModel userProgressRequestModel = UserProgressRequestModel(); @@ -23,7 +23,11 @@ class H2OService extends BaseService { hasError = false; await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) { - userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]); + if (response["UserDetailData_New"] != null) { + userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]); + } else { + userDetailModel = UserDetailModel(); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index c94abaf6..4def8cb1 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -28,7 +28,8 @@ class CMCService extends BaseService { hasError = false; // RC IMPLEMENTATION - await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + authenticatedUserObject.user.patientID.toString(), isRCService: true, isAllowAny: true, + onSuccess: (dynamic response, int statusCode) { cmcAllServicesList.clear(); response['response'].forEach((data) { cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); diff --git a/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart b/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart index ee3cf458..336a632d 100644 --- a/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart +++ b/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart @@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_lis import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:flutter/cupertino.dart'; +import '../../../../uitl/app_toast.dart'; + class BariatricsService extends BaseService { List clinicCategoryList = []; List diseasesList = []; @@ -127,6 +129,7 @@ class BariatricsService extends BaseService { await baseAppClient.post(GET_DOCTOR_LIST_CALCULATION, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); hasError = true; super.error = error; }, body: body); diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 027978a0..2583a776 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -30,7 +30,8 @@ AppSharedPreferences sharedPref = new AppSharedPreferences(); /// onFailure: (String error, int statusCode) {}, /// body: Map(); /// -AuthenticatedUserObject authenticatedUserObject = locator(); +AuthenticatedUserObject authenticatedUserObject = + locator(); VitalSignService _vitalSignService = locator(); class BaseAppClient { @@ -54,12 +55,17 @@ class BaseAppClient { url = BASE_URL + endPoint; } try { - String? pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); + String? pharmacyToken = + await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var user = await sharedPref.getObject(USER_PROFILE); - Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; + Map headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }; if (!isExternal) { String? token = await sharedPref.getString(TOKEN); - String? languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + String? languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); if (endPoint == SEND_ACTIVATION_CODE) { languageID = 'en'; } @@ -74,21 +80,29 @@ class BaseAppClient { body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; - if (body.containsKey('LanguageID')) { - if (body['LanguageID'] != null) { - //change this line because language issue happened on dental - body['LanguageID'] = body['LanguageID'] == 'ar' - ? 1 - : body['LanguageID'] == 'en' - ? 2 - : body['LanguageID']; - } else { - body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; - } + // if (body.containsKey('LanguageID')) { + if (body['LanguageID'] != null) { + //change this line because language issue happened on dental + body['LanguageID'] = body['LanguageID'] == 'ar' + ? 1 + : body['LanguageID'] == 'en' + ? 2 + : body['LanguageID']; } else { - // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); - body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; + body['LanguageID'] = + Provider.of(AppGlobal.context, listen: false) + .isArabic + ? 1 + : 2; } + // } else { + // // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); + // body['LanguageID'] = + // Provider.of(AppGlobal.context, listen: false) + // .isArabic + // ? 1 + // : 2; + // } // body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; @@ -103,11 +117,12 @@ class BaseAppClient { body['Longitude'] = long; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isIOS @@ -151,14 +166,17 @@ class BaseAppClient { if (user != null) { body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token; - body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; + body['PatientID'] = body['PatientID'] != null + ? body['PatientID'] + : user['PatientID']; body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null ? body['PatientOutSA'] : user['OutSA'] : user['OutSA']; - body['SessionID'] = getSessionId(body['TokenID'] != null ? body['TokenID'] : ""); //getSe + body['SessionID'] = getSessionId( + body['TokenID'] != null ? body['TokenID'] : ""); //getSe // body['SessionID'] = body['TokenID']; //getSe // headers = { @@ -190,12 +208,15 @@ class BaseAppClient { print(jsonBody); // } - if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { - final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); + if (await Utils.checkConnection( + bypassConnectionCheck: bypassConnectionCheck)) { + final response = await http.post(Uri.parse(url.trim()), + body: json.encode(body), headers: headers); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure('Error While Fetching data', statusCode); - logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); + logApiEndpointError( + endPoint, 'Error While Fetching data', statusCode); } else { // var decoded = utf8.decode(response.bodyBytes); var parsed = json.decode(utf8.decode(response.bodyBytes)); @@ -209,8 +230,12 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + navigateToAppUpdate( + AppGlobal.context, parsed['ErrorEndUserMessage']); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } if (parsed['ErrorType'] == 2) { await logout(); @@ -229,28 +254,46 @@ class BaseAppClient { // if (parsed != null) { // onSuccess(parsed, statusCode); // } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); // logout(); // } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", statusCode); - logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); + onFailure("Server Error found with no available message", + statusCode); + logApiEndpointError( + endPoint, + "Server Error found with no available message", + statusCode); } else { onFailure(parsed['ErrorSearchMsg'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode); + logApiEndpointError( + endPoint, parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); + onFailure( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); + logApiEndpointError(endPoint, + parsed['message'] ?? parsed['message'], statusCode); } } } @@ -262,11 +305,18 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure(parsed['message'] ?? parsed['message'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); + onFailure( + parsed['message'] ?? parsed['message'], statusCode); + logApiEndpointError(endPoint, + parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -275,17 +325,23 @@ class BaseAppClient { } } else { onFailure('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } catch (e) { print(e); onFailure(e.toString(), -1); - _analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url"); + _analytics.errorTracking + .log(endPoint, error: "api exception: $e - API Path: $url"); } } postPharmacy(String endPoint, - {Map? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async { + {Map? body, + Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, + bool isAllowAny = false, + bool isExternal = false}) async { var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var user = await sharedPref.getObject(USER_PROFILE); String url; @@ -302,13 +358,16 @@ class BaseAppClient { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': pharmacyToken ?? '', - 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", + 'Mobilenumber': user != null + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", }; if (!isExternal) { String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); // if (body.containsKey('SetupID')) { // body['SetupID'] = body.containsKey('SetupID') @@ -370,12 +429,14 @@ class BaseAppClient { print("Headers : ${json.encode(headers)}"); if (await Utils.checkConnection()) { - final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); + final response = await http.post(Uri.parse(url.trim()), + body: json.encode(body), headers: headers); final int statusCode = response.statusCode; // print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure!('Error While Fetching data', statusCode); - logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); + logApiEndpointError( + endPoint, 'Error While Fetching data', statusCode); } else { // var parsed = json.decode(response.body.toString()); var parsed = json.decode(utf8.decode(response.bodyBytes)); @@ -383,8 +444,12 @@ class BaseAppClient { onSuccess!(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + navigateToAppUpdate( + AppGlobal.context, parsed['ErrorEndUserMessage']); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } if (isAllowAny) { onSuccess!(parsed, statusCode); @@ -399,29 +464,56 @@ class BaseAppClient { if (parsed != null) { onSuccess!(parsed, statusCode); } else { - onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, 'session logged out', statusCode); + onFailure!( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, 'session logged out', statusCode); logout(); } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess!(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess!(parsed, statusCode); } else { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure!("Server Error found with no available message", statusCode); - logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); + onFailure!("Server Error found with no available message", + statusCode); + logApiEndpointError( + endPoint, + "Server Error found with no available message", + statusCode); } else { onFailure!(parsed['ErrorSearchMsg'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorSearchMsg'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorSearchMsg'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } } else { - onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } } } else if (!parsed['IsAuthenticated']) { @@ -433,11 +525,22 @@ class BaseAppClient { onSuccess!(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure!(parsed['message'] ?? parsed['message'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['message'] ?? parsed['message'], statusCode); + logApiEndpointError( + endPoint, + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } else { - onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -445,7 +548,8 @@ class BaseAppClient { } } else { onFailure!('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } catch (e) { print(e); @@ -457,7 +561,8 @@ class BaseAppClient { Future navigateToAppUpdate(context, String text) async { Navigator.pushAndRemoveUntil( context, - MaterialPageRoute(builder: (context) => AppUpdatePage(appUpdateText: text)), + MaterialPageRoute( + builder: (context) => AppUpdatePage(appUpdateText: text)), (Route route) => false, ); } @@ -488,7 +593,10 @@ class BaseAppClient { if (await Utils.checkConnection()) { final response = await http.get( Uri.parse(url.trim()), - headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}, + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }, ); final int statusCode = response.statusCode; // print("statusCode :$statusCode"); @@ -502,7 +610,8 @@ class BaseAppClient { } } else { onFailure!('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } @@ -534,7 +643,9 @@ class BaseAppClient { 'Content-Type': 'text/html; charset=utf-8', 'Accept': 'application/json', 'Authorization': token ?? '', - 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", + 'Mobilenumber': user != null + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", // 'Host': "mdlaboratories.com", @@ -544,14 +655,19 @@ class BaseAppClient { if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode == 401) { - onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); - logApiEndpointError(endPoint, TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); + onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin, + statusCode); + logApiEndpointError( + endPoint, + TranslationBase.of(AppGlobal.context).pharmacyRelogin, + statusCode); Navigator.of(AppGlobal.context).pushNamed(HOME); } else { var bodyUtf = json.decode(utf8.decode(response.bodyBytes)); // print(bodyUtf); onFailure!(bodyUtf['error']['ErrorEndUserMsg'], statusCode); - logApiEndpointError(endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode); + logApiEndpointError( + endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode); } } else { // var parsed = json.decode(response.body.toString()); @@ -560,7 +676,8 @@ class BaseAppClient { } } else { onFailure!('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } @@ -576,7 +693,8 @@ class BaseAppClient { // print("body: $body"); if (await Utils.checkConnection()) { - headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); + headers!.addAll( + {'Content-Type': 'application/json', 'Accept': 'application/json'}); final response = await http.post( Uri.parse(url.trim()), body: json.encode(body), @@ -584,7 +702,12 @@ class BaseAppClient { ); final int statusCode = response.statusCode; // print("statusCode :$statusCode"); - if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers); + if (await handleUnauthorized(statusCode, forUrl: fullUrl)) + simplePost(fullUrl, + onFailure: onFailure, + onSuccess: onSuccess, + body: body, + headers: headers); // print(response.body.toString()); @@ -596,12 +719,16 @@ class BaseAppClient { } } else { onFailure!('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } simpleGet(String fullUrl, - {Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map? queryParams, Map? headers}) async { + {Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, + Map? queryParams, + Map? headers}) async { headers = headers ?? {}; String url = fullUrl; @@ -613,7 +740,8 @@ class BaseAppClient { } if (await Utils.checkConnection()) { - headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); + headers.addAll( + {'Content-Type': 'application/json', 'Accept': 'application/json'}); final response = await http.get( Uri.parse(url.trim()), headers: headers, @@ -621,7 +749,12 @@ class BaseAppClient { final int statusCode = response.statusCode; // print("statusCode :$statusCode"); - if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleGet(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, queryParams: queryParams); + if (await handleUnauthorized(statusCode, forUrl: fullUrl)) + simpleGet(fullUrl, + onFailure: onFailure, + onSuccess: onSuccess, + headers: headers, + queryParams: queryParams); if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure!('Error While Fetching data', statusCode); @@ -631,17 +764,22 @@ class BaseAppClient { } } else { onFailure!('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } simplePut(String fullUrl, - {Map? body, Map? headers, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async { + {Map? body, + Map? headers, + Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure}) async { String url = fullUrl; // print("URL Query String: $url"); if (await Utils.checkConnection()) { - headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); + headers!.addAll( + {'Content-Type': 'application/json', 'Accept': 'application/json'}); final response = await http.put( Uri.parse(url.trim()), body: json.encode(body), @@ -650,7 +788,12 @@ class BaseAppClient { final int statusCode = response.statusCode; // print("statusCode :$statusCode"); - if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePut(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, body: body); + if (await handleUnauthorized(statusCode, forUrl: fullUrl)) + simplePut(fullUrl, + onFailure: onFailure, + onSuccess: onSuccess, + headers: headers, + body: body); if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure!('Error While Fetching data', statusCode); @@ -660,12 +803,16 @@ class BaseAppClient { } } else { onFailure!('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } simpleDelete(String fullUrl, - {Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map? queryParams, Map? headers}) async { + {Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, + Map? queryParams, + Map? headers}) async { String url = fullUrl; // print("URL Query String: $url"); @@ -677,7 +824,8 @@ class BaseAppClient { } if (await Utils.checkConnection()) { - headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); + headers!.addAll( + {'Content-Type': 'application/json', 'Accept': 'application/json'}); final response = await http.delete( Uri.parse(url.trim()), headers: headers, @@ -685,7 +833,12 @@ class BaseAppClient { final int statusCode = response.statusCode; // print("statusCode :$statusCode"); - if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleDelete(fullUrl, onFailure: onFailure, onSuccess: onSuccess, queryParams: queryParams, headers: headers); + if (await handleUnauthorized(statusCode, forUrl: fullUrl)) + simpleDelete(fullUrl, + onFailure: onFailure, + onSuccess: onSuccess, + queryParams: queryParams, + headers: headers); if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure!('Error While Fetching data', statusCode); @@ -695,11 +848,13 @@ class BaseAppClient { } } else { onFailure!('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } - Future handleUnauthorized(int statusCode, {required String forUrl}) async { + Future handleUnauthorized(int statusCode, + {required String forUrl}) async { if (forUrl.startsWith(EXA_CART_API_BASE_URL) && statusCode == 401) { final token = await generatePackagesToken(); packagesAuthHeader['Authorization'] = 'Bearer $token'; @@ -712,8 +867,10 @@ class BaseAppClient { await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(PHARMACY_CUSTOMER_ID); await authenticatedUserObject.getUser(); - Provider.of(AppGlobal.context, listen: false).isLogin = false; - var model = Provider.of(AppGlobal.context, listen: false); + Provider.of(AppGlobal.context, listen: false).isLogin = + false; + var model = + Provider.of(AppGlobal.context, listen: false); _vitalSignService.weightKg = ""; _vitalSignService.heightCm = ""; model.setState(0, 0, false, null); @@ -728,7 +885,8 @@ class BaseAppClient { static defaultHttpParameters() async { String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var user = await sharedPref.getObject(USER_PROFILE); var params = {}; if (user != null) { @@ -748,7 +906,11 @@ class BaseAppClient { } pharmacyPost(String endPoint, - {Map? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async { + {Map? body, + Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, + bool isAllowAny = false, + bool isExternal = false}) async { var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var user = await sharedPref.getObject(USER_PROFILE); String url; @@ -760,7 +922,8 @@ class BaseAppClient { try { if (isExternal) { String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var user = await sharedPref.getObject(USER_PROFILE); if (body!.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') @@ -783,11 +946,12 @@ class BaseAppClient { : user['OutSA']; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; @@ -810,7 +974,9 @@ class BaseAppClient { : user['PatientType']; if (user != null) { body['TokenID'] = token; - body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; + body['PatientID'] = body['PatientID'] != null + ? body['PatientID'] + : user['PatientID']; body['PatientOutSA'] = user['OutSA']; // body['SessionID'] = SESSION_ID; //getSessionId(token); } @@ -822,11 +988,14 @@ class BaseAppClient { var ss = json.encode(body); if (await Utils.checkConnection()) { - final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: { + final response = await http + .post(Uri.parse(url.trim()), body: json.encode(body), headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': token ?? '', - 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", + 'Mobilenumber': user != null + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", }); @@ -834,8 +1003,15 @@ class BaseAppClient { // print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { var parsed = json.decode(utf8.decode(response.bodyBytes)); - onFailure!(parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); - logApiEndpointError(endPoint, parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); + onFailure!( + parsed['error']['ErrorEndUserMsgN'] ?? + 'Error While Fetching data', + statusCode); + logApiEndpointError( + endPoint, + parsed['error']['ErrorEndUserMsgN'] ?? + 'Error While Fetching data', + statusCode); } else { // var parsed = json.decode(response.body.toString()); var parsed = json.decode(utf8.decode(response.bodyBytes)); @@ -843,7 +1019,8 @@ class BaseAppClient { onSuccess!(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); + navigateToAppUpdate( + AppGlobal.context, parsed['ErrorEndUserMessage']); } if (isAllowAny) { onSuccess!(parsed, statusCode); @@ -858,25 +1035,47 @@ class BaseAppClient { if (parsed != null) { onSuccess!(parsed, statusCode); } else { - onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); logout(); } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess!(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure!("Server Error found with no available message", statusCode); - logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); + onFailure!("Server Error found with no available message", + statusCode); + logApiEndpointError( + endPoint, + "Server Error found with no available message", + statusCode); } else { onFailure!(parsed['ErrorSearchMsg'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode); + logApiEndpointError( + endPoint, parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } } else if (!parsed['IsAuthenticated']) { await logout(); @@ -887,11 +1086,18 @@ class BaseAppClient { onSuccess!(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure!(parsed['message'] ?? parsed['message'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); + onFailure!( + parsed['message'] ?? parsed['message'], statusCode); + logApiEndpointError(endPoint, + parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -899,7 +1105,8 @@ class BaseAppClient { } } else { onFailure!('Please Check The Internet Connection', -1); - _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); + _analytics.errorTracking + .log("internet_connectivity", error: "no internet available"); } } catch (e) { print(e); @@ -911,11 +1118,15 @@ class BaseAppClient { Future generatePackagesToken() async { var url = EXA_CART_API_BASE_URL + PACKAGES_TOKEN; var body = { - "api_client": {"client_id": "a4ab6be4-424f-4836-b032-46caed88e184", "client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c"} + "api_client": { + "client_id": "a4ab6be4-424f-4836-b032-46caed88e184", + "client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c" + } }; String? token; final completer = Completer(); - simplePost(url, body: body, headers: {}, onSuccess: (dynamic stringResponse, int statusCode) { + simplePost(url, body: body, headers: {}, + onSuccess: (dynamic stringResponse, int statusCode) { if (statusCode == 200) { var jsonResponse = json.decode(stringResponse); token = jsonResponse['auth_token']; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index dae2b1c6..fa67438d 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -102,11 +102,14 @@ class LabsViewModel extends BaseViewModel { List patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); if (patientLabOrdersClinic.length != 0) { - var value = labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList! - .where((e) => e.sampleCollectedOn == element.sampleCollectedOn && e.resultValue == element.resultValue) - .toList(); - if (value.isEmpty) labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList!.add(element); + // var value = labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + // .patientLabResultList! + // .where((e) { + // return e.sampleCollectedOn == element.sampleCollectedOn && e.resultValue == element.resultValue; + // }) + // .toList(); + // if (value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList!.add(element); } else { labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); } diff --git a/lib/models/Authentication/select_device_imei_res.dart b/lib/models/Authentication/select_device_imei_res.dart index 4b6ae33e..979dfca1 100644 --- a/lib/models/Authentication/select_device_imei_res.dart +++ b/lib/models/Authentication/select_device_imei_res.dart @@ -32,13 +32,13 @@ class SelectDeviceIMEIRES { SelectDeviceIMEIRES.fromJson(Map json) { biometricEnabled = json['BiometricEnabled']; - createdOn = json['CreatedOn']; - editedOn = json['EditedOn']; + createdOn = json['CreatedOn'].toString(); + editedOn = json['EditedOn'].toString(); iD = json['ID']; iMEI = json['IMEI']; - identificationNo = json['IdentificationNo']; + identificationNo = json['IdentificationNo'].toString(); logInType = json['LogInType']; - mobile = json['Mobile']; + mobile = json['Mobile'].toString(); name = json['Name']; nameN = json['NameN']; outSA = json['OutSA']; @@ -65,4 +65,9 @@ class SelectDeviceIMEIRES { data['PreferredLanguage'] = this.preferredLanguage; return data; } + + @override + String toString() { + return 'SelectDeviceIMEIRES{biometricEnabled: $biometricEnabled, createdOn: $createdOn, editedOn: $editedOn, iD: $iD, iMEI: $iMEI, identificationNo: $identificationNo, logInType: $logInType, mobile: $mobile, name: $name, nameN: $nameN, outSA: $outSA, patientID: $patientID, patientType: $patientType, preferredLanguage: $preferredLanguage}'; + } } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 15d4e8cb..c9a06485 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -6,15 +6,12 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart'; import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart'; -import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; -import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; @@ -34,7 +31,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class AnicllaryOrdersDetails extends StatefulWidget { final dynamic appoNo; @@ -51,7 +47,7 @@ class _AnicllaryOrdersState extends State with SingleTic late ProjectViewModel projectViewModel; bool _agreeTerms = false; String selectedPaymentMethod = ""; - MyInAppBrowser? browser; + late MyInAppBrowser browser; String transID = ""; late BuildContext localContext; String? selectedInstallmentPlan; @@ -483,7 +479,6 @@ class _AnicllaryOrdersState extends State with SingleTic return total.toStringAsFixed(2); } - bool checkIfProcedureSelected(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { if (selectedProcList.length > 0) { if (selectedProcList.contains(ancillaryOrderProcDetailsList)) { @@ -495,6 +490,7 @@ class _AnicllaryOrdersState extends State with SingleTic return false; } } + bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { if ((ancillaryOrderProcDetailsList.isApprovalRequired! && !ancillaryOrderProcDetailsList.isApprovalCreated!) || (ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0) || @@ -504,6 +500,7 @@ class _AnicllaryOrdersState extends State with SingleTic return false; } } + addToSelectedProcedures() { if (_ancillaryProcLists.isNotEmpty) { selectedProcList.clear(); @@ -594,10 +591,10 @@ class _AnicllaryOrdersState extends State with SingleTic if (projectViewModel.havePrivilege(103)) { startApplePay(); } else { - openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); + openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan); } } else { - openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); + openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan); } }, patientShare: double.parse(getTotalValue()), @@ -693,7 +690,7 @@ class _AnicllaryOrdersState extends State with SingleTic browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!); - browser!.openPaymentBrowser( + browser.openPaymentBrowser( amount, "Ancillary Orders Payment", transID, @@ -704,7 +701,7 @@ class _AnicllaryOrdersState extends State with SingleTic projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.patientID, authenticatedUser, - browser!, + browser, false, "3", // Need to get new Service ID from Ayman for Ancillary Tamara @@ -735,7 +732,7 @@ class _AnicllaryOrdersState extends State with SingleTic MyInAppBrowser.successURLS.forEach((element) { if (url.contains(element)) { - if (browser!.isOpened()) browser!.close(); + if (browser.isOpened()) browser.close(); MyInAppBrowser.isPaymentDone = true; return; } @@ -743,7 +740,7 @@ class _AnicllaryOrdersState extends State with SingleTic MyInAppBrowser.errorURLS.forEach((element) { if (url.contains(element)) { - if (browser!.isOpened()) browser!.close(); + if (browser.isOpened()) browser.close(); MyInAppBrowser.isPaymentDone = false; return; } @@ -860,7 +857,7 @@ class _AnicllaryOrdersState extends State with SingleTic GifLoaderDialogUtils.showMyDialog(localContext); DoctorsListService service = new DoctorsListService(); - service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, localContext).then((res) { + service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, projectViewModel.isArabic ? 1 : 2, localContext).then((res) { GifLoaderDialogUtils.hideDialog(localContext); showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo'], widget.projectID); }).catchError((err) { @@ -881,8 +878,4 @@ class _AnicllaryOrdersState extends State with SingleTic Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); }).showAlertDialog(context); } - - - - } diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index bd6267f0..8e3495c1 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -61,11 +61,11 @@ class _H2oSettingState extends State { _weightValue = _userDetailModel?.weight ?? 50; _heightController.text = _heightValue.toStringAsFixed(0); _weightController.text = _weightValue.toStringAsFixed(0); - _nameController.text = _userDetailModel.firstName!; + _nameController.text = _userDetailModel.firstName ?? ""; _isWeightKG = _userDetailModel?.isWeightInKG ?? true; _isHeightCM = _userDetailModel?.isHeightInCM ?? true; _isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false; - _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB!); + _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB ?? DateUtil.convertDateToString(DateTime.now())); _selectedActiveLevel = _userDetailModel.activityID ?? 1; readPrefs(); } diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart index 98c0b1b5..6916299c 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -72,9 +72,9 @@ class _CalorieCalculatorState extends State { } void calculateCalories() { - if (isMale == true) { + if (isMale == true && int.parse(ageController.text) <121) { calories = 66.5 + (13.75 * int.parse(_weightController.text)) + (5.003 * int.parse(_heightController.text)) - (6.755 * int.parse(ageController.text)); - } else if (isMale == false) { + } else if (isMale == false && int.parse(ageController.text) <121) { calories = 655.0955 + (9.5634 * int.parse(_weightController.text)) + (1.850 * int.parse(_heightController.text)) - (4.676 * int.parse(ageController.text)); } } @@ -344,11 +344,13 @@ class _CalorieCalculatorState extends State { color: Colors.white, child: SecondaryButton( label: TranslationBase.of(context).calculate, - color: CustomColors.accentColor, + color: ageController.text.isNotEmpty ? int.parse(ageController.text) >120 ? Colors.grey : CustomColors.accentColor : CustomColors.accentColor, onTap: () { + if(ageController.text.isNotEmpty && int.parse(ageController.text) <121 && int.parse(_heightController.text)<250 && int.parse(_weightController.text) <200) setState(() { + calculateCalories(); - print(calories); + { Navigator.push( context, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart index aa67a41a..ac67f1d8 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart @@ -13,6 +13,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; +import '../../../../uitl/app_toast.dart'; + class CalorieResultPage extends StatelessWidget { final double calorie; @@ -118,8 +120,8 @@ class CalorieResultPage extends StatelessWidget { service.getCalculationDoctors(calculationID: 2).then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res['List_CalculationTable'].length); - if (res['MessageStatus'] == 1) { + + if (res!=null && res['MessageStatus'] == 1) { if (res['List_CalculationTable'].length != 0) { res['List_CalculationTable'].forEach((item) { DoctorList docList = new DoctorList(); @@ -157,7 +159,8 @@ class CalorieResultPage extends StatelessWidget { } } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); + + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index c33c345e..80df166e 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -31,7 +31,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:provider/provider.dart'; import '../../config/shared_pref_kay.dart'; @@ -42,7 +41,7 @@ class BookSuccess extends StatefulWidget { DoctorList docObject; late MyInAppBrowser browser; - final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); + // final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); String appoDateFormatted; String appoTimeFormatted; @@ -70,9 +69,7 @@ class _BookSuccessState extends State { initState() { WidgetsBinding.instance.addPostFrameCallback((_) async { if (widget.patientShareResponse.isLiveCareAppointment! && - (widget.patientShareResponse.patientShareWithTax.toString() == "0" || - widget.patientShareResponse.patientShareWithTax.toString() == - "0.0")) { + (widget.patientShareResponse.patientShareWithTax.toString() == "0" || widget.patientShareResponse.patientShareWithTax.toString() == "0.0")) { setOnlineCheckInForAppointment(); } }); @@ -116,26 +113,18 @@ class _BookSuccessState extends State { alignment: Alignment.center, color: CustomColors.green, child: Table( - border: TableBorder(verticalInside: BorderSide( - width: 0.5, color: Colors.white)), + border: TableBorder(verticalInside: BorderSide(width: 0.5, color: Colors.white)), children: [ TableRow( children: [ - TableCell(child: _getNormalText(TranslationBase - .of(context) - .patientShare)), - TableCell(child: _getNormalText(TranslationBase - .of(context) - .patientShareWithTax)), + TableCell(child: _getNormalText(TranslationBase.of(context).patientShare)), + TableCell(child: _getNormalText(TranslationBase.of(context).patientShareWithTax)), ], ), TableRow( children: [ - TableCell(child: _getHeadingText("SR " + - widget.patientShareResponse.patientShare.toString())), - TableCell(child: _getHeadingText("SR " + - widget.patientShareResponse.patientShareWithTax - .toString())), + TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShare.toString())), + TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShareWithTax.toString())), ], ), ], @@ -178,10 +167,7 @@ class _BookSuccessState extends State { return Container( alignment: Alignment.bottomCenter, margin: EdgeInsets.all(14), - height: MediaQuery - .of(context) - .size - .height * 0.18, + height: MediaQuery.of(context).size.height * 0.18, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -193,10 +179,7 @@ class _BookSuccessState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: MediaQuery - .of(context) - .size - .width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: CustomTextButton( backgroundColor: CustomColors.green, @@ -205,10 +188,7 @@ class _BookSuccessState extends State { GifLoaderDialogUtils.showMyDialog(context); getAppoQR(context); }, - child: Text(TranslationBase - .of(context) - .checkinOptions, - style: TextStyle(fontSize: 18.0, color: Colors.white)), + child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)), ), ), ), @@ -219,10 +199,7 @@ class _BookSuccessState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: MediaQuery - .of(context) - .size - .width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: CustomTextButton( backgroundColor: Color(0xffc5272d), @@ -232,10 +209,7 @@ class _BookSuccessState extends State { // GifLoaderDialogUtils.showMyDialog(context); // getAppoQR(context); }, - child: Text(TranslationBase - .of(context) - .done, - style: TextStyle(fontSize: 18.0, color: Colors.white)), + child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)), ), ), ), @@ -270,16 +244,9 @@ class _BookSuccessState extends State { elevation: 0, onPressed: () { startPaymentProcess(); - projectViewModel.analytics.appointment - .pay_now_for_appointment( - appointment_type: 'regular', - doctorDetail: widget.docObject, - payNow: true); + projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true); }, - child: Text(TranslationBase - .of(context) - .payNow - .toUpperCase(), + child: Text(TranslationBase.of(context).payNow.toUpperCase(), style: TextStyle( fontSize: 18.0, color: Colors.white, @@ -300,17 +267,9 @@ class _BookSuccessState extends State { elevation: 0, onPressed: () { navigateToHome(context); - projectViewModel.analytics.appointment - .pay_now_for_appointment( - appointment_type: 'regular', - doctorDetail: widget.docObject, - payNow: false); + projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false); }, - child: Text(TranslationBase - .of(context) - .payLater - .toUpperCase(), style: TextStyle( - fontSize: 18.0, color: Colors.white)), + child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), ), ), ), @@ -318,37 +277,33 @@ class _BookSuccessState extends State { ), widget.isCash ? Column( - children: [ - mHeight(10.0), - Text( - TranslationBase - .of(context) - .cashAmountUpdateInsurance, - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - ), - ), - mHeight(5.0), - DefaultButton( - TranslationBase - .of(context) - .updateInsuranceText, - () { - Navigator.pop(context, null); - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute(builder: (context) => LandingPage()), - (Route route) => false, - ); - Navigator.push(context, FadePage(page: InsuranceUpdate())); - }, - color: Color(0xffEAA118), - textColor: Colors.white, - ), - ], - ) + children: [ + mHeight(10.0), + Text( + TranslationBase.of(context).cashAmountUpdateInsurance, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + ), + ), + mHeight(5.0), + DefaultButton( + TranslationBase.of(context).updateInsuranceText, + () { + Navigator.pop(context, null); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + color: Color(0xffEAA118), + textColor: Colors.white, + ), + ], + ) : Container(), ], ), @@ -380,23 +335,17 @@ class _BookSuccessState extends State { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; - appo.appointmentNo = - widget.patientShareResponse.appointmentNo; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; - appo.appointmentDate = - widget.patientShareResponse.appointmentDate; + appo.appointmentDate = widget.patientShareResponse.appointmentDate; if (appo.isLiveCareAppointment!) insertLiveCareVIDARequest(appo); else navigateToHome(context); }, - child: Text(TranslationBase - .of(context) - .confirmLater, - style: TextStyle(fontSize: 16.0, color: Colors.white)), + child: Text(TranslationBase.of(context).confirmLater, style: TextStyle(fontSize: 16.0, color: Colors.white)), ), ), ), @@ -415,11 +364,9 @@ class _BookSuccessState extends State { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; - appo.appointmentNo = - widget.patientShareResponse.appointmentNo; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; if (appo.isLiveCareAppointment!) { navigateToHome(context); @@ -427,13 +374,7 @@ class _BookSuccessState extends State { confirmAppointment(appo); } }, - child: Text(widget.patientShareResponse.isLiveCareAppointment! - ? TranslationBase - .of(context) - .confirmLiveCare - : TranslationBase - .of(context) - .confirm, + child: Text(widget.patientShareResponse.isLiveCareAppointment! ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm, style: TextStyle(fontSize: 16.0, color: Colors.white)), ), ), @@ -503,10 +444,7 @@ class _BookSuccessState extends State { Container( margin: EdgeInsets.only(top: 30.0, bottom: 40.0), alignment: Alignment.center, - child: Text(TranslationBase - .of(context) - .confirmAppo, - style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), + child: Text(TranslationBase.of(context).confirmAppo, style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), ), Flex( direction: Axis.horizontal, @@ -520,14 +458,8 @@ class _BookSuccessState extends State { children: [ _getBulletPoint("1"), Container( - width: MediaQuery - .of(context) - .size - .width * 0.8, - child: Text(TranslationBase - .of(context) - .upcomingConfirm, overflow: TextOverflow.clip, - style: TextStyle(fontSize: 13.0)), + width: MediaQuery.of(context).size.width * 0.8, + child: Text(TranslationBase.of(context).upcomingConfirm, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), ], ), @@ -547,14 +479,8 @@ class _BookSuccessState extends State { children: [ _getBulletPoint("2"), Container( - width: MediaQuery - .of(context) - .size - .width * 0.8, - child: Text(TranslationBase - .of(context) - .upcomingConfirmMore, overflow: TextOverflow.clip, - style: TextStyle(fontSize: 13.0)), + width: MediaQuery.of(context).size.width * 0.8, + child: Text(TranslationBase.of(context).upcomingConfirmMore, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), ], ), @@ -562,8 +488,7 @@ class _BookSuccessState extends State { ), ], ), - Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), - child: getPaymentMethods()), + Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), child: getPaymentMethods()), ], ); } @@ -575,17 +500,13 @@ class _BookSuccessState extends State { setOnlineCheckInForAppointment() { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.setOnlineCheckInForAppointment( - widget.patientShareResponse.appointmentNo.toString(), - widget.patientShareResponse.projectID!, - projectViewModel.isArabic ? 1 : 2, context).then((res) { + service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID!, projectViewModel.isArabic ? 1 : 2, context).then((res) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; appo.appointmentDate = widget.patientShareResponse.appointmentDate; insertLiveCareVIDARequest(appo, isMoveHome: false); @@ -600,9 +521,7 @@ class _BookSuccessState extends State { confirmAppointment(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.confirmAppointment( - appo.appointmentNo!, appo.clinicID!, appo.projectID!, - appo.isLiveCareAppointment!, context).then((res) { + service.confirmAppointment(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.isLiveCareAppointment!, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); @@ -621,22 +540,12 @@ class _BookSuccessState extends State { }); } - insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, - {bool isMoveHome = true}) { + insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, {bool isMoveHome = true}) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); service - .insertVIDARequest( - appo.appointmentNo, - appo.clinicID, - appo.projectID, - appo.serviceID, - appo.doctorID, - appo.appointmentDate!, - Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo), - projectViewModel.isArabic ? 1 : 2, - context) + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { @@ -659,9 +568,7 @@ class _BookSuccessState extends State { mainAxisSize: MainAxisSize.max, children: [ Text( - TranslationBase - .of(context) - .payNowBookSuccess, + TranslationBase.of(context).payNowBookSuccess, style: TextStyle( fontSize: 24.0, letterSpacing: -1.44, @@ -669,9 +576,7 @@ class _BookSuccessState extends State { ), ), Text( - TranslationBase - .of(context) - .neverWait, + TranslationBase.of(context).neverWait, style: TextStyle( fontSize: 12.0, letterSpacing: -0.54, @@ -679,20 +584,15 @@ class _BookSuccessState extends State { ), ), mHeight(24), - Text(TranslationBase - .of(context) - .payNowBookSuccesstext1, + Text(TranslationBase.of(context).payNowBookSuccesstext1, overflow: TextOverflow.fade, style: TextStyle( fontSize: 12.0, letterSpacing: -0.36, )), - Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: getPaymentMethods()), + Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), Text( - TranslationBase - .of(context) - .payNowBookSuccesstext2, + TranslationBase.of(context).payNowBookSuccesstext2, overflow: TextOverflow.clip, style: TextStyle( fontSize: 12.0, @@ -708,29 +608,26 @@ class _BookSuccessState extends State { navigateToPaymentMethod(context, widget.patientShareResponse); } - Future navigateToPaymentMethod(context, - PatientShareResponse patientShareResponse) async { + Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = widget.patientShareResponse.projectID; appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicName = widget.patientShareResponse.clinicName; appo.projectName = widget.patientShareResponse.projectName; appo.appointmentNo = widget.patientShareResponse.appointmentNo; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; appo.appointmentDate = widget.patientShareResponse.appointmentDate; appo.serviceID = widget.patientShareResponse.serviceID; Navigator.push( - context, - FadePage( - page: PaymentMethod( - onSelectedMethod: (String metohd, - [String? selectedInstallmentPlan]) { - setState(() {}); - }, - patientShare: widget.patientShareResponse.patientShareWithTax))) + context, + FadePage( + page: PaymentMethod( + onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) { + setState(() {}); + }, + patientShare: widget.patientShareResponse.patientShareWithTax))) .then((value) { selectedPaymentMethod = value[0]; if (value != null) { @@ -748,10 +645,8 @@ class _BookSuccessState extends State { }); } - void startApplePay(AppoitmentAllHistoryResultList appo, - PatientShareResponse patientShareResponse) async { - transID = Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo); + void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async { + transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); print("TransactionID: $transID"); GifLoaderDialogUtils.showMyDialog(context); @@ -759,10 +654,7 @@ class _BookSuccessState extends State { ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest(); PayfortProjectDetailsRespModel? payfortProjectDetailsRespModel; - await context.read() - .getProjectDetailsForPayfort(projectId: appo.projectID, - serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()) - .then((value) { + await context.read().getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()).then((value) { payfortProjectDetailsRespModel = value!; }); @@ -788,8 +680,7 @@ class _BookSuccessState extends State { applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.longitude = "0.0"; - applePayInsertRequest.amount = - patientShareResponse.patientShareWithTax.toString(); + applePayInsertRequest.amount = patientShareResponse.patientShareWithTax.toString(); applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0"; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; @@ -800,20 +691,15 @@ class _BookSuccessState extends State { applePayInsertRequest.isMobSDK = true; applePayInsertRequest.merchantReference = transID; - applePayInsertRequest.merchantIdentifier = - payfortProjectDetailsRespModel!.merchantIdentifier!; + applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel!.merchantIdentifier!; applePayInsertRequest.commandType = "PURCHASE"; applePayInsertRequest.signature = payfortProjectDetailsRespModel!.signature; - applePayInsertRequest.accessCode = - payfortProjectDetailsRespModel!.accessCode; - applePayInsertRequest.shaRequestPhrase = - payfortProjectDetailsRespModel!.shaRequest; - applePayInsertRequest.shaResponsePhrase = - payfortProjectDetailsRespModel!.shaResponse; + applePayInsertRequest.accessCode = payfortProjectDetailsRespModel!.accessCode; + applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel!.shaRequest; + applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel!.shaResponse; applePayInsertRequest.returnURL = ""; - service.applePayInsertRequest(applePayInsertRequest, context).then(( - res) async { + service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { await context.read().initiateApplePayWithPayfort( customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, @@ -842,7 +728,6 @@ class _BookSuccessState extends State { }); } - openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); selectedPaymentMethod = paymentMethod[0]; @@ -1274,7 +1159,7 @@ class _BookSuccessState extends State { ); } -_getTextStyling() { - return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7); -} + _getTextStyling() { + return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7); + } } diff --git a/lib/pages/BookAppointment/book_reminder_page.dart b/lib/pages/BookAppointment/book_reminder_page.dart index 56c48589..547ab901 100644 --- a/lib/pages/BookAppointment/book_reminder_page.dart +++ b/lib/pages/BookAppointment/book_reminder_page.dart @@ -1,6 +1,5 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; @@ -15,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; @@ -39,7 +37,7 @@ class BookReminderPage extends StatefulWidget { class _BookReminderPageState extends State { late MyInAppBrowser browser; - final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); + // final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); String? selectedTime; bool isSuccessShow = true; @@ -84,7 +82,7 @@ class _BookReminderPageState extends State { null, null, widget.docObject.nationalityFlagURL ?? "", - widget.docObject.doctorRate?? 0, + widget.docObject.doctorRate ?? 0, null, widget.docObject.noOfPatientsRate ?? 0, "", @@ -189,20 +187,11 @@ class _BookReminderPageState extends State { backgroundColor: CustomColors.green, elevation: 0, onPressed: () async { - showReminderDialog( - context, - widget.dateTime!, - widget.docObject.name!, - widget.patientShareResponse.appointmentNo.toString(), - widget.appoDateFormatted, - widget.appoTimeFormatted, - onSuccess: () { - AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); - navigateToBookSuccess(context); - }, - title: null, - description: null - ); + showReminderDialog(context, widget.dateTime!, widget.docObject.name!, widget.patientShareResponse.appointmentNo.toString(), widget.appoDateFormatted, widget.appoTimeFormatted, + onSuccess: () { + AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); + navigateToBookSuccess(context); + }, title: null, description: null); projectViewModel.analytics.appointment.appointment_reminder(true); }, child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)), diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 85e88d7e..b9533089 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -197,6 +197,7 @@ class _SummaryState extends State { TranslationBase.of(context).submit, () async { await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC); + widget.tabController.animateTo(1); }, color: CustomColors.green, ), diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 09e7c40e..97cd91dd 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; @@ -35,14 +37,11 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +import 'package:huawei_map/huawei_map.dart' as hmsMap; import 'package:intl/intl.dart'; import 'package:map_launcher/map_launcher.dart'; -import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'dart:io'; -import 'package:huawei_map/huawei_map.dart' as hmsMap; - class AppointmentActions extends StatefulWidget { AppoitmentAllHistoryResultList appo; @@ -59,7 +58,7 @@ class AppointmentActions extends StatefulWidget { class _AppointmentActionsState extends State { List appoButtonsList = []; - static bool isHuawei =false; + static bool isHuawei = false; late HmsApiAvailability hmsApiAvailability; @override @@ -124,7 +123,7 @@ class _AppointmentActionsState extends State { GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE = 'my appointment'; showReminderDialog( context, - DateFormat("dd MMM yyyy hh:mm") + DateFormat("dd MMM yyyy hh:mm") .parse(DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate!), widget.projectViewModel!.isArabic) + " " + widget.appo.startTime!), //DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.appo.doctorNameObj!, @@ -466,7 +465,11 @@ class _AppointmentActionsState extends State { static Future openMap(double latitude, double longitude) async { await MapLauncher.showMarker( - mapType: Platform.isAndroid ? isHuawei == true ? MapType.petal: MapType.google : MapType.apple, + mapType: Platform.isAndroid + ? isHuawei == true + ? MapType.petal + : MapType.google + : MapType.apple, coords: Coords(latitude, longitude), title: "Sulaiman Al Habib", description: "Appointment Location", @@ -474,7 +477,7 @@ class _AppointmentActionsState extends State { } checkIsHuawei() async { - if( Platform.isAndroid) { + if (Platform.isAndroid) { await hmsApiAvailability.isHMSAvailable().then((value) { isHuawei = value == 0 ? true : false; hmsMap.HuaweiMapInitializer.initializeMap(); @@ -482,28 +485,29 @@ class _AppointmentActionsState extends State { print(isHuawei); } } + askYourDoc() { GifLoaderDialogUtils.showMyDialog(context); int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; DoctorsListService service = new DoctorsListService(); - service.isAllowedToAskDoctor(widget.appo.doctorID!,languageID, context).then((res) { - int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; - service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - print(res['PatientDoctorAppointmentResultList']); - if (res['PatientDoctorAppointmentResultList'].length != 0) { - getCallRequestType(); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed); - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - print(err); - AppToast.showErrorToast(message: err); - }); - }); + service.isAllowedToAskDoctor(widget.appo.doctorID!, languageID, context).then((res) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['PatientDoctorAppointmentResultList']); + if (res['PatientDoctorAppointmentResultList'].length != 0) { + getCallRequestType(); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed); } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + }); + } getCallRequestType() { int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; @@ -526,23 +530,22 @@ class _AppointmentActionsState extends State { showAskDocRequestDialog(List requestData) { showGeneralDialog( - barrierColor: Colors.black.withOpacity(0.5), - transitionBuilder: (context, a1, a2, widget) { - final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; - return Transform( - transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), - child: Opacity( - opacity: a1.value, - child: AskDocDialog(requestData: requestData), - ), - ); - }, - transitionDuration: Duration(milliseconds: 500), - barrierDismissible: true, - barrierLabel: '', - context: context, - pageBuilder: (context, animation1, animation2) =>SizedBox()) - .then((value) { + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: AskDocDialog(requestData: requestData), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) => SizedBox()).then((value) { print("Dialog Closed"); print(value); if (value != null) { @@ -625,10 +628,10 @@ class _AppointmentActionsState extends State { context, FadePage( page: ToDo( - isShowAppBar: true, - isFromMyAppointments: true, - appointment: widget.appo, - ))); + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } } @@ -661,7 +664,7 @@ class _AppointmentActionsState extends State { } rateAppointment() { - widget.browser = new MyInAppBrowser(); + widget.browser = new MyInAppBrowser(onExitCallback: () {}); var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; print(url); launch(url); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 9224ae1f..7a58a4f1 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -47,7 +47,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; -import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; @@ -55,7 +54,7 @@ import 'package:provider/provider.dart'; class ToDo extends StatefulWidget { PatientShareResponse? patientShareResponse; var languageID; - MyInAppBrowser? browser; + // MyInAppBrowser? browser; bool? isShowAppBar = true; Function()? onBackClick; bool? isFromMyAppointments; @@ -1089,7 +1088,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { projectViewModel.analytics.todoList.to_do_list_pay_now(appo); } - openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { + openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); browser?.openPaymentBrowser( @@ -1103,8 +1102,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { authenticatedUser.firstName!, authenticatedUser.patientID, authenticatedUser, - widget!.browser!, - appo.isLiveCareAppointment!, + browser!, + appo.isLiveCareAppointment ?? false, "2", appo.isLiveCareAppointment! ? widget.patientShareResponse!.clinicID.toString() : "", context, @@ -1308,7 +1307,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context).then((res) { + service + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context) + .then((res) { GifLoaderDialogUtils.hideDialog(context); getPatientAppointmentHistory(); }).catchError((err) { diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 72f9d719..49beeddc 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -22,7 +22,8 @@ import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doct import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; -import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' + as family; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; @@ -74,7 +75,8 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); - AppointmentRateViewModel appointmentRateViewModel = locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); int currentTab = 0; late PageController pageController; @@ -91,7 +93,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { bool _showBottomNavigationBar = true; ///inject the user data - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final authService = new AuthProvider(); @@ -118,17 +121,22 @@ class _LandingPageState extends State with WidgetsBindingObserver { "appointmentdate": "2022-01-19", "appointmenttime": "12:10", "PatientName": "Testing", - "session_id": "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg", + "session_id": + "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg", "token": "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9OGMyY2IyYWFiZmZmMzI4ZmEwMjgxNDdmMGFhZGI0N2JiZjdmZWY4MjpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTBOekkxTmpZeE5ESTJPWDV5U1hobFZqWmphbTEzUkZkTVZtZGxlV1ZzU0RoelFreC1mZyZjcmVhdGVfdGltZT0xNjQ3MjU2NjE0Jm5vbmNlPTAuMjgzNDgyNjM1NDczNjQ2OCZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjQ3MjU4NDE0JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", - "DoctorImageURL": "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg", + "DoctorImageURL": + "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg", "callerID": "9920", "PatientID": "1231755", "is_call": "true" }; void _requestIOSPermissions() { - flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions( + flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + IOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( alert: true, badge: true, sound: true, @@ -144,7 +152,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { return Future.value(false); } else { DateTime now = DateTime.now(); - if (currentBackPressTime == null || now.difference(currentBackPressTime!) > Duration(seconds: 2)) { + if (currentBackPressTime == null || + now.difference(currentBackPressTime!) > Duration(seconds: 2)) { currentBackPressTime = now; AppToast.showToast(message: TranslationBase.of(context).pressAgain); return Future.value(false); @@ -159,14 +168,18 @@ class _LandingPageState extends State with WidgetsBindingObserver { List imagesInfo = []; imagesInfo.add( ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', - imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), ); imagesInfo.add( ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', - imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), ); Navigator.push( @@ -185,8 +198,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { } if (tab == 4) { List imagesInfo = []; - imagesInfo.add( - ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); Navigator.push( context, @@ -231,7 +247,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { }); }); - projectViewModel.analytics.bottomTabNavigation.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); + projectViewModel.analytics.bottomTabNavigation + .log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); } getToDoCount() { @@ -242,7 +259,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); - toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); + toDoProvider.setState( + res['AppointmentActiveNumber'], + res['AncillaryOrderListCount'], + true, + toDoProvider.notificationsCount); } else {} }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -281,7 +302,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { WidgetsBinding.instance.addPostFrameCallback((_) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { - int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + int languageID = + Provider.of(context, listen: false).isArabic + ? 1 + : 2; familyFileProvider.getSharedRecordByStatus(languageID); } }); @@ -356,23 +380,32 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (data != null) { Navigator.of(context).pushNamed(CONFIRM_LOGIN); } else { + // AppGlobal.context = context; GifLoaderDialogUtils.showMyDialog(context); - authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) { + // + // authService + // .selectDeviceImei(DEVICE_TOKEN) + // .then((value) {}) + // .catchError((err) { + // print("error: ${err.toString()}"); + // GifLoaderDialogUtils.hideDialog(context); + // Navigator.of(context).pushNamed( + // WELCOME_LOGIN, + // ); + // }); + + int languageID = projectViewModel.isArabic ? 1 : 2; + + await authService.selectDeviceImei(DEVICE_TOKEN, languageID: languageID); + + var userData = await getUserInformation(); + if (apiStatus && userData != null) { GifLoaderDialogUtils.hideDialog(context); - if (value != null) { - setUserValues(value); - Navigator.of(context).pushNamed(CONFIRM_LOGIN); - } else { - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); - } - }).catchError((err) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { GifLoaderDialogUtils.hideDialog(context); - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); - }); + Navigator.of(context).pushNamed(WELCOME_LOGIN); + } } } @@ -434,14 +467,20 @@ class _LandingPageState extends State with WidgetsBindingObserver { getNotificationCount(token) async { if (await sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { authService.getDashboard().then((value) => { if (value != null) { setState(() { - notificationCount = - value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] > + 99 + ? '99+' + : value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] + .toString(); model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); }) @@ -471,8 +510,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { getText(currentTab).toUpperCase(), style: TextStyle( fontWeight: FontWeight.bold, - color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1!.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + color: currentTab == 0 + ? CustomColors.backgroudGreyColor + : Theme.of(context).textTheme.headline1!.color, + fontFamily: + projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // bold: true, ), leading: Builder( @@ -481,9 +523,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { children: [ currentTab == 0 ? IconButton( - icon: SvgPicture.asset("assets/images/new/menu.svg"), - color: Theme.of(context).textTheme.headline1!.color, - onPressed: () => Scaffold.of(context).openDrawer(), + icon: SvgPicture.asset( + "assets/images/new/menu.svg"), + color: Theme.of(context) + .textTheme + .headline1! + .color, + onPressed: () => + Scaffold.of(context).openDrawer(), ) : IconButton( icon: Icon(Icons.arrow_back), @@ -494,7 +541,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController.jumpToPage(0); }, ), - projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild + projectViewModel.isLogin && + model.notificationsCount != null && + !projectViewModel.isLoginChild ? Positioned( right: projectViewModel.isArabic ? 35 : 0, top: 5, @@ -512,7 +561,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { model.notificationsCount.toString(), style: TextStyle( color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, + fontSize: + projectViewModel.isArabic ? 8 : 9, ), textAlign: TextAlign.center, ), @@ -596,15 +646,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { index: currentTab, ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0) - ? FloatingButton( - elevation: true, - onTap: () { - changeCurrentTab(2); - projectViewModel.analytics.appointment.book_appointment(); - }, - ) - : null); + floatingActionButton: + (projectViewModel.havePrivilege(34) && currentTab == 0) + ? FloatingButton( + elevation: true, + onTap: () { + changeCurrentTab(2); + projectViewModel.analytics.appointment.book_appointment(); + }, + ) + : null); } triggerRobot() { @@ -630,15 +681,24 @@ class _LandingPageState extends State with WidgetsBindingObserver { void checkUserStatus(token) async { await PushNotificationHandler.getInstance().requestPermissions(); - authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value)); + // authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value)); if (authenticatedUserObject.isLogin) { - var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { - authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); + authService + .registeredAuthenticatedUser(data, token, 0, 0) + .then((res) => {}); authService.getDashboard().then((value) async { setState(() { if (value != null) { - notificationCount = value ['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] > + 99 + ? '99+' + : value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] + .toString(); model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); @@ -669,7 +729,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } if (Platform.isIOS) { String voipToken = await sharedPref.getString(APNS_TOKEN); - getOneSignalVOIPToken(voipToken); + getOneSignalVOIPToken(voipToken); } // registerGeofences(); } diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 74fa8e60..e773957a 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -47,7 +47,12 @@ class ConfirmLogin extends StatefulWidget { final fromRegistration; final bool isDubai; - const ConfirmLogin({Key? key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key); + const ConfirmLogin( + {Key? key, + this.changePageViewIndex, + this.fromRegistration = false, + this.isDubai = false}) + : super(key: key); @override _ConfirmLogin createState() => _ConfirmLogin(); @@ -59,7 +64,8 @@ class _ConfirmLogin extends State { var sharedPref = AppSharedPreferences(); bool authenticated = false; final authService = AuthProvider(); - PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = + locator(); late int mobileNumber; String errorMsg = ''; SelectDeviceIMEIRES? user; @@ -89,8 +95,10 @@ class _ConfirmLogin extends State { int fingrePrintBefore = 0; - AuthenticatedUserObject authenticatedUserObject = locator(); - AppointmentRateViewModel appointmentRateViewModel = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); late ProjectViewModel projectViewModel; late ToDoCountProviderModel toDoProvider; @@ -138,16 +146,30 @@ class _ConfirmLogin extends State { children: [ Text( TranslationBase.of(context).welcomeBack, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64), ), Text( user!.name!.toLowerCase().capitalizeFirstofEach, - style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44), + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.w700, + color: Color(0xff2B353E), + height: 1, + letterSpacing: -1.44), ), SizedBox(height: 10), Text( TranslationBase.of(context).accountInfo, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64, + height: 25 / 16), ), Container( height: 72, @@ -166,29 +188,46 @@ class _ConfirmLogin extends State { mainAxisSize: MainAxisSize.min, children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - TranslationBase.of(context).lastLoginAt.toCamelCase, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), + TranslationBase.of(context) + .lastLoginAt + .toCamelCase, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64), ), Text( - user!.editedOn != null - ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!)) - : user!.createdOn != null - ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.createdOn!)) - : '--', - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), + // user!.editedOn != null + // ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!)) + // : + user!.createdOn != null + ? DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + user!.createdOn!)) + : '--', + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.48), ), ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - TranslationBase.of(context).lastLoginWith.toCamelCase, + TranslationBase.of(context) + .lastLoginWith + .toCamelCase, style: TextStyle( fontSize: 10, fontWeight: FontWeight.w600, @@ -205,12 +244,23 @@ class _ConfirmLogin extends State { ), Expanded(child: SizedBox()), Text( - user!.editedOn != null - ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.editedOn!), false) - : user!.createdOn != null - ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.createdOn!), false) - : '--', - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), + // user!.editedOn != null + // ? DateUtil.formatDateToTimeLang( + // DateUtil.convertStringToDate( + // user!.editedOn!), + // false) + // : + user!.createdOn != null + ? DateUtil.formatDateToTimeLang( + DateUtil.convertStringToDate( + user!.createdOn!), + false) + : '--', + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + letterSpacing: -0.48), ), ], ) @@ -219,10 +269,18 @@ class _ConfirmLogin extends State { ), Text( TranslationBase.of(context).pleaseVerify, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.64), ), GridView( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 13, + mainAxisSpacing: 9), physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.only(top: 9), shrinkWrap: true, @@ -236,40 +294,62 @@ class _ConfirmLogin extends State { ], ) else - Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - 'assets/images/habib-logo.png', - height: 90, - width: 90, - ), - SizedBox(height: 23), - this.onlySMSBox == false - ? Text( - TranslationBase.of(context).verifyLoginWith, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), - ) - : Text( - TranslationBase.of(context).verifyFingerprint2, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), - ), - SizedBox(height: 23), - Text( - TranslationBase.of(context).pleaseVerify, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), - ), - GridView( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(top: 9), - shrinkWrap: true, - children: [ - if (onlySMSBox == false) getButton(3), - if (onlySMSBox == false) getButton(2), - getButton(1), - getButton(4), - ], - ), - ]), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/habib-logo.png', + height: 90, + width: 90, + ), + SizedBox(height: 23), + this.onlySMSBox == false + ? Text( + TranslationBase.of(context).verifyLoginWith, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64, + height: 25 / 16), + ) + : Text( + TranslationBase.of(context) + .verifyFingerprint2, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64, + height: 25 / 16), + ), + SizedBox(height: 23), + Text( + TranslationBase.of(context).pleaseVerify, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.64), + ), + GridView( + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 13, + mainAxisSpacing: 9), + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(top: 9), + shrinkWrap: true, + children: [ + if (onlySMSBox == false) getButton(3), + if (onlySMSBox == false) getButton(2), + getButton(1), + getButton(4), + ], + ), + ]), ], ), ), @@ -280,7 +360,8 @@ class _ConfirmLogin extends State { TranslationBase.of(context).useAnotherAccount, () { Navigator.of(context).pushNamed(LOGIN_TYPE); - projectViewModel.analytics.loginRegistration.login_with_other_account(); + projectViewModel.analytics.loginRegistration + .login_with_other_account(); }, ), ], @@ -290,7 +371,6 @@ class _ConfirmLogin extends State { } Future _getAvailableBiometrics() async { - final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics; final bool canAuthenticate = canAuthenticateWithBiometrics || await auth.isDeviceSupported(); @@ -322,7 +402,8 @@ class _ConfirmLogin extends State { login_method = type; LoginRegistration.verificationMethod = type; // if(!widget.fromRegistration) - projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); + projectViewModel.analytics.loginRegistration + .login_verfication(forRegistration: widget.fromRegistration); switch (type) { case 1: @@ -340,7 +421,8 @@ class _ConfirmLogin extends State { default: break; } - sharedPref.setInt(LAST_LOGIN, this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); + sharedPref.setInt(LAST_LOGIN, + this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); } loginWithSMS(type) { @@ -396,7 +478,8 @@ class _ConfirmLogin extends State { GifLoaderDialogUtils.showMyDialog(context); if (healthId != null || widget.isDubai) { if (!widget.isDubai) { - request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + request.dob = + dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); } request.healthId = healthId; request.isHijri = isHijri; @@ -452,7 +535,11 @@ class _ConfirmLogin extends State { stickyAuth: true, ), authMessages: [ - IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'), + IOSAuthMessages( + cancelButton: 'cancel', + goToSettingsButton: 'settings', + goToSettingsDescription: 'Please set up your Touch ID.', + lockOut: 'Please reenable your Touch ID'), ], ); } on PlatformException catch (e) { @@ -508,14 +595,19 @@ class _ConfirmLogin extends State { setDefault() async { showLoader(true); - if (await sharedPref.getObject(IMEI_USER_DATA) != null) user = SelectDeviceIMEIRES.fromJson(await sharedPref.getObject(IMEI_USER_DATA)); + if (await sharedPref.getObject(IMEI_USER_DATA) != null) + user = SelectDeviceIMEIRES.fromJson( + await sharedPref.getObject(IMEI_USER_DATA)); if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { isMoreOption = true; - this.registerd_data = await CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); + this.registerd_data = await CheckPatientAuthenticationReq.fromJson( + await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); } - this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user!.mobile!); + this.mobileNumber = this.registerd_data != null + ? this.registerd_data.patientMobileNumber + : int.parse(this.user!.mobile!); this.zipCode = this.registerd_data != null ? this.registerd_data.zipCode : this.user!.outSA == true @@ -534,7 +626,9 @@ class _ConfirmLogin extends State { if (nhic != null) { final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); - dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); + dob = nhic['IsHijri'] + ? nhic['DateOfBirth'] + : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); isHijri = nhic['IsHijri'] ? 1 : 0; healthId = nhic['HealthId']; @@ -557,22 +651,34 @@ class _ConfirmLogin extends State { request.deviceToken = this.deviceToken; request.projectOutSA = this.patientOutSA == true ? true : false; request.loginType = this.selectedOption; - request.oTPSendType = type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2; + request.oTPSendType = + type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2; request.zipCode = this.zipCode; request.logInTokenID = this.loginTokenID ?? ""; if (this.registerd_data != null) { - request.searchType = this.registerd_data.searchType != null ? this.registerd_data.searchType : 1; - request.patientID = this.registerd_data.patientID != null ? this.registerd_data.patientID : 0; - request.patientIdentificationID = request.nationalID = this.registerd_data.patientIdentificationID != null ? this.registerd_data.patientIdentificationID : '0'; + request.searchType = this.registerd_data.searchType != null + ? this.registerd_data.searchType + : 1; + request.patientID = this.registerd_data.patientID != null + ? this.registerd_data.patientID + : 0; + request.patientIdentificationID = request.nationalID = + this.registerd_data.patientIdentificationID != null + ? this.registerd_data.patientIdentificationID + : '0'; request.dob = this.registerd_data.dob; request.isRegister = this.registerd_data.isRegister; } else { request.searchType = request.searchType != null ? request.searchType : 2; - request.patientID = this.user!.patientID != null ? this.user!.patientID : 0; - request.nationalID = request.nationalID != null ? request.nationalID : '0'; - request.patientIdentificationID = request.patientIdentificationID != null ? request.patientIdentificationID : '0'; + request.patientID = + this.user!.patientID != null ? this.user!.patientID : 0; + request.nationalID = + request.nationalID != null ? request.nationalID : '0'; + request.patientIdentificationID = request.patientIdentificationID != null + ? request.patientIdentificationID + : '0'; request.isRegister = false; } request.deviceTypeID = request.searchType; @@ -597,14 +703,19 @@ class _ConfirmLogin extends State { res = result, if (result is Map) { - result = CheckActivationCode.fromJson(result as Map), - if (this.registerd_data != null && this.registerd_data.isRegister == true) + result = CheckActivationCode.fromJson( + result as Map), + if (this.registerd_data != null && + this.registerd_data.isRegister == true) { // if(widget.isDubai ==false){ widget.changePageViewIndex!(1), // if(widget.isDubai ==false){ - Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), + Navigator.popUntil( + context, + (route) => + Utils.route(route, equalsTo: RegisterNew)), } } else @@ -614,8 +725,11 @@ class _ConfirmLogin extends State { Future.delayed(Duration(seconds: 1), () { AppToast.showErrorToast(message: result); }), - projectViewModel.analytics.loginRegistration.login_fail(error: result), - projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result), + projectViewModel.analytics.loginRegistration + .login_fail(error: result), + projectViewModel.analytics.errorTracking.log( + 'otp_verification_at_confirm_login', + error: result), } }) .catchError((err) { @@ -633,27 +747,36 @@ class _ConfirmLogin extends State { res = result, if (result is Map) { - result = CheckActivationCode.fromJson(result as Map), - if (this.registerd_data != null && this.registerd_data.isRegister == true) + result = CheckActivationCode.fromJson( + result as Map), + if (this.registerd_data != null && + this.registerd_data.isRegister == true) { widget.changePageViewIndex!(1), - Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), + Navigator.popUntil( + context, + (route) => + Utils.route(route, equalsTo: RegisterNew)), } else { sharedPref.remove(FAMILY_FILE), result.list.isFamily = false, userData = result.list, - sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? "O+"), + sharedPref.setString( + BLOOD_TYPE, result.patientBloodType ?? "O+"), //Remove o+ from here Added by Aamir authenticatedUserObject.user = result.list, projectViewModel.setPrivilege(privilegeList: res), sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(USER_PROFILE, result.list), loginTokenID = result.logInTokenID, - sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - sharedPref.setString(TOKEN, result.authenticationTokenID), - projectViewModel.analytics.loginRegistration.login_successful(), + sharedPref.setObject( + LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString( + TOKEN, result.authenticationTokenID), + projectViewModel.analytics.loginRegistration + .login_successful(), checkIfUserAgreedBefore(result), } } @@ -666,8 +789,10 @@ class _ConfirmLogin extends State { startSMSService(tempType); }), - projectViewModel.analytics.loginRegistration.login_fail(error: result), - projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result) + projectViewModel.analytics.loginRegistration + .login_fail(error: result), + projectViewModel.analytics.errorTracking + .log('otp_verification_at_confirm_login', error: result) } }) .catchError((err) { @@ -703,17 +828,25 @@ class _ConfirmLogin extends State { print("Has Admission Request: $hasAdmissionRequest"); if (isAdmitted) { if (res['PatientAdmittedInformation'].length != 0) { - getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]); - projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']); - projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel); + getAdmissionInfoResponseModel = + GetAdmissionInfoResponseModel.fromJson( + res['PatientAdmittedInformation'][0]); + projectViewModel.setInPatientProjectID( + res['PatientAdmittedInformation'][0]['ProjectID']); + projectViewModel + .setInPatientAdmissionInfo(getAdmissionInfoResponseModel); projectViewModel.setIsPatientAdmitted(true); } } if (hasAdmissionRequest) { if (res['MedicalInstruction'].length != 0) { - getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel.fromJson(res['MedicalInstruction'][0]); - projectViewModel.setInPatientProjectID(res['MedicalInstruction'][0]['ProjectID']); - projectViewModel.setInPatientAdmissionRequest(getAdmissionRequestInfoResponseModel); + getAdmissionRequestInfoResponseModel = + GetAdmissionRequestInfoResponseModel.fromJson( + res['MedicalInstruction'][0]); + projectViewModel.setInPatientProjectID( + res['MedicalInstruction'][0]['ProjectID']); + projectViewModel.setInPatientAdmissionRequest( + getAdmissionRequestInfoResponseModel); projectViewModel.setPatientHasAdmissionRequest(true); } } @@ -722,7 +855,10 @@ class _ConfirmLogin extends State { } insertIMEI() { - authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) { + authService + .insertDeviceImei(selectedOption) + .then((value) => {}) + .catchError((err) { print(err); }); } @@ -732,7 +868,8 @@ class _ConfirmLogin extends State { ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0"); + toDoProvider.setState(res['AppointmentActiveNumber'], + res['AncillaryOrderListCount'], true, "0"); // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); } else {} }).catchError((err) { @@ -794,8 +931,14 @@ class _ConfirmLogin extends State { }); } - Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { - bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) || _flag == 2 && !checkIfBiometricAvailable(BiometricType.fingerprint) && _flag == 2 && !checkIfBiometricAvailable(BiometricType.strong)); + Widget _loginOptionButton( + String _title, String _icon, int _flag, int? _loginIndex) { + bool isDisable = + (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) || + _flag == 2 && + !checkIfBiometricAvailable(BiometricType.fingerprint) && + _flag == 2 && + !checkIfBiometricAvailable(BiometricType.strong)); return InkWell( onTap: isDisable ? null @@ -806,7 +949,8 @@ class _ConfirmLogin extends State { }); } else { authenticateUser(_flag, isActive: _loginIndex); - projectViewModel.analytics.loginRegistration.verify_otp_method(forRegistration: widget.fromRegistration); + projectViewModel.analytics.loginRegistration.verify_otp_method( + forRegistration: widget.fromRegistration); } }, child: Container( @@ -831,7 +975,14 @@ class _ConfirmLogin extends State { ), Text( TranslationBase.of(context).verifyThrough + " " + _title, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: isDisable ? Color(0xff2B353E).withOpacity(0.7) : Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: isDisable + ? Color(0xff2B353E).withOpacity(0.7) + : Color(0xff2B353E), + letterSpacing: -0.48, + height: 20 / 16), ), ], ), @@ -843,16 +994,26 @@ class _ConfirmLogin extends State { Widget getButton(int flag) { switch (flag) { case 4: - return _loginOptionButton(TranslationBase.of(context).verifyWhatsApp, 'assets/images/new/verify_whatsapp.svg', flag, null); + return _loginOptionButton(TranslationBase.of(context).verifyWhatsApp, + 'assets/images/new/verify_whatsapp.svg', flag, null); break; case 1: - return _loginOptionButton(TranslationBase.of(context).verifySMS, 'assets/images/new/verify_sms.svg', flag, null); + return _loginOptionButton(TranslationBase.of(context).verifySMS, + 'assets/images/new/verify_sms.svg', flag, null); break; case 2: - return _loginOptionButton(TranslationBase.of(context).verifyFingerprint, 'assets/images/new/verify_thumb.svg', flag, BiometricType.fingerprint.index); + return _loginOptionButton( + TranslationBase.of(context).verifyFingerprint, + 'assets/images/new/verify_thumb.svg', + flag, + BiometricType.fingerprint.index); break; case 3: - return _loginOptionButton(TranslationBase.of(context).verifyFaceID, 'assets/images/new/verify_face.svg', flag, BiometricType.face.index); + return _loginOptionButton( + TranslationBase.of(context).verifyFaceID, + 'assets/images/new/verify_face.svg', + flag, + BiometricType.face.index); break; default: @@ -864,7 +1025,9 @@ class _ConfirmLogin extends State { }, child: RoundedContainer( height: 150, - backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), + backgroundColor: BiometricType.fingerprint.index == 1 + ? Colors.white + : Colors.white.withOpacity(.7), borderColor: Colors.grey, showBorder: true, child: Padding( @@ -883,7 +1046,10 @@ class _ConfirmLogin extends State { : SizedBox( height: 20, ), - Texts(TranslationBase.of(context).moreVerification, fontSize: SizeConfig.textMultiplier! * 1.8, textAlign: TextAlign.center, color: Colors.black) + Texts(TranslationBase.of(context).moreVerification, + fontSize: SizeConfig.textMultiplier! * 1.8, + textAlign: TextAlign.center, + color: Colors.black) ], ), ), diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 4a0c5ecc..e7a5c42b 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -71,7 +71,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat widget.appointmentAllHistoryResultList!.doctorTitle! + " " + widget.appointmentAllHistoryResultList!.doctorNameObj!, widget.appointmentAllHistoryResultList!.doctorID!, widget.appointmentAllHistoryResultList!.doctorImageURL!, - widget.appointmentAllHistoryResultList!.doctorSpeciality!, + widget.appointmentAllHistoryResultList!.doctorSpeciality !=null ? widget.appointmentAllHistoryResultList!.doctorSpeciality! : [], "", widget.appointmentAllHistoryResultList!.projectName!, DateUtil.convertStringToDate(widget.appointmentAllHistoryResultList!.appointmentDate!), @@ -84,17 +84,25 @@ class _EyeHomePageState extends State with SingleTickerProviderStat //model.user.emailAddress, ), isNeedToShowButton: _tabController!.index == 0 ? true : projectViewModel!.havePrivilege(15), - showConfirmMessageDialog: true, + showConfirmMessageDialog: false, onRatingAndReviewTap: getDoctorRatingsDetails, onTap: () { - showConfirmMessage(context, () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendGlassesPrescriptionEmail( - appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo!, - projectName: widget.appointmentAllHistoryResultList!.projectName!, - projectID: widget.appointmentAllHistoryResultList!.projectID!); - GifLoaderDialogUtils.hideDialog(context); - }, projectViewModel!.user!.emailAddress!); + print("Email.."); + + showDialog( + context: context, + builder: (cxt) => ConfirmSendEmailDialog( + email: projectViewModel!.user!.emailAddress!, + onTapSendEmail: () async{ + GifLoaderDialogUtils.showMyDialog(context); + await model.sendGlassesPrescriptionEmail( + appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo!, + projectName: widget.appointmentAllHistoryResultList!.projectName!, + projectID: widget.appointmentAllHistoryResultList!.projectID!); + GifLoaderDialogUtils.hideDialog(context); + }, + ), + ); }, ), Container( @@ -165,18 +173,10 @@ class _EyeHomePageState extends State with SingleTickerProviderStat ), ); } - - void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { - showDialog( - context: context, - builder: (cxt) => ConfirmSendEmailDialog( - email: email, - onTapSendEmail: () { - onTap(); - }, - ), - ); - } + // + // void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { + // + // } void getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); diff --git a/lib/pages/medical/eye/EyeMeasurementsPage.dart b/lib/pages/medical/eye/EyeMeasurementsPage.dart index 9bde92b7..652c0a24 100644 --- a/lib/pages/medical/eye/EyeMeasurementsPage.dart +++ b/lib/pages/medical/eye/EyeMeasurementsPage.dart @@ -14,6 +14,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../uitl/gif_loader_dialog_utils.dart'; +import '../../../widgets/dialogs/confirm_send_email_dialog.dart'; import 'EyeHomePage.dart'; class EyeMeasurementsPage extends StatelessWidget { @@ -69,6 +71,16 @@ class EyeMeasurementsPage extends StatelessWidget { ), ), ), + onEmailTap: () { + showConfirmMessage(context, () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendGlassesPrescriptionEmail( + appointmentNo: _appointmentResult!.appointmentNo!, + projectName: _appointmentResult!.projectName!, + projectID: _appointmentResult!.projectID!); + GifLoaderDialogUtils.hideDialog(context); + }, projectViewModel!.user!.emailAddress!); + }, isInOutPatient: _appointmentResult.isInOutPatient, name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!, // billNo: "appointmentResult.do", @@ -99,4 +111,16 @@ class EyeMeasurementsPage extends StatelessWidget { ), ); } + void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { + showDialog( + context: context, + builder: (cxt) => ConfirmSendEmailDialog( + email: email, + onTapSendEmail: () { + onTap(); + }, + ), + ); + } + } diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart index 53c08e41..61e74acb 100644 --- a/lib/pages/medical/labs/passport_update_page.dart +++ b/lib/pages/medical/labs/passport_update_page.dart @@ -135,12 +135,12 @@ class _PassportUpdatePageState extends State { ), ), Container( + width: MediaQuery.of(context).size.width, margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0), child: ButtonTheme( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: MediaQuery.of(context).size.width, height: 45.0, child: CustomTextButton( backgroundColor: Color(0xFFc5272d), @@ -284,7 +284,7 @@ class _PassportUpdatePageState extends State { service.getCovidPassportNumber().then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['Covid19_Certificate_GetPassportList'].length != 0) { - passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; + passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] ?? ""; if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { _isButtonDisabled = false; } diff --git a/lib/pages/medical/medical_profile_page_new.dart b/lib/pages/medical/medical_profile_page_new.dart index a4f21c80..2f61a795 100644 --- a/lib/pages/medical/medical_profile_page_new.dart +++ b/lib/pages/medical/medical_profile_page_new.dart @@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_new_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index 1077fd05..279775f5 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -39,7 +39,7 @@ class _AddBloodSugarPageState extends State { DateTime bloodSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now(); String measureUnitSelectedType = 'mg/dlt'; - int measuredTime = 1; + int measuredTime = 9; bool isButtonDisabled = true; int _selectedMeasureUnitIndex = 0; @@ -68,7 +68,7 @@ class _AddBloodSugarPageState extends State { "صائم", "آخر", ]; - int? _selectedMeasureTimeIndex; + int? _selectedMeasureTimeIndex =9; String? measureTimeSelectedType; @override diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 0d2cb52b..f9abb655 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1037,7 +1037,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future autoGenerateAncillaryOrdersInvoice(dynamic orderNo, int projectID, dynamic appointmentID, List selectedProcListAPI, BuildContext context) async { + Future autoGenerateAncillaryOrdersInvoice(dynamic orderNo, int projectID, dynamic appointmentID, List selectedProcListAPI, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1051,7 +1051,7 @@ class DoctorsListService extends BaseService { }); request = { - "LanguageID": 1, + "LanguageID": languageID, "RequestAncillaryOrderInvoice": [ {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} ], diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index a9b0ff10..e89a6741 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -168,35 +168,44 @@ class AuthProvider with ChangeNotifier { } } - Future selectDeviceImei(imei) async { + Future selectDeviceImei(imei, + {int languageID = 1}) async { try { - dynamic localRes; + // SelectDeviceIMEIRES? localRes; print(imei); Map request = {}; request['IMEI'] = imei; + request['LanguageID'] = languageID; + await BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) async { - localRes = Map(); + // localRes = Map(); + print( + "Here response: ${response['Patient_SELECTDeviceIMEIbyIMEIList'][0]}"); if (response['Patient_SELECTDeviceIMEIbyIMEIList'][0] != null) { - localRes = SelectDeviceIMEIRES.fromJson( + apiStatus = true; + sharedPref.setObject( + IMEI_USER_DATA, + SelectDeviceIMEIRES.fromJson( + response['Patient_SELECTDeviceIMEIbyIMEIList'][0])); + return SelectDeviceIMEIRES.fromJson( response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); + } else { + print("ELSE TRIGERRED!!!!!!!!!"); } - request['LanguageID'] = - Provider.of(AppGlobal.context, listen: false) - .isArabic - ? 1 - : 2; - await new BaseAppClient().post(SELECT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { - localRes = SelectDeviceIMEIRES.fromJson( - response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); - return Future.value(localRes); - }, onFailure: (String error, int statusCode) {}, body: {}); + // await new BaseAppClient().post(SELECT_DEVICE_IMEI, + // onSuccess: (dynamic response, int statusCode) { + // localRes = SelectDeviceIMEIRES.fromJson( + // response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); + // }, onFailure: (String error, int statusCode) { + // throw error; + // }, body: request); + }, onFailure: (String error, int statusCode) { + print("in the failure with : $error and $statusCode"); + }, body: request); } catch (error) { - return Future.error(error); + print("in the error"); + // return Future.error(error); } } @@ -627,8 +636,10 @@ class AuthProvider with ChangeNotifier { await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(PHARMACY_CUSTOMER_ID); await authenticatedUserObject.getUser(); - Provider.of(AppGlobal.context, listen: false).isLogin = false; - var model = Provider.of(AppGlobal.context, listen: false); + Provider.of(AppGlobal.context, listen: false).isLogin = + false; + var model = + Provider.of(AppGlobal.context, listen: false); model.setState(0, 0, false, null); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } diff --git a/lib/uitl/gif_loader_dialog_utils.dart b/lib/uitl/gif_loader_dialog_utils.dart index d95307de..304dda51 100644 --- a/lib/uitl/gif_loader_dialog_utils.dart +++ b/lib/uitl/gif_loader_dialog_utils.dart @@ -9,9 +9,9 @@ class GifLoaderDialogUtils { static hideDialog(BuildContext context) { try { - Navigator.of(context).pop(); + Navigator.of(context, rootNavigator: true).pop(); } catch (error) { - Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context).canPop()); + Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context, rootNavigator: true).canPop()); } } -} +} \ No newline at end of file diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index c9c43293..90a93a12 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -6,7 +5,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; @@ -95,9 +93,9 @@ class DoctorCard extends StatelessWidget { color: Utils.isHMCProject(projectViewModel, projectID) ? Color(0xff3FACC8) - : isLiveCareAppointment !=null && isLiveCareAppointment==true + : isLiveCareAppointment != null && isLiveCareAppointment == true ? Color(0xff2E303A) - : isInOutPatient !=null && isInOutPatient ==false + : isInOutPatient != null && isInOutPatient == false ? Color(0xffD02127) : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -112,9 +110,9 @@ class DoctorCard extends StatelessWidget { ? RotatedBox( quarterTurns: 3, child: Text( - isLiveCareAppointment !=null && isLiveCareAppointment==true + isLiveCareAppointment != null && isLiveCareAppointment == true ? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach - : isInOutPatient!=null && isInOutPatient ==false + : isInOutPatient != null && isInOutPatient == false ? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach : TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10), @@ -183,11 +181,11 @@ class DoctorCard extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - MyRichText(isSortByClinic! ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName ??"", projectViewModel!.isArabic), + MyRichText(isSortByClinic! ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName ?? "", projectViewModel!.isArabic), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel!.isArabic), + if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).orderNo, billNo ?? "", projectViewModel!.isArabic), if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel!.isArabic), if (rating != null) Row( @@ -216,7 +214,8 @@ class DoctorCard extends StatelessWidget { ), half: Icon( Icons.star_half, - color: CustomColors.accentColor, ), + color: CustomColors.accentColor, + ), empty: Icon( Icons.star_border, color: CustomColors.accentColor, diff --git a/lib/widgets/data_display/medical/time_line_new_widget.dart b/lib/widgets/data_display/medical/time_line_new_widget.dart index 3419a858..af2386bf 100644 --- a/lib/widgets/data_display/medical/time_line_new_widget.dart +++ b/lib/widgets/data_display/medical/time_line_new_widget.dart @@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; @@ -44,7 +43,7 @@ class _TimeLineViewState extends State { @override void initState() { super.initState(); - // selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString()); + // selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString()); dateObjs.add(DateObj(0, 0, widget.isArabic ? "الكل" : "All")); for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { tempList.add(widget.appoitmentAllHistoryResultList[i]); @@ -62,7 +61,7 @@ class _TimeLineViewState extends State { dateObjs = dateObjs.toSet().toList(); dateObjs.sort((a, b) => a.month.compareTo(b.month)); dateObjs.sort((a, b) => a.year.compareTo(b.year)); - logger.d(dateObjs); + // logger.d(dateObjs); for (int i = 0; i < dateObjs.length; i++) { print(dateObjs[i].monthYear.toString()); @@ -167,7 +166,6 @@ class _TimeLineViewState extends State { ), ), ) - : Container() ], ), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index fe68467e..9ffec736 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -14,9 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } @@ -40,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser { static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS @@ -60,7 +58,7 @@ class MyInAppBrowser extends InAppBrowser { static List errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled']; - final Function? onExitCallback; + final Function onExitCallback; final Function? onLoadStartCallback; final BuildContext? context; @@ -78,7 +76,7 @@ class MyInAppBrowser extends InAppBrowser { static bool isPaymentDone = false; - MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); + MyInAppBrowser({required this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); Future onBrowserCreated() async { print("\n\nBrowser Created!\n\n"); @@ -89,8 +87,6 @@ class MyInAppBrowser extends InAppBrowser { if (onLoadStartCallback != null) onLoadStartCallback!(url.toString()); } - - @override Future onLoadStop(Uri? url) async { print("\n\nStopped $url\n\n"); @@ -106,8 +102,15 @@ class MyInAppBrowser extends InAppBrowser { @override void onExit() { - print("\n\nBrowser closed!\n\n"); - if (onExitCallback != null) onExitCallback!(appo, isPaymentDone); + print("\n\nBrowser closed before!\n\n"); + // if (onExitCallback != null) { + try { + onExitCallback(appo, isPaymentDone); + print("\n\nBrowser closed after!\n\n"); + } catch (err) { + print(err.toString()); + } + // } } @override @@ -145,7 +148,8 @@ class MyInAppBrowser extends InAppBrowser { // await getPatientData(); if (paymentMethod == "ApplePay") { getDeviceToken(); - MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); + MyChromeSafariBrowser safariBrowser = + new MyChromeSafariBrowser(new MyInAppBrowser(onExitCallback: browser.onExit), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); if (context != null) GifLoaderDialogUtils.showMyDialog(context); @@ -249,7 +253,8 @@ class MyInAppBrowser extends InAppBrowser { openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, AuthenticatedUser authenticatedUser, InAppBrowser browser) { this.browser = browser; - MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); + MyChromeSafariBrowser safariBrowser = + new MyChromeSafariBrowser(new MyInAppBrowser(onExitCallback: browser.onExit), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); // getPatientData(); generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { if (order.customValuesXml!.contains("ApplePay")) { @@ -476,7 +481,7 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser { final Function? onLoadStartCallback; AppoitmentAllHistoryResultList? appo; - MyChromeSafariBrowser(browserFallback, { this.onExitCallback, this.onLoadStartCallback, this.appo}); + MyChromeSafariBrowser(browserFallback, {this.onExitCallback, this.onLoadStartCallback, this.appo}); @override void onOpened() {