Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into hussam_pharmacy_fix

 Conflicts:
	lib/config/config.dart
	lib/pages/parent_categorise_page.dart
	lib/pages/pharmacies/screens/cart-page/cart-order-page.dart
	lib/pages/pharmacies/screens/product-details/product-detail.dart
	lib/pages/sub_categorise_page.dart
merge-update-with-lab-changes
hussam al-habibeh 4 years ago
commit 1a382bfc80

@ -15,7 +15,7 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
//const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
@ -26,6 +26,11 @@ const BASE_URL = 'https://hmgwebservices.com/';
const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// // Pharmacy Pre-Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// RC API URL // RC API URL
const RC_BASE_URL = 'https://livecare.hmg.com/'; const RC_BASE_URL = 'https://livecare.hmg.com/';
@ -38,8 +43,7 @@ const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints';
const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo';
// Delivery Driver // Delivery Driver
const DRIVER_LOCATION = const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation';
'Services/Patients.svc/REST/PatientER_GetDriverLocation';
//weather //weather
const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
@ -47,60 +51,41 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege';
// Wifi Credentials // Wifi Credentials
const WIFI_CREDENTIALS = const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
"Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
///Doctor ///Doctor
const GET_MY_DOCTOR = const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_PRE_POST_IMAGES = const GET_DOCTOR_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages';
'Services/Doctors.svc/REST/GetDoctorPrePostImages'; const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_NOTES = const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions ///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const GET_PRESCRIPTION_REPORT = const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
'Services/Patients.svc/REST/INP_GetPrescriptionReport'; const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order ///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
'Services/Patients.svc/REST/GetPatientLabSpecialResults'; const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const SEND_LAB_RESULT_EMAIL = const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
'Services/Notifications.svc/REST/SendLabReportEmail'; const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_Patient_LAB_RESULT = const SEND_COVID_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/GenerateCOVIDReport';
'Services/Patients.svc/REST/GetPatientLabResults'; const COVID_PASSPORT_UPDATE = 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate';
const GET_Patient_LAB_ORDERS_RESULT = const GET_PATIENT_PASSPORT_NUMBER = 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport';
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const SEND_COVID_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/GenerateCOVIDReport';
const COVID_PASSPORT_UPDATE =
'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate';
const GET_PATIENT_PASSPORT_NUMBER =
'Services/Patients.svc/REST/Covid19_Certificate_GetPassport';
/// ///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_ORDERS_DETAILS = const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const SEND_RAD_REPORT_EMAIL = const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail';
'Services/Notifications.svc/REST/SendRadReportEmail';
///Feedback ///Feedback
const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
@ -112,40 +97,28 @@ const GET_PATIENT_AppointmentHistory = 'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory_Async'; '/Doctors.svc/REST/PateintHasAppoimentHistory_Async';
///VITAL SIGN ///VITAL SIGN
const GET_PATIENT_VITAL_SIGN = const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
///Er Nearest ///Er Nearest
const GET_NEAREST_HOSPITAL = const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///ED Online ///ED Online
const ER_GET_VISUAL_TRIAGE_QUESTIONS = const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
"services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_SAVE_TRIAGE_INFORMATION = const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
"services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic =
"services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
///Er Nearest ///Er Nearest
const GET_AMBULANCE_REQUEST = const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; const GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PATIENT_ALL_PRES_ORDERS = const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
const UPDATE_PRESS_ORDER =
'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
/// ER RRT /// ER RRT
const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation'; const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation'; const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation';
const GET_ALL_RRT_QUESTIONS = const GET_ALL_RRT_QUESTIONS = 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; const GET_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
const GET_RRT_SERVICE_PRICE =
'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
const GET_ALL_TRANSPORTATIONS_ORDERS = 'rc/api/Transportation/get'; const GET_ALL_TRANSPORTATIONS_ORDERS = 'rc/api/Transportation/get';
@ -160,15 +133,13 @@ const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects';
///babyInformation ///babyInformation
const GET_BABYINFORMATION_REQUEST = const GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID';
'Services/Community.svc/REST/GetBabyByUserID';
///Get Baby By User ID ///Get Baby By User ID
const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation ///userInformation
const GET_USERINFORMATION_REQUEST = const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New';
'Services/Community.svc/REST/GetUserInformation_New';
///Update email ///Update email
const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail';
@ -190,34 +161,24 @@ const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable';
const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities';
///BloodDetails ///BloodDetails
const GET_BLOOD_REQUEST = const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
const SAVE_BLOOD_REQUEST = const SAVE_BLOOD_REQUEST = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const GET_BLOOD_AGREEMENT = const GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation';
'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; const SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
const SAVE_BLOOD_AGREEMENT =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
///Reports ///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail';
const SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate ///Rate
// const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; // const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
const IS_LAST_APPOITMENT_RATED = const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async';
'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async'; const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
const GET_APPOINTMENT_DETAILS_BY_NO = const NEW_RATE_APPOINTMENT_URL = "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate";
'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; const NEW_RATE_DOCTOR_URL = "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate";
const NEW_RATE_APPOINTMENT_URL =
"Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate";
const NEW_RATE_DOCTOR_URL =
"Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate";
const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
@ -225,8 +186,7 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get active appointment list //URL to get active appointment list
const GET_ACTIVE_APPOINTMENTS_LIST_URL = const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
"Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
//URL to get projects list //URL to get projects list
const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
@ -235,128 +195,93 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to dental doctors list //URL to dental doctors list
const GET_DENTAL_DOCTORS_LIST_URL = const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
"Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
//URL to get doctor free slots //URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment //URL to insert appointment
const INSERT_SPECIFIC_APPOINTMENT = const INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment";
"Services/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share //URL to get patient share
const GET_PATIENT_SHARE = const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history //URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY = const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const DOCTOR_SCHEDULE_URL = const DOCTOR_SCHEDULE_URL = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const SEND_REPORT_EYE_EMAIL = const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
"Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
"Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
// const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; // const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async";
"Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async";
//URL to confirm appointment //URL to confirm appointment
const CONFIRM_APPOINTMENT = const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment";
"Services/MobileNotifications.svc/REST/ConfirmAppointment";
const INSERT_VIDA_REQUEST = const INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
"Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
//URL to cancel appointment //URL to cancel appointment
const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR //URL get appointment QR
const GENERATE_QR_APPOINTMENT = const GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo";
"Services/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR //URL send email appointment QR
const EMAIL_QR_APPOINTMENT = const EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
"Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL check payment status //URL check payment status
const CHECK_PAYMENT_STATUS = const CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
"Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
//URL create advance payment //URL create advance payment
const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
const HIS_CREATE_ADVANCE_PAYMENT = const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment";
"Services/Patients.svc/REST/HIS_CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST = const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const IS_ALLOW_ASK_DOCTOR = const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const GET_CALL_REQUEST_TYPE = const ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart';
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const ADD_VIDA_REQUEST =
'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart';
const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_LIVECARE_CLINICS = const GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
const GET_LIVECARE_SCHEDULE_CLINICS = const GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
const GET_PATIENT_SHARE_LIVECARE = const GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
const GET_LIVECARE_CLINIC_TIMING = const GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
const GET_ER_APPOINTMENT_FEES = const GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime';
const ADD_NEW_CALL_FOR_PATIENT_ER = const ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER';
'Services/DoctorApplication.svc/REST/NewCallForPatientER';
const GET_LIVECARE_HISTORY = const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const CANCEL_LIVECARE_REQUEST = const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL =
'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const APPLE_PAY_INSERT_REQUEST = const APPLE_PAY_INSERT_REQUEST = 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert';
'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert';
const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
const GET_PATIENT_HEALTH_STATS = const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts';
'Services/Patients.svc/REST/Med_GetTransactionsSts';
const SEND_CHECK_IN_NFC_REQUEST = const SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
const HAS_DENTAL_PLAN = const HAS_DENTAL_PLAN = 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation';
'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation';
//URL to get medicine and pharmacies list //URL to get medicine and pharmacies list
const CHANNEL = 3; const CHANNEL = 3;
@ -377,21 +302,16 @@ var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE = const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails";
"Services/Patients.svc/REST/Get_PatientInsuranceDetails"; const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const GET_PAtIENTS_INSURANCE_UPDATED =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_PATIENT_INSURANCE_DETAILS = const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_Async";
"Services/Patients.svc/REST/GetApprovalStatus_Async";
// const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; // const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
@ -402,86 +322,54 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail';
const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
const GET_PATIENT_INFO_BY_ID = const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber';
'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber';
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_COVID_DRIVETHRU_PROJECT_LIST = const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
const GET_COVID_DRIVETHRU_PAYMENT_INFO = const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
const GET_COVID_DRIVETHRU_FREE_SLOTS = const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
const GET_COVID_DRIVETHRU_PROCEDURES_LIST = const GET_COVID_DRIVETHRU_PROCEDURES_LIST = 'Services/Doctors.svc/REST/COVID19_GetTestProcedures';
'Services/Doctors.svc/REST/COVID19_GetTestProcedures';
///Smartwatch Integration Services ///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD = const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord';
'Services/Patients.svc/REST/Med_GetPatientLastRecord'; const INSERT_PATIENT_HEALTH_DATA = 'Services/Patients.svc/REST/Med_InsertTransactions';
const INSERT_PATIENT_HEALTH_DATA =
'Services/Patients.svc/REST/Med_InsertTransactions';
///My Trackers ///My Trackers
const GET_DIABETIC_RESULT_AVERAGE = const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const GET_DIABTEC_RESULT = const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT = const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
'Services/Patients.svc/REST/Patient_AddDiabtecResult'; const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_BLOOD_PRESSURE_RESULT = const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const ADD_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult';
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const GET_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
const ADD_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; const SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport';
const DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = const DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus';
'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
const GET_CALL_INFO_HOURS_RESULT = const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport';
'Services/Doctors.svc/REST/GetCallInfoHoursResult'; const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
const GET_CALL_REQUEST_TYPE_LOV =
'Services/Doctors.svc/REST/GetCallRequestType_LOV'; const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
const UPDATE_DIABETIC_RESULT =
'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
const SEND_AVERAGE_BLOOD_SUGAR_REPORT =
'Services/Notifications.svc/REST/SendAverageBloodSugarReport';
const DEACTIVATE_DIABETIC_STATUS =
'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus';
const DEACTIVATE_BLOOD_PRESSURES_STATUS =
'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus';
const UPDATE_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
const SEND_AVERAGE_BLOOD_WEIGHT_REPORT =
'Services/Notifications.svc/REST/SendAverageBodyWeightReport';
const SEND_AVERAGE_BLOOD_PRESSURE_REPORT =
'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
const UPDATE_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT =
'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse';
const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus';
const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
@ -489,35 +377,25 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
// H2O // H2O
const H2O_GET_USER_PROGRESS = const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
"Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
const H2O_INSERT_USER_ACTIVITY = const H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New";
"Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; const H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New";
const H2O_GET_USER_DETAIL = const H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity";
"Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New";
const H2O_UPDATE_USER_DETAIL =
"Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New";
const H2O_UNDO_USER_ACTIVITY =
"Services/H2ORemainder.svc/REST/H2o_UndoUserActivity";
//E_Referral Services //E_Referral Services
const GET_ALL_RELATIONSHIP_TYPES = const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes";
"Services/Patients.svc/REST/GetAllRelationshipTypes"; const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// Encillary Orders // Encillary Orders
const GET_ANCILLARY_ORDERS = const GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
const GET_ANCILLARY_ORDERS_DETAILS = const GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
//Pharmacy wishlist //Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
@ -550,50 +428,32 @@ const GET_SHIPPING_OPTIONS = "get_shipping_option/";
const DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; const DELETE_SHOPPING_CART = "delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "orders"; const ORDER_SHOPPING_CART = "orders";
const GET_LACUM_ACCOUNT_INFORMATION = const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation";
"Services/Patients.svc/REST/GetLakumAccountInformation"; const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const GET_LACUM_GROUP_INFORMATION = const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation";
"Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; const LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation";
const LACUM_ACCOUNT_ACTIVATE = const CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount";
"Services/Patients.svc/REST/LakumAccountActivation"; const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LACUM_ACCOUNT_DEACTIVATE = const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
"Services/Patients.svc/REST/LakumAccountDeactivation";
const CREATE_LAKUM_ACCOUNT =
"Services/Patients.svc/REST/PHR_CreateLakumAccount";
const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS = "mostview"; const GET_MOST_VIEWED_PRODUCTS = "mostview";
const GET_NEW_PRODUCTS = "newproducts"; const GET_NEW_PRODUCTS = "newproducts";
// Home Health Care // Home Health Care
const HHC_GET_ALL_SERVICES = const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
"Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
const HHC_GET_ALL_CMC_SERVICES = const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder";
"Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const PATIENT_ER_UPDATE_PRES_ORDER = const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
"Services/Patients.svc/REST/PatientER_UpdatePresOrder";
const GET_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = const GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const GET_PATIENT_ALL_PRES_ORD =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
// HHC RC SERVICES // HHC RC SERVICES
const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc"; const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc";
@ -618,6 +478,7 @@ const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "rc/api/Prescription/info"; const GET_ALL_PRESCRIPTION_INFO_RC = "rc/api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update'; const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update';
//Pharmacy wishlist //Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/"; const GET_WISHLIST = "shopping_cart_items/";
const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id="; const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id=";
@ -636,21 +497,17 @@ const GET_CUSTOMER_INFO = "VerifyCustomer";
//Pharmacy //Pharmacy
const GET_PHARMACY_CATEGORISE = const GET_PHARMACY_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
const GET_OFFERS_CATEGORISE = 'discountcategories'; const GET_OFFERS_CATEGORISE = 'discountcategories';
const GET_OFFERS_PRODUCTS = 'offerproducts/'; const GET_OFFERS_PRODUCTS = 'offerproducts/';
const GET_CATEGORISE_PARENT = const GET_CATEGORISE_PARENT = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_PARENT_PRODUCTS = 'products?categoryid='; const GET_PARENT_PRODUCTS = 'products?categoryid=';
const GET_SUB_CATEGORISE = const GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_SUB_PRODUCTS = 'products?categoryid='; const GET_SUB_PRODUCTS = 'products?categoryid=';
const GET_FINAL_PRODUCTS = const 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='; '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=';
const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory';
const GET_DISEASE_BY_CLINIC_ID = const GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime';
const TIMER_MIN = 10; const TIMER_MIN = 10;
@ -666,17 +523,13 @@ const SCAN_QR_CODE = 'productbysku/';
const FILTERED_PRODUCTS = 'products?categoryids='; const FILTERED_PRODUCTS = 'products?categoryids=';
const GET_DOCTOR_LIST_CALCULATION = const GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors";
"Services/Doctors.svc/REST/GetCallculationDoctors";
const GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = const GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = "Services/Patients.svc/REST/GetDentalAppointments";
"Services/Patients.svc/REST/GetDentalAppointments";
const GET_DENTAL_APPOINTMENT_INVOICE = const GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo";
"Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo";
const SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = const SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental";
"Services/Notifications.svc/REST/SendInvoiceForDental";
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -630,6 +630,16 @@ const Map localizedValues = {
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
"refine": {"en": "Refine", "ar": "تصفية"}, "refine": {"en": "Refine", "ar": "تصفية"},
"max": {"en": "Max", "ar": "اعلى"},
"addToCompareMsg": {"en": "You have added a product to the Compare list", "ar": "تمت الاضافه لقائمة المقارنه"},
"itInListMsg": {"en": "Item is already in the list", "ar": "المنتج موجود في القائمه"},
"compareListFull": {"en": "Your compare list is full", "ar": "قائمة المقارنة ممتلئه"},
"addQuantity": {"en": "You should add quantity", "ar": "اختر الكمية"},
"addToCartMsg": {"en": "You have added a product to the cart", "ar": "تمت اضافة المنتج بنجاح"},
"addToWishlistMsg": {"en": "You have added a product to the Wishlist", "ar": "تمت الاضافة لقائمة الرغبات"},
"notifyMeMsg": {"en": "You will be notified when product available", "ar": "سيتم اخبارك في حال توفر المنتج"},
"removeFromWishlistMsg": {"en": "You have removed a product from the Wishlist", "ar": "تمت ازالة المنتج بنجاح"},
"min": {"en": "Min", "ar": "اقل"},
"reset": {"en": "Reset", "ar": "اعادة تعيين"}, "reset": {"en": "Reset", "ar": "اعادة تعيين"},
"apply": {"en": "Apply", "ar": "تطبيق"}, "apply": {"en": "Apply", "ar": "تطبيق"},
"viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"}, "viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"},
@ -1631,10 +1641,50 @@ const Map localizedValues = {
"RRTTitle": {"en": "RRT", "ar": "خدمة فريق"}, "RRTTitle": {"en": "RRT", "ar": "خدمة فريق"},
"RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"}, "RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"},
"transportation": {"en": "Transportation", "ar": "النقل"}, "transportation": {"en": "Transportation", "ar": "النقل"},
"neck": {"en": "Neck", "ar": "رقبه"}, "neck": {"en": "Neck", "ar": "رقبه"},
"waist": {"en": "Waist", "ar": "وسط"}, "waist": {"en": "Waist", "ar": "وسط"},
"hip": {"en": "Hip", "ar": "ورك او نتوء"}, "hip": {"en": "Hip", "ar": "ورك او نتوء"},
"carbsProtin": {"en": "Carbs, Protein and Fat", "ar": "الكربوهيدرات والبروتينات والدهون"}, "carbsProtin": {"en": "Carbs, Protein and Fat", "ar": "الكربوهيدرات والبروتينات والدهون"},
"usefulInfo": {"en": "Useful Information", "ar": "معلومات مفيدة"},
"babyAge": {"en": "Baby Age", "ar": "عمر الطفل الآن:"},
"babyAgeAvail": {"en": "baby age is not available", "ar": "عمر الطفل غير متوفر"},
"deliveryDue": {"en": "The delivery due date is estimated to be on the", "ar": "من المقدر أن يكون تاريخ استحقاق التسليم في"},
"almostInactive": {"en": "Almost Inactive(Little or no exercises)", "ar": "شبه غير نشط (تمارين قليلة أو معدومة)"},
"lightActive1": {"en": "Lighty Active (1-3) days per week", "ar": "Lighty Active (1-3) أيام في الأسبوع"},
"veryActive": {"en": "very Active(6-7) days per week", "ar": "نشط جدا (6-7) أيام في الأسبوع"},
"superActive": {"en": "Super Active(very hard exercises)", "ar": "سوبر نشط (تمارين صعبة للغاية)"},
"dailyIntake": {"en": "Daily intake is", "ar": "المدخول اليومي"},
"calculateAmount": {"en": "Calculates the amount of energy that the persons body expends in a day", "ar": "تحسب كمية الطاقة التي يبذلها جسم الشخص في اليوم"},
"bodyWillBurn": {"en": "This means the body will burn", "ar": "هذا يعني أن الجسم سوف يحترق"},
"caloriesEachDay": {"en": "calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is", "ar": "السعرات الحرارية في كل يوم ، إذا لم تمارس أي نشاط طوال اليوم .. ملاحظة: متطلبات السعرات الحرارية اليومية هي"},
"maintainWeight": {"en": "calories, to maintain the current weight.", "ar": "السعرات الحرارية للحفاظ على الوزن الحالي."},
"mediumFinger": {"en": "Medium(fingers touch)", "ar": "متوسطة (لمسة الأصابع)"},
"smallFinger": {"en": "Small(fingers overlap)", "ar": "صغير (أصابع متداخلة)"},
"largeFinger": {"en": "Large(fingers don\'n touch)", "ar": "كبير (لا تلمس الأصابع)"},
"idealBodyWeight": {"en": "Calculates the ideal body weight based on height, Weight, and Body Size", "ar": "يحسب وزن الجسم المثالي بناءً على الطول والوزن وحجم الجسم"},
"bodyFrameSize": {"en": "Body Frame Size", "ar": "حجم إطار الجسم"},
"idealWeightRange": {"en": "Ideal weight range is", "ar": "نطاق الوزن المثالي هو"},
"currentWeightPerfect": {"en": "Congratulations! The current weight is perfect and considered healthy", "ar": "تهانينا! الوزن الحالي مثالي ويعتبر صحي"},
"littleBitWeightMore": {"en": "This means that the weight is a little bit more than ideal weight by", "ar": "هذا يعني أن الوزن أكثر قليلاً من الوزن المثالي به"},
"consultWithDoctor": {"en": "May wish to consult with the doctor for medical help. Click to view our list of Doctors", "ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء لدينا"},
"excessiveObesity": {"en": "Means that you suffer from excessive obesity by", "ar": "يعني أنك تعاني من السمنة المفرطة بها"},
"mayWish": {"en": "May wish to consult with the doctor for medical help. Click to view our list of\n Doctors", "ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء \ n الخاصة بنا"},
"essential": {"en": "The category falls under essential", "ar": "الفئة تندرج تحت الأساسية"},
"athlete": {"en": "The category falls under athlete", "ar": "فئة تندرج تحت رياضي"},
"fitness": {"en": "The category falls under fitness", "ar": "الفئة تندرج تحت اللياقة البدنية"},
"acceptable": {"en": "The category falls under acceptable", "ar": "الفئة تندرج تحت مقبول"},
"underObese": {"en": "The category falls under obese", "ar": "تندرج الفئة تحت السمنة"},
"crossedLimits": {"en": "Please check the value you have entered, since the body fat percentage has crosed the limits.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، لأن نسبة الدهون في الجسم تجاوزت الحدود."},
"lowLimits": {"en": "Please check the value you have entered, since the body fat percentage cannot be this low.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، حيث لا يمكن أن تكون نسبة الدهون في الجسم منخفضة."},
"estimates": {"en": "Estimates the total body fat based on\nthe size", "ar": "تقدير إجمالي الدهون في الجسم بناءً على \ n الحجم"},
"myCart": {"en": "Cart", "ar": "عربة التسوق"}, "myCart": {"en": "Cart", "ar": "عربة التسوق"},
"browseOffers": {"en": "Browse offers by clinic", "ar": "تصفح العروض حسب العيادة"}, "browseOffers": {"en": "Browse offers by clinic", "ar": "تصفح العروض حسب العيادة"},
"inactiveAct":{"en":"Almost inactive (little or no exercise)","ar":"غير نشط تقريبا (ممارسة الرياضة قليلة أو منعدمة)"}, "inactiveAct":{"en":"Almost inactive (little or no exercise)","ar":"غير نشط تقريبا (ممارسة الرياضة قليلة أو منعدمة)"},
@ -1650,10 +1700,7 @@ const Map localizedValues = {
"bodyFrameMedium": {"en": "Medium (fingers touch)", "ar": "متوسط (الأصابع تتلامس)"}, "bodyFrameMedium": {"en": "Medium (fingers touch)", "ar": "متوسط (الأصابع تتلامس)"},
"bodyFrameLarge": {"en": "Large (fingers don't touch)", "ar": "عريض (الأصابع لا تتلامس)"}, "bodyFrameLarge": {"en": "Large (fingers don't touch)", "ar": "عريض (الأصابع لا تتلامس)"},
"bodyFatDesc": {"en": "Estimates the total body fat based on the size", "ar": "حساب الدهون في الجسم بناءاً على الحجم"}, "bodyFatDesc": {"en": "Estimates the total body fat based on the size", "ar": "حساب الدهون في الجسم بناءاً على الحجم"},
"essential":{"en":"The category falls under Essential Fat.","ar":"تندرج تحت فئة دهون أساسية"},
"athlete":{"en":" The category falls under Athlete.","ar":"تندرج تحت فئة دهون جسم رياضي"},
"fitness":{"en":" The category falls under Fitness.","ar":"تندرج تحت فئة دهون جسم صحي"},
"acceptable":{"en":"The category falls under Acceptable","ar":"تندرج تحت فئة دهون مقبولة"},
"obeseBodyFat":{"en":"The category falls under Obese.","ar":"تندرج تحت فئة دهون جسم سمين"}, "obeseBodyFat":{"en":"The category falls under Obese.","ar":"تندرج تحت فئة دهون جسم سمين"},
"invalid":{"en":"Invalid input for calculation.","ar":"البيانات المدخلة غير صالحة للحساب"}, "invalid":{"en":"Invalid input for calculation.","ar":"البيانات المدخلة غير صالحة للحساب"},
"more":{"en":"Please check the value you have entered, since the body fat percentage has crossed the limits.","ar":"يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم قد تجاوزت الحدود"}, "more":{"en":"Please check the value you have entered, since the body fat percentage has crossed the limits.","ar":"يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم قد تجاوزت الحدود"},
@ -1667,4 +1714,10 @@ const Map localizedValues = {
"dietModerate":{"en":"Moderate Carb","ar":"حمية معتدلة الكربوهيدرات"}, "dietModerate":{"en":"Moderate Carb","ar":"حمية معتدلة الكربوهيدرات"},
"dietUSDA":{"en":"USDA Guidelines","ar":"ارشادات وزارة الزراعة الأمريكية"}, "dietUSDA":{"en":"USDA Guidelines","ar":"ارشادات وزارة الزراعة الأمريكية"},
"dietZone":{"en":"Zone Diet","ar":"حمية زون"}, "dietZone":{"en":"Zone Diet","ar":"حمية زون"},
"Protein": {"en": "Protein", "ar": "بروتين"},
"Cals": {"en": "Cals", "ar": "كالس"},
"gramsPerDay": {"en": "Grams Per Day", "ar": "غرام في اليوم"},
"gr": {"en": "gr", "ar": "غرام"},
"gramsPerMeal": {"en": "Grams Per Meal", "ar": "عدد الجرامات لكل وجبة"},
}; };

@ -225,13 +225,12 @@ class PrescriptionsService extends BaseService {
}, body: _requestPrescriptionReportEnh.toJson()); }, body: _requestPrescriptionReportEnh.toJson());
} }
Future updatePressOrderRC({@required int presOrderID, @required String patientID}) async { Future updatePressOrderRC({@required int presOrderID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['Id'] = presOrderID; body['Id'] = presOrderID;
body['StatusId'] = 6; body['StatusId'] = 6;
body['ClickButton'] = 14; body['ClickButton'] = 14;
body['PatientID'] = patientID;
await baseAppClient.post(UPDATE_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(UPDATE_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -31,6 +31,8 @@ class ProductDetailViewModel extends BaseViewModel {
String get stockAvailability => _productDetailService.stockAvailability; String get stockAvailability => _productDetailService.stockAvailability;
String get stockAvailabilityn => _productDetailService.stockAvailabilityn;
bool get isStockAvailable => _productDetailService.isStockAvailable; bool get isStockAvailable => _productDetailService.isStockAvailable;
Future getProductReviewsData(productID) async { Future getProductReviewsData(productID) async {
@ -55,10 +57,10 @@ class ProductDetailViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future notifyMe(customerId, itemID) async { Future notifyMe(customerId, itemID, context) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _productDetailService.notifyMe(customerId, itemID); await _productDetailService.notifyMe(customerId, itemID, context);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
error = _productDetailService.error; error = _productDetailService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -66,10 +68,10 @@ class ProductDetailViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future addToCartData(quantity, itemID) async { Future addToCartData(quantity, itemID, context) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
var resp = await _productDetailService.addToCart(quantity, itemID); var resp = await _productDetailService.addToCart(quantity, itemID, context);
ShoppingCartResponse object = _handleGetShoppingCartResponse(resp); ShoppingCartResponse object = _handleGetShoppingCartResponse(resp);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
error = _productDetailService.error; error = _productDetailService.error;
@ -103,11 +105,11 @@ class ProductDetailViewModel extends BaseViewModel {
return cartResponse; return cartResponse;
} }
Future addToWishlistData(itemID) async { Future addToWishlistData(itemID, context) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext); GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
await _productDetailService.addToWishlist(itemID); await _productDetailService.addToWishlist(itemID, context);
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext); GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
@ -128,11 +130,11 @@ class ProductDetailViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future deleteWishlistData(itemID) async { Future deleteWishlistData(itemID, context) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext); GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
await _productDetailService.deleteItemFromWishlist(itemID); await _productDetailService.deleteItemFromWishlist(itemID, context);
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext); GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {

@ -25,6 +25,9 @@ class SendActivationRequest {
String dob; String dob;
int isHijri; int isHijri;
String healthId; String healthId;
int responseID;
int status;
SendActivationRequest( SendActivationRequest(
{this.patientMobileNumber, {this.patientMobileNumber,
this.mobileNo, this.mobileNo,
@ -51,7 +54,9 @@ class SendActivationRequest {
this.sMSSignature, this.sMSSignature,
this.dob, this.dob,
this.isHijri, this.isHijri,
this.healthId}); this.healthId,
this.responseID,
this.status});
SendActivationRequest.fromJson(Map<String, dynamic> json) { SendActivationRequest.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber']; patientMobileNumber = json['PatientMobileNumber'];
@ -80,6 +85,8 @@ class SendActivationRequest {
dob = json['DOB']; dob = json['DOB'];
isHijri = json['IsHijri']; isHijri = json['IsHijri'];
healthId = json['HealthId']; healthId = json['HealthId'];
responseID = json['ReponseID'];
status = json['Status'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -110,6 +117,8 @@ class SendActivationRequest {
data['DOB'] = dob; data['DOB'] = dob;
data['IsHijri'] = isHijri; data['IsHijri'] = isHijri;
data['HealthId'] = healthId; data['HealthId'] = healthId;
data['ResponseID'] = responseID;
data['Status'] = status;
return data; return data;
} }
} }

@ -2,7 +2,8 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -48,7 +49,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
// int height = 0; // int height = 0;
// int weight = 0; // int weight = 0;
double bmrResult = 0; double bmrResult = 0;
String dropdownValue = ''; String dropdownValue = null;
double calories = 0; double calories = 0;
void updateColor(int type) { void updateColor(int type) {
@ -121,14 +122,14 @@ class _BmrCalculatorState extends State<BmrCalculator> {
bmrResult = bmrResult.roundToDouble(); bmrResult = bmrResult.roundToDouble();
} }
void calculateCalories() { void calculateCalories(BuildContext context) {
if (dropdownValue == TranslationBase.of(context).inactiveAct) { if (dropdownValue == TranslationBase.of(context).almostInactive) {
calories = bmrResult * 1.2; calories = bmrResult * 1.2;
} else if (dropdownValue == TranslationBase.of(context).light) { } else if (dropdownValue == TranslationBase.of(context).lightActive1) {
calories = bmrResult * 1.375; calories = bmrResult * 1.375;
} else if (dropdownValue == TranslationBase.of(context).very) { } else if (dropdownValue == TranslationBase.of(context).veryActive) {
calories = bmrResult * 1.55; calories = bmrResult * 1.55;
} else if (dropdownValue == TranslationBase.of(context).superAct) { } else if (dropdownValue == TranslationBase.of(context).superActive) {
calories = bmrResult * 1.725; calories = bmrResult * 1.725;
} else if (dropdownValue == "") { } else if (dropdownValue == "") {
calories = bmrResult * 10.725; calories = bmrResult * 10.725;
@ -137,7 +138,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
dropdownValue = TranslationBase.of(context).light; if (dropdownValue == null) dropdownValue = TranslationBase.of(context).lightActive1;
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)]; _weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)]; _heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
@ -148,7 +149,16 @@ class _BmrCalculatorState extends State<BmrCalculator> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bmr, appBarTitle: TranslationBase.of(context).bmr,
showHomeAppBarIcon: true, showHomeAppBarIcon: false,
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
child: Icon(
Icons.info_outline,
color: Colors.white,
),
)
],
body: Container( body: Container(
height: double.infinity, height: double.infinity,
width: double.infinity, width: double.infinity,
@ -162,7 +172,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).bmrDesc, TranslationBase.of(context).calculateAmount,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -347,7 +357,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
height: 18, height: 18,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
value: dropdownValue, value: dropdownValue, key: clinicDropdownKey,
icon: Icon(Icons.arrow_downward), icon: Icon(Icons.arrow_downward),
iconSize: 0, iconSize: 0,
elevation: 16, elevation: 16,
@ -363,14 +373,14 @@ class _BmrCalculatorState extends State<BmrCalculator> {
}); });
}, },
items: <String>[ items: <String>[
TranslationBase.of(context).inactiveAct, TranslationBase.of(context).almostInactive,
TranslationBase.of(context).light, TranslationBase.of(context).lightActive1,
TranslationBase.of(context).very, TranslationBase.of(context).veryActive,
TranslationBase.of(context).superAct, TranslationBase.of(context).superActive
].map<DropdownMenuItem<String>>((String value) { ].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)), child: Text(value),
); );
}).toList(), }).toList(),
), ),
@ -397,12 +407,14 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
() { color: CustomColors.accentColor,
onTap: () {
setState(() { setState(() {
calculateBmr(); calculateBmr();
calculateCalories(); calculateCalories(context);
{ {
Navigator.push( Navigator.push(
context, context,

@ -5,7 +5,9 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,7 +26,6 @@ class BmrResultPage extends StatelessWidget {
isShowDecPage: false, isShowDecPage: false,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
showHomeAppBarIcon: true,
appBarTitle: TranslationBase.of(context).bmr, appBarTitle: TranslationBase.of(context).bmr,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -36,7 +37,7 @@ class BmrResultPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Calories", TranslationBase.of(context).calories,
style: TextStyle( style: TextStyle(
fontSize: 19, fontSize: 19,
letterSpacing: -1.34, letterSpacing: -1.34,
@ -64,7 +65,7 @@ class BmrResultPage extends StatelessWidget {
height: 5.0, height: 5.0,
), ),
Text( Text(
'Calories', TranslationBase.of(context).calories,
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
letterSpacing: -1.08, letterSpacing: -1.08,
@ -79,23 +80,31 @@ class BmrResultPage extends StatelessWidget {
), ),
mHeight(20), mHeight(20),
Text( Text(
'This means the body will burn (${bmrResult.toStringAsFixed(1)}) calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is (${calories.toStringAsFixed(1)}) calories, to maintain the current weight.', TranslationBase.of(context).bodyWillBurn+' ( ${bmrResult.toStringAsFixed(1)} )'+TranslationBase.of(context).caloriesEachDay+'( ${calories.toStringAsFixed(1)} ) '+TranslationBase.of(context).maintainWeight,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600, color: CustomColors.textColor), style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor
),
), ),
], ],
).withBorderedContainer, ).withBorderedContainer,
), ),
mFlex(1), mFlex(1),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).viewDocList, label: TranslationBase.of(context).viewDocList,
() { color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
), ),
), ),
], ],
), ),
); );
@ -154,19 +163,18 @@ class BmrResultPage extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget { extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container( Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: Colors.white, color: Colors.white,
border: Border.all( border: Border.all(
color: Color(0xffefefef), color: Color(0xffefefef),
width: 1, width: 1,
), ),
), ),
child: this, child: this,
); );
} }

@ -175,7 +175,7 @@ class _BodyFatState extends State<BodyFat> {
} }
} }
void showTextResult() { void showTextResult(BuildContext context) {
if (isMale == false) { if (isMale == false) {
if (bodyFat > 9 && bodyFat <= 13) { if (bodyFat > 9 && bodyFat <= 13) {
textResult = TranslationBase.of(context).essential; textResult = TranslationBase.of(context).essential;
@ -186,11 +186,11 @@ class _BodyFatState extends State<BodyFat> {
} else if (bodyFat > 24 && bodyFat <= 31) { } else if (bodyFat > 24 && bodyFat <= 31) {
textResult = TranslationBase.of(context).acceptable; textResult = TranslationBase.of(context).acceptable;
} else if (bodyFat > 31 && bodyFat <= 60) { } else if (bodyFat > 31 && bodyFat <= 60) {
textResult = TranslationBase.of(context).obeseBodyFat; textResult = TranslationBase.of(context).underObese;
} else if (bodyFat > 60) { } else if (bodyFat > 60) {
textResult = TranslationBase.of(context).more; textResult = TranslationBase.of(context).crossedLimits;
} else if (bodyFat <= 9) { } else if (bodyFat <= 9) {
textResult = TranslationBase.of(context).less; textResult = TranslationBase.of(context).lowLimits;
} }
} else { } else {
if (bodyFat > 5 && fat <= 13) { if (bodyFat > 5 && fat <= 13) {
@ -200,11 +200,11 @@ class _BodyFatState extends State<BodyFat> {
} else if (bodyFat > 17 && bodyFat <= 24) { } else if (bodyFat > 17 && bodyFat <= 24) {
textResult = TranslationBase.of(context).fitness; textResult = TranslationBase.of(context).fitness;
} else if (bodyFat > 24 && bodyFat <= 45) { } else if (bodyFat > 24 && bodyFat <= 45) {
textResult = TranslationBase.of(context).obeseBodyFat; textResult = TranslationBase.of(context).underObese;
} else if (bodyFat > 45) { } else if (bodyFat > 45) {
textResult = TranslationBase.of(context).more; textResult = TranslationBase.of(context).crossedLimits;
} else if (bodyFat <= 5) { } else if (bodyFat <= 5) {
textResult = TranslationBase.of(context).less; textResult = TranslationBase.of(context).lowLimits;
} }
} }
} }
@ -222,8 +222,16 @@ class _BodyFatState extends State<BodyFat> {
isShowDecPage: false, isShowDecPage: false,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
showHomeAppBarIcon: true,
appBarTitle: TranslationBase.of(context).bodyFatTitle, appBarTitle: TranslationBase.of(context).bodyFatTitle,
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
child: Icon(
Icons.info_outline,
color: Colors.white,
),
)
],
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -449,7 +457,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
calculateBodyFat(); calculateBodyFat();
showTextResult(); showTextResult(context);
{ {
Navigator.push( Navigator.push(

@ -2,7 +2,8 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -84,8 +85,16 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showHomeAppBarIcon: true,
appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calcHealth}", appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calcHealth}",
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
child: Icon(
Icons.info_outline,
color: Colors.black,
),
)
],
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -252,6 +261,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
// dropdownKey.currentState; // dropdownKey.currentState;
@ -280,6 +290,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
value: dropdownValue, value: dropdownValue,
key: clinicDropdownKey,
icon: Icon(Icons.arrow_downward), icon: Icon(Icons.arrow_downward),
iconSize: 0, iconSize: 0,
elevation: 16, elevation: 16,
@ -295,15 +306,14 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
}); });
}, },
items: <String>[ items: <String>[
TranslationBase.of(context).inactiveAct, TranslationBase.of(context).almostInactive,
TranslationBase.of(context).light, TranslationBase.of(context).lightActive,
TranslationBase.of(context).very, TranslationBase.of(context).lightActive1,
TranslationBase.of(context).superAct, TranslationBase.of(context).superActive,
].map<DropdownMenuItem<String>>((String value) { ].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value, child: Text(value),
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)),
); );
}).toList(), }).toList(),
), ),
@ -328,9 +338,10 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
() { color: CustomColors.accentColor,
onTap: () {
setState(() { setState(() {
calculateCalories(); calculateCalories();
print(calories); print(calories);

@ -5,7 +5,9 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,7 +37,7 @@ class CalorieResultPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).calories, TranslationBase.of(context).calories,
style: TextStyle( style: TextStyle(
fontSize: 19, fontSize: 19,
letterSpacing: -1.34, letterSpacing: -1.34,
@ -73,14 +75,18 @@ class CalorieResultPage extends StatelessWidget {
], ],
), ),
progressColor: CustomColors.accentColor, progressColor: CustomColors.accentColor,
backgroundColor: CustomColors.darkGreyColor, backgroundColor: Colors.white,
), ),
), ),
mHeight(20), mHeight(20),
Text( Text(
TranslationBase.of(context).resultCalories.replaceAll("(#)", calorie.toStringAsFixed(1)), TranslationBase.of(context).dailyIntake+' ${calorie.toStringAsFixed(1)} '+TranslationBase.of(context).calories,
// 'Daily intake is ${calorie.toStringAsFixed(1)} calories', style: TextStyle(
style: TextStyle(fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600, color: CustomColors.textColor), fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor
),
), ),
], ],
).withBorderedContainer, ).withBorderedContainer,
@ -89,13 +95,15 @@ class CalorieResultPage extends StatelessWidget {
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).viewDocList, label: TranslationBase.of(context).viewDocList,
() { color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
), ),
), ),
], ],
), ),
); );

@ -171,7 +171,7 @@ class _CarbsState extends State<Carbs> {
height: 18, height: 18,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
value: dropdownValue, value: dropdownValue, key: clinicDropdownKey,
icon: Icon(Icons.arrow_downward), icon: Icon(Icons.arrow_downward),
iconSize: 0, iconSize: 0,
elevation: 16, elevation: 16,

@ -91,10 +91,10 @@ class CarbsResult extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Utils.tableColumnTitle("Description"), Utils.tableColumnTitle(TranslationBase.of(context).description),
Utils.tableColumnTitle("Protein"), Utils.tableColumnTitle(TranslationBase.of(context).Protein),
Utils.tableColumnTitle("Carbohydrate"), Utils.tableColumnTitle(TranslationBase.of(context).carbohydrate),
Utils.tableColumnTitle("Fat"), Utils.tableColumnTitle(TranslationBase.of(context).fat),
], ],
), ),
); );
@ -102,10 +102,10 @@ class CarbsResult extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Utils.tableColumnValue("Calories Per Day", isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(TranslationBase.of(context).calDay, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(pCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(cCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(cCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel),
], ],
), ),
); );
@ -113,20 +113,20 @@ class CarbsResult extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Utils.tableColumnValue("Grams Per Day", isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(TranslationBase.of(context).gramsPerDay, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(pCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(cCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(fCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(fCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
], ],
), ),
); );
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Utils.tableColumnValue('Grams Per Meal', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(TranslationBase.of(context).gramsPerMeal, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(pCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(cCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(fCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(fCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
], ],
), ),
); );

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -44,103 +46,114 @@ class _DeliveryDueState extends State<DeliveryDue> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).pregnancyTitle, appBarTitle: TranslationBase.of(context).pregnancyTitle,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
child: Column( child: Container(
children: [ padding: EdgeInsets.symmetric(horizontal: 21.0, vertical: 21.0),
Texts( child: Column(
TranslationBase.of(context).pregnancyDesc,
),
Divider(
//height: 2,
thickness: 2,
),
Column(
children: [ children: [
Texts( Text(
TranslationBase.of(context).pregnancyDateLabel, TranslationBase.of(context).pregnancyDesc,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
), ),
InkWell( Divider(
onTap: () { //height: 2,
DatePicker.showDatePicker( thickness: 1,
context, ),
showTitleActions: true, Column(
minTime: DateTime(DateTime.now().year - 1, 1, 1), children: [
maxTime: DateTime.now(), Text(
onConfirm: (date) { TranslationBase.of(context).pregnancyDateLabel,
print('confirm $date'); style: TextStyle(
setState(() { fontSize: 14,
bloodSugarDate = date; fontWeight: FontWeight.w600,
dateFrom = date.add(Duration(days: 10)); ),
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
bloodSugarDate = date;
dateFrom = date.add(Duration(days: 10));
dateTo = date.add(Duration(days: 20)); dateTo = date.add(Duration(days: 20));
conceivedDate = date.add(Duration(days: 14)); conceivedDate = date.add(Duration(days: 14));
deliveryDue = date.add(Duration(days: 280)); deliveryDue = date.add(Duration(days: 280));
firstTrimester = date.add(Duration(days: 85)); firstTrimester = date.add(Duration(days: 85));
secondTrimester = date.add(Duration(days: 190)); secondTrimester = date.add(Duration(days: 190));
thirdTrimester = date.add(Duration(days: 280)); thirdTrimester = date.add(Duration(days: 280));
}); });
},
currentTime: DateTime.now(),
);
}, },
currentTime: DateTime.now(), child: Container(
); padding: EdgeInsets.all(12),
}, margin: EdgeInsets.only(top: 15.0),
child: Container( width: double.infinity,
padding: EdgeInsets.all(12), height: 65,
margin: EdgeInsets.only(top: 15.0), decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
width: double.infinity, child: Row(
height: 65, mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Icon(Icons.date_range), Row(
Texts(TranslationBase.of(context).date), children: [
Icon(Icons.date_range),
Texts(TranslationBase.of(context).date),
],
),
Texts(getDate()),
], ],
), ),
Texts(getDate()), ),
],
), ),
), ],
), ),
], ],
), ),
SizedBox( ),
height: 280.0, ),
), ),
Container( Container(
height: 50.0, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
width: 350.0, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
() { color: CustomColors.accentColor,
setState(() { onTap: () {
{ setState(() {
Navigator.push( {
context, Navigator.push(
FadePage( context,
page: DeliveryDueResult( FadePage(
conceivedDate: conceivedDate, page: DeliveryDueResult(
dateFrom: dateFrom, conceivedDate: conceivedDate,
dateTo: dateTo, dateFrom: dateFrom,
deliveryDue: deliveryDue, dateTo: dateTo,
firstTrimester: firstTrimester, deliveryDue: deliveryDue,
secondTrimester: secondTrimester, firstTrimester: firstTrimester,
thirdTrimester: thirdTrimester, secondTrimester: secondTrimester,
)), thirdTrimester: thirdTrimester,
); )),
} );
}); }
}, });
), },
),
],
), ),
), ),
), ],
), ),
); );
} }

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -29,78 +32,102 @@ class DeliveryDueResult extends StatelessWidget {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).pregnancyTitle, appBarTitle: TranslationBase.of(context).pregnancyTitle,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 750.0, child: Container(
child: Column( padding: EdgeInsets.symmetric(horizontal: 21.0, vertical: 21.0),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Texts( children: [
TranslationBase.of(context).ovulationPeriod, Text(
fontWeight: FontWeight.w400, TranslationBase.of(context).pregnancyTitle,
), style: TextStyle(
Texts( fontSize: 19,
TranslationBase.of(context).from, letterSpacing: -1.14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
), ),
Texts(DateFormat.yMMMEd().format(dateFrom), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), ),
Texts( Text(
TranslationBase.of(context).to, TranslationBase.of(context).ovulationPeriod,
fontWeight: FontWeight.w400, style: TextStyle(
), fontSize: 14,
Texts(DateFormat.yMMMEd().format(dateTo), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), letterSpacing: -0.56,
Texts( fontWeight: FontWeight.w600,
TranslationBase.of(context).conceive, color: CustomColors.textColor,
fontWeight: FontWeight.w400, ),
), ),
Texts( mHeight(20),
DateFormat.yMMMEd().format(conceivedDate), showItem(TranslationBase.of(context).from, DateFormat.yMMMEd().format(dateFrom), titleColor: CustomColors.accentColor),
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, showItem(TranslationBase.of(context).to, DateFormat.yMMMEd().format(dateTo), titleColor: CustomColors.accentColor),
), mHeight(12),
Texts( mDivider(CustomColors.devider),
TranslationBase.of(context).firstTri, mHeight(12),
fontWeight: FontWeight.w400, showItem(TranslationBase.of(context).conceive, DateFormat.yMMMEd().format(conceivedDate)),
), mHeight(12),
Texts( mDivider(CustomColors.devider),
DateFormat.yMMMEd().format(firstTrimester), mHeight(12),
fontWeight: FontWeight.w800, showItem(TranslationBase.of(context).firstTri, DateFormat.yMMMEd().format(firstTrimester)),
fontSize: 21.0, mHeight(12),
), mDivider(CustomColors.devider),
Texts( mHeight(12),
TranslationBase.of(context).secondTri, showItem(TranslationBase.of(context).secondTri, DateFormat.yMMMEd().format(secondTrimester)),
fontWeight: FontWeight.w400, mHeight(12),
), mDivider(CustomColors.devider),
Texts( mHeight(12),
DateFormat.yMMMEd().format(secondTrimester), showItem(TranslationBase.of(context).thirdTri, DateFormat.yMMMEd().format(thirdTrimester)),
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, mDivider(CustomColors.devider),
), mHeight(12),
Texts( ],
TranslationBase.of(context).thirdTri, ).withBorderedContainer,
fontWeight: FontWeight.w400, ),
),
Texts(
DateFormat.yMMMEd().format(thirdTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: DefaultButton(
TranslationBase.of(context).seeDoctorsList,
() {
getDoctorsList(context);
},
),
),
],
), ),
), ),
), Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).seeDoctorsList,
color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context);
},
),
),
],
),
);
}
Widget showItem(String title, String value, {Color titleColor}) {
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: titleColor ?? Colors.black,
fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w600,
),
),
Text(
value,
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
), ),
); );
} }
@ -145,20 +172,11 @@ class DeliveryDueResult extends StatelessWidget {
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }
}); });
Navigator.push( Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: doctorsList,
patientDoctorAppointmentListHospital:
_patientDoctorAppointmentListHospital)));
} }
} }
}).catchError((err) { }).catchError((err) {
@ -167,3 +185,19 @@ class DeliveryDueResult extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,13 +1,11 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'ideal_body_result_page.dart'; import 'ideal_body_result_page.dart';
@ -36,7 +34,7 @@ class _IdealBodyState extends State<IdealBody> {
double overWeightBy; double overWeightBy;
int weight = 0; int weight = 0;
double idealWeight = 0; double idealWeight = 0;
String dropdownValue = TranslationBase.of(AppGlobal.context).bodyFrameMedium; String dropdownValue = null;
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
double maxIdealWeight; double maxIdealWeight;
@ -54,15 +52,17 @@ class _IdealBodyState extends State<IdealBody> {
List<PopupMenuItem> _heightPopupList = List(); List<PopupMenuItem> _heightPopupList = List();
List<PopupMenuItem> _weightPopupList = List(); List<PopupMenuItem> _weightPopupList = List();
void calculateIdealWeight() { void calculateIdealWeight() {
heightInches = int.parse(_heightController.text) * .39370078740157477; heightInches = int.parse(_heightController.text) * .39370078740157477;
heightFeet = heightInches / 12; heightFeet = heightInches / 12;
idealWeight = (50 + 2.3 * (heightInches - 60)); idealWeight = (50 + 2.3 * (heightInches - 60));
if (dropdownValue == TranslationBase.of(context).bodyFrameSmall) { if (dropdownValue == TranslationBase.of(context).smallFinger) {
idealWeight = idealWeight - 10; idealWeight = idealWeight - 10;
} else if (dropdownValue == TranslationBase.of(context).bodyFrameMedium) { } else if (dropdownValue == TranslationBase.of(context).mediumFinger) {
idealWeight = idealWeight; idealWeight = idealWeight;
} else if (dropdownValue == TranslationBase.of(context).bodyFrameLarge) { } else if (dropdownValue == TranslationBase.of(context).largeFinger) {
idealWeight = idealWeight + 10; idealWeight = idealWeight + 10;
} }
@ -75,7 +75,8 @@ class _IdealBodyState extends State<IdealBody> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); if(dropdownValue==null)
dropdownValue=TranslationBase.of(context).mediumFinger;
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)]; _weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)]; _heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
@ -85,7 +86,16 @@ class _IdealBodyState extends State<IdealBody> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).idealBody, appBarTitle: TranslationBase.of(context).idealBody,
showHomeAppBarIcon: true, showHomeAppBarIcon: false,
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
child: Icon(
Icons.info_outline,
color: Colors.white,
),
)
],
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -95,7 +105,7 @@ class _IdealBodyState extends State<IdealBody> {
child: Column( child: Column(
children: [ children: [
Text( Text(
TranslationBase.of(context).idealWeightDesc, TranslationBase.of(context).idealBodyWeight,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -178,7 +188,7 @@ class _IdealBodyState extends State<IdealBody> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).bodyFrame, TranslationBase.of(context).bodyFrameSize,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
letterSpacing: -0.44, letterSpacing: -0.44,
@ -190,7 +200,7 @@ class _IdealBodyState extends State<IdealBody> {
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
value: dropdownValue, value: dropdownValue,
icon: Icon(Icons.arrow_downward), icon: Icon(Icons.arrow_downward), key: clinicDropdownKey,
iconSize: 0, iconSize: 0,
elevation: 16, elevation: 16,
isExpanded: true, isExpanded: true,
@ -205,14 +215,13 @@ class _IdealBodyState extends State<IdealBody> {
}); });
}, },
items: <String>[ items: <String>[
TranslationBase.of(context).bodyFrameSmall, TranslationBase.of(context).smallFinger,
TranslationBase.of(context).bodyFrameMedium, TranslationBase.of(context).mediumFinger,
TranslationBase.of(context).bodyFrameLarge, TranslationBase.of(context).largeFinger,
].map<DropdownMenuItem<String>>((String value) { ].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value, child: Text(value),
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)),
); );
}).toList(), }).toList(),
), ),
@ -500,3 +509,5 @@ class CommonDropDownView extends StatelessWidget {
); );
} }
} }

@ -40,7 +40,7 @@ class IdealBodyResult extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Ideal weight range is', TranslationBase.of(context).idealWeightRange,
style: TextStyle( style: TextStyle(
fontSize: 19, fontSize: 19,
letterSpacing: -1.34, letterSpacing: -1.34,
@ -60,7 +60,7 @@ class IdealBodyResult extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, left: 4.0), padding: EdgeInsets.only(top: 8.0, left: 4.0),
child: Text( child: Text(
'Kg', " "+TranslationBase.of(context).kg+" ",
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
), ),
), ),
@ -80,7 +80,7 @@ class IdealBodyResult extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, left: 4.0), padding: EdgeInsets.only(top: 8.0, left: 4.0),
child: Text( child: Text(
'Kg', " "+TranslationBase.of(context).kg+" ",
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
), ),
), ),
@ -93,7 +93,7 @@ class IdealBodyResult extends StatelessWidget {
? Column( ? Column(
children: [ children: [
Texts( Texts(
'Congratulations! The current weight is perfect and considered healthy', TranslationBase.of(context).currentWeightPerfect,
fontSize: 20.0, fontSize: 20.0,
), ),
], ],
@ -101,9 +101,9 @@ class IdealBodyResult extends StatelessWidget {
: overWeightBy > 10 && overWeightBy < 17 : overWeightBy > 10 && overWeightBy < 17
? Column( ? Column(
children: [ children: [
Texts('This means that the weight is a little bit more than ideal weight by'), Texts(TranslationBase.of(context).littleBitWeightMore),
Texts(overWeightBy.toStringAsFixed(1)), Texts(overWeightBy.toStringAsFixed(1)),
Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'), Texts(TranslationBase.of(context).consultWithDoctor),
], ],
) )
: overWeightBy >= 18 : overWeightBy >= 18
@ -112,7 +112,7 @@ class IdealBodyResult extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Texts( Texts(
'Means that you suffer from excessive obesity by', TranslationBase.of(context).excessiveObesity,
), ),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
@ -128,7 +128,7 @@ class IdealBodyResult extends StatelessWidget {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
Texts('May wish to consult with the doctor for medical help. Click to view our list of\n Doctors'), Texts(TranslationBase.of(context).mayWish),
], ],
), ),
) )
@ -139,7 +139,7 @@ class IdealBodyResult extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
'Under Weight', TranslationBase.of(context).underWeight,
fontSize: 18.0, fontSize: 18.0,
), ),
), ),
@ -161,7 +161,7 @@ class IdealBodyResult extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Text( Text(
'under wheight', TranslationBase.of(context).underWeight,
style: TextStyle( style: TextStyle(
fontSize: 17, fontSize: 17,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -182,7 +182,7 @@ class IdealBodyResult extends StatelessWidget {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'), Texts(TranslationBase.of(context).mayWish),
], ],
), ),
), ),

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -20,8 +22,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
DateTime selectedDateTime = DateTime.now(); DateTime selectedDateTime = DateTime.now();
int cycleLength = 0;
int lutealPhaseLength = 0; // int cycleLength = 0;
// int lutealPhaseLength = 0;
String selectedDate; String selectedDate;
var dateFrom = DateTime.now(); var dateFrom = DateTime.now();
var babyAgeWeeks; var babyAgeWeeks;
@ -33,6 +36,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
var newFormat = DateFormat("yy-MM-dd"); var newFormat = DateFormat("yy-MM-dd");
String updatedDt; String updatedDt;
TextEditingController cycleLengthController = new TextEditingController();
TextEditingController lutelLengthController = new TextEditingController();
String getTime() { String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
} }
@ -64,286 +70,176 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).ovulation, appBarTitle: TranslationBase.of(context).ovulation,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 700.0, child: Container(
child: Column( padding: EdgeInsets.all(21),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Texts(TranslationBase.of(context).ovulationDesc),
SizedBox(
height: 12.0,
),
Divider(
//height: 2,
thickness: 2,
),
SizedBox(
height: 12.0,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
selectedDateTime = date;
});
},
currentTime: DateTime.now(),
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
),
),
),
SizedBox(
height: 5.0,
),
Texts(
TranslationBase.of(context).cycleLabel,
fontWeight: FontWeight.w400,
),
SizedBox(
height: 5.0,
),
Row(
children: [ children: [
Container( Text(
width: 340.0, TranslationBase.of(context).ovulationDesc,
height: 60.0, style: TextStyle(
decoration: BoxDecoration( fontSize: 14,
color: Colors.white, letterSpacing: -0.54,
color: Colors.black,
fontWeight: FontWeight.w600,
), ),
child: Row( ),
children: [ SizedBox(
Padding( height: 12.0,
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), ),
child: Center( InkWell(
child: Container( onTap: () {
width: 60.0, DatePicker.showDatePicker(
foregroundDecoration: BoxDecoration( context,
borderRadius: BorderRadius.circular(5.0), showTitleActions: true,
border: Border.all( minTime: DateTime(DateTime.now().year - 1, 1, 1),
color: Colors.blueGrey, maxTime: DateTime.now(),
width: 2.0, onConfirm: (date) {
), print('confirm $date');
), setState(() {
child: Row( selectedDateTime = date;
children: <Widget>[ });
Expanded( },
child: Center( currentTime: DateTime.now(),
child: Text(cycleLength.toString()), );
), },
), child: Container(
Container( padding: EdgeInsets.all(12),
height: 38.0, width: double.infinity,
child: Column( height: 65,
crossAxisAlignment: CrossAxisAlignment.center, decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
mainAxisAlignment: MainAxisAlignment.center, child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Container( children: [
decoration: BoxDecoration( Texts(TranslationBase.of(context).date),
border: Border( Texts(getDate()),
bottom: BorderSide( ],
width: 0.5, ),
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength < 45) cycleLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength > 0) cycleLength--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: cycleLength.toDouble(),
min: 0,
max: 45,
onChanged: (double newValue) {
setState(() {
cycleLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
), ),
), ),
SizedBox(
height: 12.0,
),
inputWidget(TranslationBase.of(context).cycleLabel, "0", cycleLengthController),
SizedBox(
height: 12.0,
),
inputWidget(TranslationBase.of(context).lutealLabel, "0", lutelLengthController),
], ],
), ),
Texts( ),
TranslationBase.of(context).lutealLabel, ),
fontWeight: FontWeight.w400, ),
), Container(
SizedBox( margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
height: 5.0, color: Colors.white,
), child: SecondaryButton(
Row( label: TranslationBase.of(context).calculate,
children: [ color: CustomColors.accentColor,
Container( onTap: () {
width: 340.0, calculateBabyInformation();
height: 60.0, Navigator.push(
decoration: BoxDecoration( context,
color: Colors.white, FadePage(
page: OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
babyAge: babyAgeWeeks,
babyAgeDays: babyAgeDays,
),
),
);
},
),
),
],
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
), ),
child: Row( prefixIconConstraints: BoxConstraints(minWidth: 50),
children: [ prefixIcon: prefix == null
Padding( ? null
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), : Text(
child: Center( "+" + prefix,
child: Container( style: TextStyle(
width: 60.0, fontSize: 14,
foregroundDecoration: BoxDecoration( height: 21 / 14,
borderRadius: BorderRadius.circular(5.0), fontWeight: FontWeight.w500,
border: Border.all( color: Color(0xff2E303A),
color: Colors.blueGrey, letterSpacing: -0.56,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(lutealPhaseLength.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength < 15) lutealPhaseLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength > 0) lutealPhaseLength--;
});
},
),
],
),
),
],
),
), ),
), ),
), contentPadding: EdgeInsets.zero,
Expanded( border: InputBorder.none,
child: Slider( focusedBorder: InputBorder.none,
value: lutealPhaseLength.toDouble(), enabledBorder: InputBorder.none,
min: 0,
max: 15,
onChanged: (double newValue) {
setState(() {
lutealPhaseLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
), ),
],
),
SizedBox(
height: 220.0,
),
Container(
height: 50.0,
width: 350.0,
child: DefaultButton(
TranslationBase.of(context).calculate,
() {
calculateBabyInformation();
Navigator.push(
context,
FadePage(
page: OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
babyAge: babyAgeWeeks,
babyAgeDays: babyAgeDays,
)),
);
},
), ),
), ],
], ),
), ),
), if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
), ),
), ),
); );

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -26,6 +29,7 @@ class OvulationResult extends StatelessWidget {
this.babyAge, this.babyAge,
this.babyAgeDays, this.babyAgeDays,
}); });
//var newFormat = DateFormat("yy-MM-dd"); //var newFormat = DateFormat("yy-MM-dd");
@override @override
@ -35,81 +39,105 @@ class OvulationResult extends StatelessWidget {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).ovulation, appBarTitle: TranslationBase.of(context).ovulation,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 750.0, child: Padding(
child: Column( padding: const EdgeInsets.all(21),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
'The next ovulation period is estimated to be:', TranslationBase.of(context).ovulation,
fontWeight: FontWeight.w400, style: TextStyle(
), fontSize: 19,
Texts( letterSpacing: -1.14,
'From:', fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400, ),
), ),
Texts( mHeight(20),
DateFormat.yMMMEd().format(dateFrom), Text(
fontWeight: FontWeight.w800, TranslationBase.of(context).ovulationPeriod,
fontSize: 21.0, style: TextStyle(
), fontSize: 14,
Texts( letterSpacing: -0.56,
'To:', fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400, color: CustomColors.textColor,
), ),
Texts( ),
DateFormat.yMMMEd().format(dateTo), mHeight(20),
fontWeight: FontWeight.w800, showItem(TranslationBase.of(context).from, DateFormat.yMMMEd().format(dateFrom), titleColor: CustomColors.accentColor),
fontSize: 21.0, mHeight(12),
), showItem(TranslationBase.of(context).to, DateFormat.yMMMEd().format(dateTo), titleColor: CustomColors.accentColor),
Texts( mHeight(12),
'Useful Information:', mDivider(CustomColors.devider),
color: Color(0xffC5272D), mHeight(12),
), Text(
Texts( TranslationBase.of(context).useFullInfo,
'You have conceived on:', style: TextStyle(
fontWeight: FontWeight.w400, fontSize: 14,
), letterSpacing: -0.56,
Texts( color: CustomColors.accentColor,
DateFormat.yMMMEd().format(conceivedDate), fontWeight: FontWeight.w500,
fontWeight: FontWeight.w800, ),
fontSize: 21.0, ),
), mHeight(12),
Texts( showItem(TranslationBase.of(context).conceive, DateFormat.yMMMEd().format(conceivedDate)),
'The baby\'s age right now:', mHeight(12),
fontWeight: FontWeight.w400, mDivider(CustomColors.devider),
), mHeight(12),
Texts( showItem(TranslationBase.of(context).babyAge, babyAge <= 0 ? TranslationBase.of(context).babyAgeAvail : babyAge.toString() + TranslationBase.of(context).week),
babyAge <= 0 ? "baby age is not available" : babyAge.toString() + " Weeks",
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, mDivider(CustomColors.devider),
), mHeight(12), showItem(TranslationBase.of(context).deliveryDue, DateFormat.yMMMEd().format(deliveryDue)),
Texts( ],
'The delivery due date is estimated to be on the: ', ).withBorderedContainer,
fontWeight: FontWeight.w400, ),
),
Texts(
DateFormat.yMMMEd().format(deliveryDue),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: DefaultButton(
TranslationBase.of(context).seeDoctorsList,
() {
getDoctorsList(context);
},
),
),
],
), ),
), ),
), Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).viewDocList,
color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context);
},
),
),
],
),
);
}
Widget showItem(String title, String value, {Color titleColor}) {
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: titleColor ?? Colors.black,
fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w600,
),
),
Text(
value,
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
), ),
); );
} }
@ -148,26 +176,17 @@ class OvulationResult extends StatelessWidget {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where( .where(
(elementClinic) => elementClinic.filterName == element.projectName, (elementClinic) => elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }
}); });
Navigator.push( Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: doctorsList,
patientDoctorAppointmentListHospital:
_patientDoctorAppointmentListHospital)));
} }
} }
}).catchError((err) { }).catchError((err) {
@ -175,5 +194,20 @@ class OvulationResult extends StatelessWidget {
print(err); print(err);
}); });
} }
}
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
} }

@ -88,6 +88,7 @@ class _BookConfirmState extends State<BookConfirm> {
null, null,
widget.doctor.noOfPatientsRate, widget.doctor.noOfPatientsRate,
"", "",
), ),
isNeedToShowButton: false, isNeedToShowButton: false,
), ),

@ -78,7 +78,8 @@ class DoctorView extends StatelessWidget {
if (doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic), if (doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic),
if (doctor.speciality != null) if (doctor.speciality != null)
Text( Text(
getDoctorSpeciality(this.doctor.speciality).trim(), this.doctor.speciality[0].trim(),
// getDoctorSpeciality(this.doctor.speciality).trim(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
if (doctor.nearestFreeSlot != null) if (doctor.nearestFreeSlot != null)

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
@ -17,7 +16,6 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -41,6 +39,7 @@ class _AddMember extends State<AddMember> {
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
var patientShareRequestID; var patientShareRequestID;
var patientShareResponseID;
@override @override
void initState() { void initState() {
@ -50,67 +49,71 @@ class _AddMember extends State<AddMember> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles, appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: isLoading == true body: isLoading == true
? AppCircularProgressIndicator() ? AppCircularProgressIndicator()
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), padding: EdgeInsets.all(21.0),
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[ child: Column(
Expanded( children: <Widget>[
flex: 2, Expanded(
child: AppText( flex: 1,
TranslationBase.of(context).enterNationalId, child: Text(
fontSize: SizeConfig.textMultiplier * 3.5, loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile,
textAlign: TextAlign.left, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
)), )),
Expanded( Expanded(
flex: 4, flex: 4,
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
//MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
// Container(
// child: TextFields(
// controller: nationalIDorFile,
// onChanged: (value) => {validateForm()},
// prefixIcon: Icon(loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, color: Colors.red),
// padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
// hintText: loginType == 1 ? TranslationBase.of(context).nationalID : TranslationBase.of(context).fileNo,
// ))
SizedBox(
height: 12,
),
inputWidget(loginType == 1 ? TranslationBase.of(context).nationalIdNumber : TranslationBase.of(context).medicalFileNumber, "Xxxxxxxxx", nationalIDorFile),
],
),
),
Expanded(
flex: 3,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Row( PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
children: <Widget>[ SizedBox(
Expanded( height: 12,
child: DefaultButton(
TranslationBase.of(context).add,
() => {this.addMember()},
color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
textColor: Colors.white,
))
],
), ),
inputWidget(loginType == 1 ? TranslationBase.of(context).nationalIdNumber : TranslationBase.of(context).medicalFileNumber, "Xxxxxxxxx", nationalIDorFile),
], ],
)) ),
]), ),
))); // Expanded(
// flex: 3,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).add,
// () => {this.addMember()},
// color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
// textColor: Colors.white,
// ),
// )
// ],
// ),
// ],
// ),
// )
],
),
),
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.all(21.0),
child: DefaultButton(
TranslationBase.of(context).add,
() => {this.addMember()},
color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
textColor: Colors.white,
)),
);
} }
void validateForm() { void validateForm() {
@ -158,31 +161,30 @@ class _AddMember extends State<AddMember> {
} }
insertFamilyData(addMemberResult) { insertFamilyData(addMemberResult) {
var request = InsertSharePatientFileReq(); sendActivationCode(addMemberResult);
request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID']; // var request = InsertSharePatientFileReq();
request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName']; // request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
request.status = 2; // request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
if (request.patientOutSA == 1) { // request.status = 2;
request.regionID = 2; // if (request.patientOutSA == 1) {
} else { // request.regionID = 2;
request.regionID = 1; // } else {
} // request.regionID = 1;
loading(true); // }
familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err){ // loading(true);
loading(false); // familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err) {
AppToast.showErrorToast(message: err); // loading(false);
}); // AppToast.showErrorToast(message: err);
// });
} }
sendActivationCode(result) { sendActivationCode(result) {
// var request = this.getCommonRequest(); // var request = this.getCommonRequest();
loading(true); loading(true);
patientShareRequestID = result['PatientShareRequestID']; patientShareResponseID = result['ShareFamilyFileObj']['ReponseID'];
familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text).then((result) => { familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text, patientShareResponseID).then((res) => {
if (result != null && result['isSMSSent'] == true) {this.startSMSService(1, result)} patientShareRequestID = res['PatientShareRequestID'],
// {loading(false), this.startSMSService(type)} if (res != null && res['isSMSSent'] == true) {this.startSMSService(1, res)}
// else
// {loading(false)}
}); });
} }
@ -207,7 +209,7 @@ class _AddMember extends State<AddMember> {
checkActivationCode(value, result) { checkActivationCode(value, result) {
Navigator.pop(context); Navigator.pop(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo).then((result) { familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo, patientShareRequestID, patientShareResponseID).then((result) {
SMSOTP.hideSMSBox(context); SMSOTP.hideSMSBox(context);
handleFamilyRequests(this.patientShareRequestID, 3); handleFamilyRequests(this.patientShareRequestID, 3);
}).catchError((err) { }).catchError((err) {
@ -219,12 +221,12 @@ class _AddMember extends State<AddMember> {
} }
handleFamilyRequests(id, stauts) { handleFamilyRequests(id, stauts) {
familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => { // familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE);
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
MY_FAMILIY, MY_FAMILIY,
) );
}); // });
} }
loading(flag) { loading(flag) {

@ -26,11 +26,11 @@ class AddFamilyMemberType extends StatelessWidget {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: [ children: [
SizedBox(height: 12), SizedBox(height: 21),
HabibLogoWidget(), HabibLogoWidget(),
SizedBox(height: 50), SizedBox(height: 21),
Text( Text(
TranslationBase.of(context).logintypeRadio, TranslationBase.of(context).registerInfoFamily,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
), ),
GridView( GridView(

@ -27,7 +27,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -159,113 +158,115 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return ListView.separated( return checkActive(snapshot.data.getAllSharedRecordsByStatusList) > 0
itemBuilder: (context, index) { ? ListView.separated(
if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3) itemBuilder: (context, index) {
return Container( if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3)
margin: EdgeInsets.all(5), return Container(
decoration: cardRadius( margin: EdgeInsets.all(5),
15, decoration: cardRadius(
elevation: 0, 15,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF), elevation: 0,
), color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF),
child: Container( ),
// height: 130,0xffFDA4B0 child: Container(
width: MediaQuery.of(context).size.width, // height: 130,0xffFDA4B0
padding: EdgeInsets.all(10), width: MediaQuery.of(context).size.width,
child: Row( padding: EdgeInsets.all(10),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white,
),
Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
fontSize: 12, color: Colors.white),
Texts(
snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
' ' +
TranslationBase.of(context).years +
', ' +
snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
fontSize: 12,
color: Colors.white),
],
),
Column(
children: [ children: [
SizedBox(height: 10), Column(
InkWell( crossAxisAlignment: CrossAxisAlignment.start,
onTap: () { children: <Widget>[
switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); Texts(
}, snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
child: Container( fontSize: 18,
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)), fontWeight: FontWeight.bold,
padding: EdgeInsets.fromLTRB(15, 10, 15, 10), color: Colors.white,
child: Row( ),
mainAxisAlignment: MainAxisAlignment.center, Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
children: [ fontSize: 12, color: Colors.white),
SvgPicture.asset("assets/images/new-design/switch.svg", Texts(
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white), snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
SizedBox( ' ' +
width: 5, TranslationBase.of(context).years +
), ', ' +
// CupertinoSwitch( snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
// value: isSwitchUser, fontSize: 12,
// onChanged: (value) { color: Colors.white),
// setState(() { ],
// isSwitchUser = value; ),
// }); Column(
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); children: [
// }, SizedBox(height: 10),
// ), InkWell(
Texts(TranslationBase.of(context).switchUser, onTap: () {
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white, switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
fontSize: 12, },
fontWeight: FontWeight.w600) child: Container(
], decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
))), padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
SizedBox( child: Row(
height: 10, mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/switch.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
// CupertinoSwitch(
// value: isSwitchUser,
// onChanged: (value) {
// setState(() {
// isSwitchUser = value;
// });
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
// },
// ),
Texts(TranslationBase.of(context).switchUser,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600)
],
))),
SizedBox(
height: 10,
),
InkWell(
onTap: () {
deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context);
},
child: Container(
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/delete.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
Texts(TranslationBase.of(context).delete,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600),
],
))),
SizedBox(height: 10),
],
), ),
InkWell(
onTap: () {
deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context);
},
child: Container(
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/delete.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
Texts(TranslationBase.of(context).delete,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600),
],
))),
SizedBox(height: 10),
], ],
), )));
], // else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0)
))); // return getNoDataWidget(context);
else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0) else
return getNoDataWidget(context); return SizedBox(height: 0);
else },
return SizedBox(height: 0); separatorBuilder: (context, index) => SizedBox(height: 0),
}, itemCount: snapshot.data.getAllSharedRecordsByStatusList.length)
separatorBuilder: (context, index) => SizedBox(height: 0), : getNoDataWidget(context);
itemCount: snapshot.data.getAllSharedRecordsByStatusList.length);
} }
}, },
), ),
@ -290,176 +291,98 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
FractionallySizedBox( FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: AppExpandableNotifier( child: AppExpandableNotifier(
title: TranslationBase.of(context).userViewRequest, title: TranslationBase.of(context).userViewRequest,
bodyWidget: FutureBuilder( bodyWidget: FutureBuilder(
future: getUserViewRequest(), // async work future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) { builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return SizedBox(); return SizedBox();
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(width: 1, color: Color(0xffEFEFEF)), border: Border.all(width: 1, color: Color(0xffEFEFEF)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5, //spreadRadius: 5,
blurRadius: 27, blurRadius: 27,
offset: Offset(0, -3), offset: Offset(0, -3),
), ),
], ],
color: Colors.white), color: Colors.white),
child: Column( child: Column(
children: [ children: [
Column(children: [ Column(children: [
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row(children: [ child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)), Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)), Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
])), ])),
Padding( Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0), padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Divider(color: Colors.black, height: 1.5, thickness: 1.5), child: Divider(color: Colors.black, height: 1.5, thickness: 1.5),
), ),
Column( Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) { children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Container( return Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: Texts( child: Texts(
result.patientName, result.patientName,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22), icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22),
onPressed: () { onPressed: () {
acceptRemoveRequest(result.iD, 3, context); acceptRemoveRequest(result.iD, 3, context);
}, },
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22), icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
acceptRemoveRequest(result.iD, 4, context); acceptRemoveRequest(result.iD, 4, context);
}, },
)) ))
], ],
)); ));
}).toList()) }).toList())
]) ])
], ],
)); ));
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: 1); itemCount: 1);
} }
}, },
))), ),
),
// RoundedContainer( ),
// child: ExpansionTile(
// title: Text(
// TranslationBase.of(context).userViewRequest,
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
// ),
// children: <Widget>[
// FutureBuilder(
// future: getUserViewRequest(), // async work
// builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
// switch (snapshot.connectionState) {
// case ConnectionState.waiting:
// return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
// default:
// if (snapshot.hasError)
// return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
// else
// return Container(
// padding: EdgeInsets.all(15),
// child: Card(
// elevation: 3,
// shape: cardRadius(8),
// child: Column(
// children: [
// Column(children: [
// Padding(
// padding: EdgeInsets.all(10),
// child: Row(children: [
// Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
// ])),
// Divider(color: Colors.black, height: 1.5, thickness: 1.5),
// Column(
// children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
// return Container(
// padding: EdgeInsets.all(10),
// child: Row(
// children: <Widget>[
// Expanded(
// flex: 3,
// child: Texts(
// result.patientName,
// fontWeight: FontWeight.w600,
// fontSize: 12,
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.check_circle,
// color: Color(0xff349745),
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 3, context);
// },
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.close,
// color: Colors.red[900],
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 4, context);
// },
// ))
// ],
// ));
// }).toList())
// ])
// ],
// )));
// }
// })
// ],
// ),
// ),
SizedBox(height: 15), SizedBox(height: 15),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
@ -521,18 +444,21 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
fontSize: 12, fontSize: 12,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: Card( child: Card(
// shape: cardRadius(10), // shape: cardRadius(10),
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
child: Padding( child: Padding(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: AppText( child: AppText(
result.statusDescription, result.statusDescription != null ? result.statusDescription : "",
color: Colors.white, color: Colors.white,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
)))), ),
),
),
),
], ],
)); ));
}).toList(), }).toList(),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
@ -9,16 +10,19 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils ;
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
dynamic languageID; dynamic languageID;
class FinalProductsPage extends StatefulWidget { class FinalProductsPage extends StatefulWidget {
@ -58,6 +62,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) { onModelReady: (model) {
if (widget.productType == 1) { if (widget.productType == 1) {
@ -225,7 +231,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
), ),
child: model.finalProducts[index].rxMessage != null child: model.finalProducts[index].rxMessage != null
? Texts( ? Texts(
languageID == 'ar' ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage, projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage,
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
@ -259,8 +265,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
), ),
), ),
), ),
Texts( Texts(projectViewModel.isArabic ? model.finalProducts[index].namen : model.finalProducts[index].name,
model.finalProducts[index].name, // model.finalProducts[index].name,
regular: true, regular: true,
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -387,13 +393,22 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
color: Color(0xffb23838), color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
), ),
child: Texts( child:model.finalProducts[index].rxMessage != null
model.finalProducts[index].rxMessage != null ? model.finalProducts[index].rxMessage : "", ? Texts(
projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage,
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), )
: Texts(""),
// Texts(
// model.finalProducts[index].rxMessage != null ? model.finalProducts[index].rxMessage : "",
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w600,
// ),
), ),
], ],
), ),
@ -414,8 +429,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.64, width: MediaQuery.of(context).size.width * 0.64,
child: Texts( child: Texts(projectViewModel.isArabic ? model.finalProducts[index].namen : model.finalProducts[index].name,
model.finalProducts[index].name, // model.finalProducts[index].name,
regular: true, regular: true,
fontSize: 13.2, fontSize: 13.2,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -474,7 +489,10 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.finalProducts[index].id); await addToCartFunction(1, model.finalProducts[index].id);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: CartOrderPage())); // Navigator.push(context, FadePage(page: CartOrderPage()));
utils.Utils.navigateToCartPage();
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
} }
@ -527,6 +545,6 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
addToCartFunction(quantity, itemID) async { addToCartFunction(quantity, itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
await x.addToCartData(quantity, itemID); await x.addToCartData(quantity, itemID, context);
} }
} }

@ -241,14 +241,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
signalRUtil = new SignalRUtil(hubName: "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273", context: context); // signalRUtil = new SignalRUtil(hubName: "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273", context: context);
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus(); familyFileProvider.getSharedRecordByStatus();
} }
if (!signalRUtil.getConnectionState()) signalRUtil.startSignalRConnection(); // if (!signalRUtil.getConnectionState()) signalRUtil.startSignalRConnection();
}); });
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
//for now commented to reduce this call will enable it when needed //for now commented to reduce this call will enable it when needed

@ -28,6 +28,7 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return BaseView<OffersCategoriseViewModel>( return BaseView<OffersCategoriseViewModel>(
onModelReady: (model) => model.getOffersCategorise(), onModelReady: (model) => model.getOffersCategorise(),
@ -99,9 +100,8 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
.height * .height *
0.09, 0.09,
child: Center( child: Center(
child: Texts( child: Texts(projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name,
model.categorise[index] // model.categorise[index].name,
.name,
fontWeight: fontWeight:
FontWeight.w600, FontWeight.w600,
fontSize: 13.8, fontSize: 13.8,
@ -117,8 +117,8 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
String ids = String ids =
model.categorise[index].id; model.categorise[index].id;
categoriseName = model categoriseName = projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name;
.categorise[index].name; //model.categorise[index].name;
}), }),
], ],
), ),
@ -275,7 +275,7 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
bottom: 5.0, bottom: 5.0,
), ),
child: Texts( child: Texts(
'offer' TranslationBase.of(context).offers
.toUpperCase(), .toUpperCase(),
color: Colors color: Colors
.red, .red,
@ -338,25 +338,28 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
.circular( .circular(
6)), 6)),
), ),
child: Texts( child: model.products[index].rxMessage != null
model ? Texts(
.products[ projectProvider.isArabic
index] ? model.products[index].rxMessagen
.rxMessage != : model.products[index].rxMessage,
null color: Colors.white,
? model
.products[
index]
.rxMessage
: "",
color:
Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight ): Texts("")
.w400, // Texts(
), // model.products[index].rxMessage != null ?
// model.products[index].rxMessage
// : "",
// color:
// Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight:
// FontWeight
// .w400,
// ),
), ),
], ],
), ),
@ -403,11 +406,8 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
), ),
), ),
), ),
Texts( Texts( projectViewModel.isArabic ? model.products[index].namen : model.products[index].name,
model // model.products[index].name,
.products[
index]
.name,
regular: true, regular: true,
fontSize: 12.58, fontSize: 12.58,
fontWeight: fontWeight:
@ -511,7 +511,7 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
child: Center( child: Center(
child: child:
Texts( Texts(
'offer' TranslationBase.of(context).offers
.toUpperCase(), .toUpperCase(),
color: Colors color: Colors
.red, .red,
@ -579,25 +579,28 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
.circular( .circular(
6)), 6)),
), ),
child: Texts( child: model.products[index].rxMessage != null
model ? Texts(
.products[ projectProvider.isArabic
index] ? model.products[index].rxMessagen
.rxMessage != : model.products[index].rxMessage,
null color: Colors.white,
? model
.products[
index]
.rxMessage
: "",
color:
Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight ): Texts("")
.w400, // Texts(
), // model.products[index].rxMessage != null
// ? model.products[index].rxMessage
// : "",
// color:
// Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight:
// FontWeight
// .w400,
// ),
), ),
], ],
), ),
@ -649,9 +652,8 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
SizedBox( SizedBox(
height: 4.0, height: 4.0,
), ),
Texts( Texts( projectViewModel.isArabic ? model.products[index].namen : model.products[index].name,
model.products[index] // model.products[index].name,
.name,
regular: true, regular: true,
fontSize: 14.0, fontSize: 14.0,
fontWeight: fontWeight:

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
@ -32,14 +33,12 @@ class ParentCategorisePage extends StatefulWidget {
String id; String id;
String titleName; String titleName;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
ParentCategorisePage({this.id, this.titleName}); ParentCategorisePage({this.id, this.titleName});
@override @override
_ParentCategorisePageState createState() => _ParentCategorisePageState createState() => _ParentCategorisePageState(id: id, titleName: titleName);
_ParentCategorisePageState(id: id, titleName: titleName);
} }
class _ParentCategorisePageState extends State<ParentCategorisePage> { class _ParentCategorisePageState extends State<ParentCategorisePage> {
@ -76,6 +75,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
TextEditingController minField = TextEditingController(); TextEditingController minField = TextEditingController();
TextEditingController maxField = TextEditingController(); TextEditingController maxField = TextEditingController();
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getCategoriseParent( onModelReady: (model) => model.getCategoriseParent(
i: id, pageIndex: pageIndex, isLoading: false), i: id, pageIndex: pageIndex, isLoading: false),
@ -144,13 +144,14 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( InkWell(
child:Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: InkWell(
child: Container( child: Container(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context)
@ -159,7 +160,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
), ),
), ),
onTap: () { ),
Icon(Icons.arrow_forward)
],
), onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -168,62 +172,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
// id: model.categorise[0].id, // id: model.categorise[0].id,
// titleName: model.categorise[0].name, // titleName: model.categorise[0].name,
)), )),
);
// showModalBottomSheet<void>( );}
// isScrollControlled: true,
// context: context,
// builder: (BuildContext context) {
// return Container(
// // height: MediaQuery.of(context)
// // .size
// // .height *
// // 0.89,
// color: Colors.white,
// child: Center(
// child: ListView.builder(
// scrollDirection: Axis.vertical,
// itemCount: model.categoriseParent.length,
// itemBuilder: (BuildContext context, int index) {
// return Container(
// child: Padding(
// padding: EdgeInsets.all(4.0),
// child: InkWell(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(projectViewModel.isArabic
// ? model.categoriseParent[index].namen
// : model.categoriseParent[index].name),
// Divider(
// thickness: 0.6,
// color: Colors.black12,
// )
// ],
// ),
// onTap: () {
// Navigator.push(
// context,
// FadePage(
// page: SubCategorisePage(
// title: model.categoriseParent[index].name,
// id: model.categoriseParent[index].id,
// parentId: id,
// )),
// );
// },
// ),
// ),
// );
// }),
// ),
// );
// },
// );
},
),
),
Icon(Icons.arrow_forward)
],
), ),
Divider( Divider(
thickness: 1.0, thickness: 1.0,
@ -312,7 +262,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
context, context,
FadePage( FadePage(
page: SubCategorisePage( page: SubCategorisePage(
title: model title: projectViewModel.isArabic ? model.categoriseParent[index].namen : model.categoriseParent[index].name,
// title:model
.categoriseParent[index] .categoriseParent[index]
.name, .name,
id: model id: model
@ -350,7 +301,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
width: 10.0, width: 10.0,
), ),
Texts( Texts(
'Refine', TranslationBase.of(context).refine,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
], ],
@ -398,15 +349,13 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.refine, .refine,
// 'Refine', // 'Refine',
fontWeight: fontWeight: FontWeight.w600,
FontWeight ),
.w600, SizedBox(
), width: 250.0,
SizedBox( ),
width: 250.0, InkWell(
), child: Texts(
InkWell(
child: Texts(
// 'Close', // 'Close',
TranslationBase.of( TranslationBase.of(
context) context)
@ -540,7 +489,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
Texts('Min'), Texts(TranslationBase.of(context).min),
Container( Container(
color: Colors.white, color: Colors.white,
width: 200, width: 200,
@ -558,7 +507,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
Texts('Max'), Texts(TranslationBase.of(context).max),
Container( Container(
color: Colors.white, color: Colors.white,
width: 200, width: 200,
@ -645,47 +594,39 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
} }
} }
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context);
await model.getFilteredProducts( await model.getFilteredProducts(
min: minField.text.toString(), min: minField.text.toString(), max: maxField.text.toString(), categoryId: categoriesId, brandId: brandIds);
max: maxField.text.toString(), GifLoaderDialogUtils.hideDialog(context);
categoryId: categoriesId,
brandId: brandIds);
GifLoaderDialogUtils.hideDialog(
context);
Navigator.pop( Navigator.pop(context);
context); },
}, label: TranslationBase.of(context).apply,
label: TranslationBase.of(context) backgroundColor: Colors.green,
.apply,
backgroundColor:
Colors.green,
),
),
],
),
), ),
], ),
), ],
], ),
), ),
), ],
); ),
}); ],
}, ),
); ),
}, );
), });
Row( },
children: [ );
Container( },
height: 44.0, ),
child: VerticalDivider( Row(
color: Colors.black45, children: [
thickness: 1.0, Container(
height: 44.0,
child: VerticalDivider(
color: Colors.black45,
thickness: 1.0,
//width: 0.3, //width: 0.3,
// indent: 0.0, // indent: 0.0,
), ),
@ -838,7 +779,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
), ),
child: child:
Texts( Texts(
'offer' TranslationBase.of(context).offers
.toUpperCase(), .toUpperCase(),
color: color:
Colors.red, Colors.red,
@ -901,23 +842,33 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
topLeft: topLeft:
Radius.circular(6)), Radius.circular(6)),
), ),
child: Texts( child:model.parentProducts[index].rxMessage != null ?
model.parentProducts[index].rxMessage != Texts(projectProvider.isArabic
? model.parentProducts[index].rxMessagen
: model.parentProducts[index].rxMessage,
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
: Texts(""),
// Texts(
// model.parentProducts[index].rxMessage !=
null null
? model ? model
.parentProducts[index] .parentProducts[index]
.rxMessage .rxMessage
: "", : "",
color: Colors // color: Colors
.white, .white,
regular: // regular:
true, true,
fontSize: // fontSize:
10, 10,
fontWeight: // fontWeight:
FontWeight FontWeight
.w400, .w400,
), // ),
), ),
], ],
), ),
@ -1003,233 +954,145 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
// ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble()
// : 0, // : 0,
// forceStars: true), // forceStars: true),
RatingBar RatingBar.readOnly(
.readOnly( initialRating: model.parentProducts[index].approvedRatingSum.toDouble(),
initialRating: model size: 15.0,
.parentProducts[index] filledColor: Colors.yellow[700],
.approvedRatingSum emptyColor: Colors.grey[500],
.toDouble(), isHalfAllowed: true,
size: halfFilledIcon: Icons.star_half,
15.0, filledIcon: Icons.star,
filledColor: emptyIcon: Icons.star,
Colors.yellow[700],
emptyColor:
Colors.grey[500],
isHalfAllowed:
true,
halfFilledIcon:
Icons.star_half,
filledIcon:
Icons.star,
emptyIcon:
Icons.star,
),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular:
true,
fontSize:
10,
fontWeight:
FontWeight.w400,
)
],
),
],
), ),
), Texts(
], "(${model.parentProducts[index].approvedTotalReviews})",
), regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
),
],
), ),
), ),
onTap: () => { ],
Navigator.push( ),
context, ),
FadePage( ),
page: ProductDetailPage( onTap: () => {
model.parentProducts[ Navigator.push(
index]), context,
)), FadePage(
}, page: ProductDetailPage(model.parentProducts[index]),
)); )),
}, },
), ));
) },
: Container( ),
height: model.parentProducts.length * )
MediaQuery.of(context) : Container(
.size height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.122,
.height * child: ListView.builder(
0.122, physics: NeverScrollableScrollPhysics(),
child: ListView.builder( itemCount: model.parentProducts.length,
physics: itemBuilder: (BuildContext context, int index) {
NeverScrollableScrollPhysics(), return InkWell(
itemCount: child: Card(
model.parentProducts.length, child: Row(
itemBuilder: children: [
(BuildContext context, Stack(
int index) { children: [
return InkWell( Column(
child: Card(
child: Row(
children: [ children: [
Stack( Container(
children: [ decoration: BoxDecoration(),
Column( child: Padding(
children: [ padding: EdgeInsets.only(
Container( left: 9.0,
decoration: top: 8.0,
BoxDecoration(), right: 10.0,
child:
Padding(
padding:
EdgeInsets
.only(
left: 9.0,
top: 8.0,
right:
10.0,
),
),
),
Container(
margin: EdgeInsets
.fromLTRB(
0,
0,
0,
0),
alignment:
Alignment
.center,
child: model
.parentProducts[
index]
.images
.isNotEmpty
? Image
.network(
model
.parentProducts[index]
.images[0]
.thumb,
fit: BoxFit
.contain,
height:
70,
)
: Text(TranslationBase.of(
context)
.noImage),
),
],
),
Column(
children: [
Container(
width: model.parentProducts[index].rxMessage !=
null
? MediaQuery.of(context)
.size
.width /
5.3
: 0,
padding:
EdgeInsets
.all(
4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(6)),
),
child: Texts(
model.parentProducts[index].rxMessage !=
null
? model
.parentProducts[index]
.rxMessage
: "",
color: Colors
.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight
.w400,
),
),
],
), ),
], ),
), ),
Container( Container(
margin: EdgeInsets margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
.symmetric( alignment: Alignment.center,
horizontal: 0, child: model.parentProducts[index].images.isNotEmpty
vertical: 0, ? Image.network(
model.parentProducts[index].images[0].thumb,
fit: BoxFit.contain,
height: 70,
)
: Text(TranslationBase.of(context).noImage),
),
],
),
Column(
children: [
Container(
width: model.parentProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 5.3 : 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
), ),
child: Column( child: model.parentProducts[index].rxMessage != null ?
mainAxisAlignment: Texts(projectProvider.isArabic
MainAxisAlignment ? model.parentProducts[index].rxMessagen
.spaceAround, : model.parentProducts[index].rxMessage,
crossAxisAlignment: color: Colors.white,
CrossAxisAlignment regular: true,
.start, fontSize: 10,
children: [ fontWeight: FontWeight.w400,
SizedBox( )
height: 4.0, : Texts(""),
), // Texts(
Container( // model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "",
width: MediaQuery.of( // color: Colors.white,
context) // regular: true,
.size // fontSize: 10,
.width * // fontWeight: FontWeight.w400,
0.635, // ),
child: Texts( ),
projectViewModel ],
.isArabic ),
? model ],
.parentProducts[ ),
index] Container(
.namen margin: EdgeInsets.symmetric(
: model horizontal: 0,
.parentProducts[ vertical: 0,
index] ),
.name, child: Column(
regular: true, mainAxisAlignment: MainAxisAlignment.spaceAround,
fontSize: crossAxisAlignment: CrossAxisAlignment.start,
13.2, children: [
fontWeight: SizedBox(
FontWeight height: 4.0,
.w500, ),
maxLines: 5, Container(
), width: MediaQuery.of(context).size.width * 0.635,
), child: Texts(
SizedBox( projectViewModel.isArabic ? model.parentProducts[index].namen : model.parentProducts[index].name,
height: 8.0, regular: true,
), fontSize: 13.2,
Padding( fontWeight: FontWeight.w500,
padding: maxLines: 5,
const EdgeInsets ),
.only( ),
top: 4, SizedBox(
bottom: height: 8.0,
4), ),
child: Texts( Padding(
"SAR ${model.parentProducts[index].price}", padding: const EdgeInsets.only(top: 4, bottom: 4),
bold: true, child: Texts(
fontSize: 14, "SAR ${model.parentProducts[index].price}",
), bold: true,
), fontSize: 14,
Row( ),
children: [ ),
Row(
children: [
// StarRating( // StarRating(
// totalAverage: model.parentProducts[index].approvedRatingSum > 0 // totalAverage: model.parentProducts[index].approvedRatingSum > 0
// ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble()
@ -1298,8 +1161,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
await addToCartFunction(1, await addToCartFunction(1,
model.parentProducts[index].id); model.parentProducts[index].id);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, Utils.navigateToCartPage();
FadePage(page: CartOrderPage()));
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
} }
@ -1342,8 +1204,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Padding( Padding(
padding: padding:
const EdgeInsets.all(8.0), const EdgeInsets.all(8.0),
child: Text( child: Text(TranslationBase.of(context).noData,
'There is no data', // 'There is no data',
style: style:
TextStyle(fontSize: 30), TextStyle(fontSize: 30),
), ),
@ -1362,12 +1224,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
addToCartFunction(quantity, itemID) async { addToCartFunction(quantity, itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
await x.addToCartData(quantity, itemID); await x.addToCartData(quantity, itemID, context);
} }
bool isEntityListSelected(CategoriseParentModel masterKey) { bool isEntityListSelected(CategoriseParentModel masterKey) {
Iterable<CategoriseParentModel> history = Iterable<CategoriseParentModel> history = entityList.where((element) => masterKey.id == element.id);
entityList.where((element) => masterKey.id == element.id);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }
@ -1375,8 +1236,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
} }
bool isEntityListSelectedBrands(CategoriseParentModel masterKey) { bool isEntityListSelectedBrands(CategoriseParentModel masterKey) {
Iterable<CategoriseParentModel> history = Iterable<CategoriseParentModel> history = entityListBrands.where((element) => masterKey.id == element.id);
entityListBrands.where((element) => masterKey.id == element.id);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }

@ -48,7 +48,7 @@ class _ProductCheckTypeWidgetState extends State<ProductCheckTypeWidget> {
deleteWishListItem(itemID) async { deleteWishListItem(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await x.deleteWishlistData(itemID); await x.deleteWishlistData(itemID, context);
await widget.model.getWishlistData(isLocalLoader: true); await widget.model.getWishlistData(isLocalLoader: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CompareList with ChangeNotifier { class CompareList with ChangeNotifier {
@ -7,20 +8,28 @@ class CompareList with ChangeNotifier {
List<PharmacyProduct> get productListItems => _product; List<PharmacyProduct> get productListItems => _product;
void addItem(data) { void addItem(data, context) {
if (_product.length == 0) { if (_product.length == 0) {
_product.add(data); _product.add(data);
AppToast.showSuccessToast(message: 'You have added a product to the Compare list'); AppToast.showSuccessToast(message:TranslationBase.of(context).addToCompareMsg
// 'You have added a product to the Compare list'
);
} else { } else {
for (int i = 0; i < _product.length; i++) { for (int i = 0; i < _product.length; i++) {
if (_product.length <= 4 && _product[i].id != data.id) { if (_product.length <= 4 && _product[i].id != data.id) {
_product.add(data); _product.add(data);
AppToast.showSuccessToast(message: 'You have added a product to the Compare list'); AppToast.showSuccessToast(message:TranslationBase.of(context).addToCompareMsg
// 'You have added a product to the Compare list'
);
break; break;
} else if(_product[i].id == data.id){ } else if(_product[i].id == data.id){
AppToast.showErrorToast(message: 'the item is already in the list'); AppToast.showErrorToast(message:TranslationBase.of(context).itInListMsg
// 'the item is already in the list'
);
} else if(_product.length == 4){ } else if(_product.length == 4){
AppToast.showErrorToast(message: 'your compare list is full'); AppToast.showErrorToast(message: TranslationBase.of(context).compareListFull
// 'your compare list is full'
);
} }
} }
} }

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -22,6 +23,7 @@ import 'package:provider/provider.dart';
import 'cart-order-preview.dart'; import 'cart-order-preview.dart';
class CartOrderPage extends StatefulWidget { class CartOrderPage extends StatefulWidget {
final Function(int) changeTab; final Function(int) changeTab;
const CartOrderPage({Key key, this.changeTab}) : super(key: key); const CartOrderPage({Key key, this.changeTab}) : super(key: key);
@ -45,213 +47,216 @@ class _CartOrderPageState extends State<CartOrderPage> {
OrderPreviewViewModel model = Provider.of(context); OrderPreviewViewModel model = Provider.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
AppScaffold appScaffold; return AppScaffold(
return NetworkBaseView( appBarTitle: TranslationBase.of(context).shoppingCart,
isLoading: isLoading, isShowAppBar: true,
isLocalLoader: true, isPharmacy: true,
child: appScaffold = AppScaffold( showHomeAppBarIcon: false,
appBarTitle: TranslationBase.of(context).shoppingCart, isShowDecPage: false,
isShowAppBar: true, isMainPharmacyPages: true,
isPharmacy: true, showPharmacyCart: false,
showHomeAppBarIcon: false, baseViewModel: model,
isShowDecPage: false, backgroundColor: Colors.white,
isMainPharmacyPages: true, body: NetworkBaseView(
isBottomBar: true, isLoading: isLoading,
showPharmacyCart: true, isLocalLoader: true,
baseViewModel: model, child: !(model.cartResponse.shoppingCarts == null ||
backgroundColor: Colors.white, model.cartResponse.shoppingCarts.length == 0)
body: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
? Container( ? Container(
height: height * 0.85, height: height * 0.85,
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureIconButton(
TranslationBase.of(context).deleteAllItems,
Icon(
Icons.delete_outline_sharp,
color: Colors.grey.shade700,
),
onTap: () => {model.deleteShoppingCart()},
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
GestureIconButton( ...List.generate(
TranslationBase.of(context).deleteAllItems, model.cartResponse.shoppingCarts != null
Icon( ? model
Icons.delete_outline_sharp, .cartResponse.shoppingCarts.length
color: Colors.grey.shade700, : 0,
), (index) => ProductOrderItem(
onTap: () => {model.deleteShoppingCart()}, model.cartResponse
), .shoppingCarts[index], () {
const Divider( print(model.cartResponse
color: Color(0xFFD6D6D6), .shoppingCarts[index].quantity);
height: 20, model
thickness: 1, .changeProductQuantity(model
indent: 0, .cartResponse
endIndent: 0, .shoppingCarts[index])
), .then((value) {
Container( if (model.state !=
child: Column( ViewState.Error) {
children: [ // appScaffold.appBar.badgeUpdater(
...List.generate( // '${value.quantityCount ?? 0}');
model.cartResponse.shoppingCarts != null }
? model.cartResponse.shoppingCarts.length if (model.state ==
: 0, ViewState.ErrorLocal) {
(index) => ProductOrderItem( Utils.showErrorToast(
model.cartResponse model.error);
.shoppingCarts[index], () { }
print(model.cartResponse });
.shoppingCarts[index].quantity); }, () {
model model
.changeProductQuantity(model .deleteProduct(model
.cartResponse .cartResponse
.shoppingCarts[index]) .shoppingCarts[index])
.then((value) { .then((value) {
if (model.state != ViewState.Error) { if (model.state !=
// appScaffold.appBar.badgeUpdater( ViewState.Error) {
// '${value.quantityCount ?? 0}'); // appScaffold.appBar.badgeUpdater(
} // '${value.quantityCount ?? 0}');
if (model.state == }
ViewState.ErrorLocal) { });
Utils.showErrorToast(model.error); }))
}
});
}, () {
model
.deleteProduct(model.cartResponse
.shoppingCarts[index])
.then((value) {
if (model.state != ViewState.Error) {
// appScaffold.appBar.badgeUpdater(
// '${value.quantityCount ?? 0}');
}
});
}))
],
),
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 2,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).subtotal,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).vat}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalWithVat).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Image.asset(
"assets/images/pharmacy_module/payment.png",
width: mediaQuery.size.width - 20,
height: 30.0,
fit: BoxFit.scaleDown,
),
SizedBox(
height: 120,
)
], ],
), ),
), ),
), const Divider(
) color: Color(0xFFD6D6D6),
: Center( height: 20,
child: Column( thickness: 2,
mainAxisAlignment: MainAxisAlignment.center, indent: 0,
children: [ endIndent: 0,
Padding( ),
padding: const EdgeInsets.all(8.0), Row(
child: Image.asset( mainAxisAlignment: MainAxisAlignment.spaceBetween,
'assets/images/new-design/empty_box.png', children: [
width: 100, Texts(
height: 100, TranslationBase.of(context).subtotal,
fit: BoxFit.cover, fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
), ),
), Texts(
Padding( "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
padding: const EdgeInsets.all(8.0), fontSize: 14,
child: Text( color: Colors.black,
TranslationBase.of(context).noData, fontWeight: FontWeight.w500,
// 'There is no data',
style: TextStyle(fontSize: 30),
), ),
) ],
], ),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).vat}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalWithVat).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Image.asset(
"assets/images/pharmacy_module/payment.png",
width: mediaQuery.size.width - 20,
height: 30.0,
fit: BoxFit.scaleDown,
),
SizedBox(
height: 120,
)
],
),
),
),
)
: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/new-design/empty_box.png',
width: 100,
height: 100,
fit: BoxFit.cover,
), ),
), ),
bottomSheet: Container( Padding(
height: !(model.cartResponse.shoppingCarts == null || padding: const EdgeInsets.all(8.0),
model.cartResponse.shoppingCarts.length == 0) child: Text(
? height * 0.15 TranslationBase.of(context).noData,
: 0, // 'There is no data',
color: Colors.white, style: TextStyle(fontSize: 30),
child: OrderBottomWidget(model.addresses, height), ),
)
],
),
), ),
), ),
bottomSheet: Container(
height: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
? height * 0.15
: 0,
color: Colors.white,
child: OrderBottomWidget(model.addresses, height, model),
),
); );
} }
@ -267,8 +272,9 @@ class _CartOrderPageState extends State<CartOrderPage> {
class OrderBottomWidget extends StatefulWidget { class OrderBottomWidget extends StatefulWidget {
final List<Addresses> addresses; final List<Addresses> addresses;
final double height; final double height;
final OrderPreviewViewModel model;
OrderBottomWidget(this.addresses, this.height); OrderBottomWidget(this.addresses, this.height, this.model);
@override @override
_OrderBottomWidgetState createState() => _OrderBottomWidgetState(); _OrderBottomWidgetState createState() => _OrderBottomWidgetState();
@ -280,9 +286,9 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
OrderPreviewViewModel cart = Provider.of(context);
return !(cart.cartResponse.shoppingCarts == null || return !(widget.model.cartResponse.shoppingCarts == null ||
cart.cartResponse.shoppingCarts.length == 0) widget.model.cartResponse.shoppingCarts.length == 0)
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -372,7 +378,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
child: Row( child: Row(
children: [ children: [
Texts( Texts(
"${TranslationBase.of(context).sar} ${(cart.cartResponse.subtotalWithVat).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotalWithVat).toStringAsFixed(2)}",
fontSize: projectProvider.isArabic ? 12 : 14, fontSize: projectProvider.isArabic ? 12 : 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -390,7 +396,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
), ),
), ),
Texts( Texts(
"${cart.cartResponse.quantityCount} ${TranslationBase.of(context).items}", "${widget.model.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -402,7 +408,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
onPressed: isAgree onPressed: isAgree
// && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0 // && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0
? () => { ? () => {
if (cart.isCartItemsOutOfStock()) if (widget.model.isCartItemsOutOfStock())
{ {
// Toast msg // Toast msg
AppToast.showErrorToast( AppToast.showErrorToast(
@ -411,11 +417,13 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
} }
else else
{ {
Navigator.push( _navigateToAddressPage(widget
context, .model.user.patientIdentificationNo)
FadePage( // Navigator.push(
page: OrderPreviewPage( // context,
widget.addresses))) // FadePage(
// page:
// OrderPreviewPage(widget.addresses)))
} }
} }
: null, : null,
@ -427,30 +435,9 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
fontSize: 14), fontSize: 14),
), ),
color: Color(0xFF4CAF50), color: Color(0xFF4CAF50),
disabledColor: Color(0xFF848484), disabledColor:Color(0xFF848484),
// disabledColor: Color(0xff005aff), // disabledColor: Color(0xff005aff),
) )
// RaisedButton(
// onPressed: isAgree
//// && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0
// ? () => {
// Navigator.push(
// context,
// FadePage(
// page:
// OrderPreviewPage(widget.addresses)))
// }
// : null,
// child: new Text(
// "${TranslationBase.of(context).checkOut}",
// style: new TextStyle(
// color:
// isAgree ? Colors.white : Colors.grey.shade300,
// fontSize: 14),
// ),
// color: Color(0xff005aff),
// disabledColor: Color(0xff005aff),
// )
], ],
), ),
), ),
@ -458,4 +445,24 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
) )
: Container(); : Container();
} }
_navigateToAddressPage(String identificationNo) {
Navigator.push(
context,
FadePage(
page: PharmacyAddressesPage(
orderPreviewViewModel: widget.model,
))).then((result) async {
if (result != null) {
GifLoaderDialogUtils.showMyDialog(context);
var address = result;
widget.model.paymentCheckoutData.address =
Addresses.fromJson(address.toJson());
await widget.model.getInformationsByAddress(identificationNo);
await widget.model.getShoppingCart();
// widget.changeMainState();
GifLoaderDialogUtils.hideDialog(context);
}
});
}
} }

@ -15,8 +15,9 @@ import 'lakum_widget.dart';
class OrderPreviewPage extends StatefulWidget { class OrderPreviewPage extends StatefulWidget {
final List<Addresses> addresses; final List<Addresses> addresses;
final OrderPreviewViewModel model;
OrderPreviewPage(this.addresses); OrderPreviewPage({this.addresses, this.model});
@override @override
_OrderPreviewPageState createState() => _OrderPreviewPageState(); _OrderPreviewPageState createState() => _OrderPreviewPageState();
@ -43,7 +44,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
OrderPreviewViewModel model = Provider.of(context); // OrderPreviewViewModel widget.model = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: "${TranslationBase.of(context).checkOut}", appBarTitle: "${TranslationBase.of(context).checkOut}",
isShowAppBar: true, isShowAppBar: true,
@ -52,7 +53,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
isLoading: isLoading, isLoading: isLoading,
isLocalLoader: true, isLocalLoader: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
// baseViewModel: model, // baseViewModel: widget.model,
body: Container( body: Container(
color: Color(0xFFF1F1F1), color: Color(0xFFF1F1F1),
height: height * 0.90, height: height * 0.90,
@ -61,19 +62,19 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Color(0xFFF1F1F1), color: Color(0xFFF1F1F1),
child: Column( child: Column(
children: [ children: [
SelectAddressWidget(model, widget.addresses, changeMainState), SelectAddressWidget(widget.model, widget.addresses, changeMainState, isUpdating: true,),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SelectPaymentOptionWidget(model, changeMainState), SelectPaymentOptionWidget(widget.model, changeMainState,isUpdating: true,),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
model.paymentCheckoutData.lacumInformation != null widget.model.paymentCheckoutData.lacumInformation != null
? Container( ? Container(
child: Column( child: Column(
children: [ children: [
LakumWidget(model), LakumWidget(widget.model),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -95,8 +96,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Colors.black, color: Colors.black,
), ),
...List.generate( ...List.generate(
model.cartResponse.shoppingCarts != null ? model.cartResponse.shoppingCarts.length : 0, widget.model.cartResponse.shoppingCarts != null ? widget.model.cartResponse.shoppingCarts.length : 0,
(index) => ProductOrderPreviewItem(model.cartResponse.shoppingCarts[index]), (index) => ProductOrderPreviewItem(widget.model.cartResponse.shoppingCarts[index]),
), ),
], ],
), ),
@ -104,7 +105,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: model.cartResponse.subtotal != null child: widget.model.cartResponse.subtotal != null
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -127,7 +128,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -151,7 +152,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.totalAdditionalShippingCharge).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model.totalAdditionalShippingCharge).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -175,7 +176,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -199,7 +200,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -214,7 +215,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
: Container(), : Container(),
), ),
SizedBox( SizedBox(
height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0, height: widget.model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
) )
], ],
), ),
@ -222,9 +223,9 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0, height: widget.model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
color: Colors.white, color: Colors.white,
child: PaymentBottomWidget(model), child: PaymentBottomWidget(widget.model),
), ),
); );
} }

@ -13,8 +13,10 @@ class SelectAddressWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
final List<Addresses> addresses; final List<Addresses> addresses;
final Function changeMainState; final Function changeMainState;
final bool isUpdating;
SelectAddressWidget(this.model, this.addresses, this.changeMainState); SelectAddressWidget(this.model, this.addresses, this.changeMainState,
{this.isUpdating = false});
@override @override
_SelectAddressWidgetState createState() => _SelectAddressWidgetState(); _SelectAddressWidgetState createState() => _SelectAddressWidgetState();
@ -24,7 +26,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
AddressInfo address; AddressInfo address;
_navigateToAddressPage(String identificationNo) { _navigateToAddressPage(String identificationNo) {
Navigator.push(context, FadePage(page: PharmacyAddressesPage())).then((result) async { Navigator.push(context, FadePage(page: PharmacyAddressesPage(orderPreviewViewModel: widget.model,isUpdate: widget.isUpdating,changeMainState: widget.changeMainState,))).then((result) async {
if (result != null) { if (result != null) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
address = result; address = result;
@ -39,15 +41,15 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
@override @override
void initState() { void initState() {
if (widget.model.paymentCheckoutData.address != null) {
address = AddressInfo.fromJson(widget.model.paymentCheckoutData.address.toJson());
}
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
OrderPreviewViewModel model = Provider.of(context); OrderPreviewViewModel model = Provider.of(context);
if (widget.model.paymentCheckoutData.address != null) {
address = AddressInfo.fromJson(widget.model.paymentCheckoutData.address.toJson());
}
return Container( return Container(
color: Colors.white, color: Colors.white,
child: address == null child: address == null

@ -9,8 +9,10 @@ import 'package:flutter/material.dart';
class SelectPaymentOptionWidget extends StatefulWidget { class SelectPaymentOptionWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
final Function changeMainState; final Function changeMainState;
final bool isUpdating;
SelectPaymentOptionWidget(this.model, this.changeMainState);
SelectPaymentOptionWidget(this.model, this.changeMainState, {this.isUpdating = false});
@override @override
_SelectPaymentOptionWidgetState createState() => _SelectPaymentOptionWidgetState(); _SelectPaymentOptionWidgetState createState() => _SelectPaymentOptionWidgetState();
@ -20,7 +22,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
PaymentOption paymentOption; PaymentOption paymentOption;
_navigateToPaymentOption() { _navigateToPaymentOption() {
Navigator.push(context, FadePage(page: PaymentMethodSelectPage())) Navigator.push(context, FadePage(page: PaymentMethodSelectPage(model: widget.model,changeMainState:widget.changeMainState,isUpdating: widget.isUpdating,)))
.then((result) => { .then((result) => {
setState(() { setState(() {
if (result != null) { if (result != null) {
@ -35,14 +37,14 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
@override @override
void initState() { void initState() {
if (widget.model.paymentCheckoutData.paymentOption != null) {
paymentOption = widget.model.paymentCheckoutData.paymentOption;
}
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (widget.model.paymentCheckoutData.paymentOption != null) {
paymentOption = widget.model.paymentCheckoutData.paymentOption;
}
return Container( return Container(
color: Colors.white, color: Colors.white,
child: paymentOption == null child: paymentOption == null

@ -1,48 +0,0 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class OrderPreviewPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<OrderPreviewViewModel>(
builder: (_, model, wi) => AppScaffold(
title: TranslationBase.of(context).shoppingCart,
isShowAppBar: true,
isShowDecPage: false,
baseViewModel: model,
backgroundColor: Colors.white,
body: Container(
width: double.infinity,
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureIconButton(
TranslationBase.of(context).deleteAllItems,
Icon(Icons.delete_outline_sharp, color: Colors.grey.shade800,),
onTap: () => {},
),
const Divider(
color: Colors.grey,
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
],
),
),
),
),
),
);
}
}

@ -6,11 +6,23 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/material.dart';
import 'cart-page/cart-order-preview.dart';
class PaymentMethodSelectPage extends StatefulWidget { class PaymentMethodSelectPage extends StatefulWidget {
final OrderPreviewViewModel model;
final bool isUpdating;
final Function changeMainState;
const PaymentMethodSelectPage(
{Key key, this.model, this.isUpdating = false, this.changeMainState})
: super(key: key);
@override @override
_PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState(); _PaymentMethodSelectPageState createState() =>
_PaymentMethodSelectPageState();
} }
class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> { class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
@ -79,7 +91,8 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
PaymentOption.installments, PaymentOption.installments,
() => { () => {
setState(() { setState(() {
selectedPaymentOption = PaymentOption.installments; selectedPaymentOption =
PaymentOption.installments;
}) })
}), }),
if (Platform.isIOS) if (Platform.isIOS)
@ -103,7 +116,27 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 20), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 20),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
selectedPaymentOption != null ? () => {Navigator.pop(context, selectedPaymentOption)} : null, selectedPaymentOption != null
? () {
widget.model.paymentCheckoutData.paymentOption =
selectedPaymentOption;
if (widget.isUpdating) {
widget.changeMainState();
Navigator.pop(context);
return;
} else {
Navigator.push(
context,
FadePage(
page: OrderPreviewPage(
model: widget.model,
),
),
);
}
// Navigator.pop(context, selectedPaymentOption);
}
: null,
color: Color(0xff5AB154), color: Color(0xff5AB154),
), ),
), ),
@ -117,12 +150,14 @@ class PaymentMethodCard extends StatelessWidget {
final PaymentOption paymentOption; final PaymentOption paymentOption;
final Function selectMethod; final Function selectMethod;
PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, this.paymentOption, this.selectMethod); PaymentMethodCard(this.cardWidth, this.selectedPaymentOption,
this.paymentOption, this.selectMethod);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isSelected = false; bool isSelected = false;
if (selectedPaymentOption != null && selectedPaymentOption == paymentOption) { if (selectedPaymentOption != null &&
selectedPaymentOption == paymentOption) {
isSelected = true; isSelected = true;
} }
@ -136,7 +171,9 @@ class PaymentMethodCard extends StatelessWidget {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: isSelected ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), side: isSelected
? BorderSide(color: Colors.green, width: 2.0)
: BorderSide(color: Colors.transparent, width: 0.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
@ -145,7 +182,13 @@ class PaymentMethodCard extends StatelessWidget {
Container( Container(
width: 24, width: 24,
height: 24, height: 24,
decoration: containerColorRadiusBorderWidth(isSelected ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), decoration: containerColorRadiusBorderWidth(
isSelected
? CustomColors.accentColor
: Colors.transparent,
100,
Colors.grey,
0.5),
), ),
mWidth(12), mWidth(12),
Container( Container(
@ -157,7 +200,8 @@ class PaymentMethodCard extends StatelessWidget {
if (isSelected) if (isSelected)
Container( Container(
decoration: containerRadius(CustomColors.green, 200), decoration: containerRadius(CustomColors.green, 200),
padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), padding:
EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
child: Text( child: Text(
TranslationBase.of(context).paymentSelected, TranslationBase.of(context).paymentSelected,
style: TextStyle( style: TextStyle(
@ -170,40 +214,6 @@ class PaymentMethodCard extends StatelessWidget {
), ),
), ),
), ),
// Container(
// margin: EdgeInsets.symmetric(horizontal: 2, vertical: 0),
// child: Stack(
// children: [
// Container(
// padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
// margin: EdgeInsets.symmetric(horizontal: 14, vertical: 8),
// decoration: new BoxDecoration(
// color: Colors.grey.shade100,
// shape: BoxShape.rectangle,
// borderRadius: BorderRadius.circular(8),
// border: Border.fromBorderSide(BorderSide(
// color: isSelected ? Color(0xff20BC11) : Colors.grey.shade300,
// width: 0.8,
// )),
// ),
// width: cardWidth,
// child: Image.asset(
// getPaymentOptionImage(paymentOption),
// fit: BoxFit.cover,
// ),
// ),
// if (isSelected)
// Positioned(
// right: 1,
// child: Icon(
// Icons.check_circle,
// color: Color(0xff20BC11),
// size: 30,
// ),
// ),
// ],
// ),
// ),
), ),
); );
} }

@ -209,13 +209,7 @@ class _FooterWidgetState extends State<FooterWidget> {
); );
} else { } else {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
// Navigator.of(context).pushNamed(
// CART_ORDER_PAGE,
// );
Navigator.push(
context,
FadePage(page: CartOrderPage()),
);
} }
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -1,7 +1,10 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart';
@ -9,9 +12,13 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/sh
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'availability_info.dart'; import 'availability_info.dart';
import 'details_info.dart'; import 'details_info.dart';
@ -85,10 +92,11 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProductDetailViewModel>( return BaseView<ProductDetailViewModel>(
allowAny: true, allowAny: true,
onModelReady: (model) { onModelReady: (model) async {
model.getProductReviewsData(widget.product.id); await model.getProductReviewsData(widget.product.id).then((value) {});
}, },
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).productDetails, appBarTitle: TranslationBase.of(context).productDetails,
@ -103,265 +111,244 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
await addToWishlistFunction(itemID: itemID, model: model); await addToWishlistFunction(itemID: itemID, model: model);
}, },
deleteFromWishlistFunction: () async { deleteFromWishlistFunction: () async {
await deleteFromWishlistFunction( await deleteFromWishlistFunction(itemID: itemID, model: model);
itemID: itemID, model: model);
}, },
isInWishList: isInWishList, isInWishList: isInWishList,
addToCartFunction: addToCartFunction, addToCartFunction: addToCartFunction,
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column(
children: [
Container(
width: double.infinity,
color: Colors.white,
child: Column( child: Column(
children: [ children: [
if (widget.product.images.isNotEmpty) Container(
Container( width: double.infinity,
height: MediaQuery.of(context).size.height * .40, color: Colors.white,
child: Image.network( child: Column(
widget.product.images[0].src.trim(), children: [
fit: BoxFit.contain, if (widget.product.images.isNotEmpty)
), Container(
height: MediaQuery.of(context).size.height * .40,
child: Image.network(
widget.product.images[0].src.trim(),
fit: BoxFit.contain,
),
),
if (widget.product.discountDescription != null) DiscountDescription(product: widget.product)
],
), ),
if (widget.product.discountDescription != null) ),
DiscountDescription(product: widget.product) SizedBox(
], height: 4,
), ),
), Container(
SizedBox( color: Colors.white,
height: 4, child: ProductNameAndPrice(
), context,
Container( widget.product,
color: Colors.white,
child: ProductNameAndPrice(
context,
widget.product,
customerId: customerId,
addToWishlistFunction: (item) {
addToWishlistFunction(itemID: item, model: model);
setState(() {});
},
deleteFromWishlistFunction: (item) {
deleteFromWishlistFunction(
itemID: item, model: model);
setState(() {});
},
notifyMeWhenAvailable: (context, itemId) {
notifyMeWhenAvailable(
itemId: itemId,
customerId: customerId, customerId: customerId,
model: model); addToWishlistFunction: (item) {
}, addToWishlistFunction(itemID: item, model: model);
isInWishList: isInWishList, setState(() {});
isStockAvailable: model.isStockAvailable, },
), deleteFromWishlistFunction: (item) {
), deleteFromWishlistFunction(itemID: item, model: model);
SizedBox( setState(() {});
height: 6, },
), notifyMeWhenAvailable: (context, itemId) {
Container( notifyMeWhenAvailable(itemId: itemId, customerId: customerId, model: model);
color: Colors.white, },
child: Column( isInWishList: isInWishList,
mainAxisAlignment: MainAxisAlignment.start, isStockAvailable: model.isStockAvailable,
crossAxisAlignment: CrossAxisAlignment.start, stockAvailability: projectViewModel.isArabic ? model.stockAvailabilityn : model.stockAvailability,
children: [ ),
),
SizedBox(
height: 6,
),
Container( Container(
padding: EdgeInsets.symmetric( color: Colors.white,
vertical: 15, horizontal: 10), child: Column(
child: Texts( mainAxisAlignment: MainAxisAlignment.start,
TranslationBase.of(context).specification, crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 15, children: [
fontWeight: FontWeight.bold, Container(
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
child: Texts(
TranslationBase.of(context).specification,
fontSize: 15,
fontWeight: FontWeight.bold,
),
width: double.infinity,
),
// Divider(color: Colors.grey),
],
), ),
width: double.infinity,
), ),
// Divider(color: Colors.grey), SizedBox(
], height: 6,
), ),
), Container(
SizedBox( // width: 500,
height: 6, margin: EdgeInsets.only(bottom: 6),
), color: Colors.white,
Container( child: Column(
// width: 500, crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only(bottom: 6), children: [
color: Colors.white, Row(
child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Column(
Row( children: [
mainAxisAlignment: MainAxisAlignment.spaceEvenly, FlatButton(
children: [ onPressed: () {
Column( setState(() {
children: [ isDetails = true;
FlatButton( isReviews = false;
onPressed: () { isAvailability = false;
setState(() { });
isDetails = true; },
isReviews = false; child: Text(
isAvailability = false; TranslationBase.of(context).details,
}); style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
}, ),
child: Text( color: Colors.white,
TranslationBase.of(context).details, ),
style: TextStyle( CustomDivider(
fontSize: 16, color: isDetails ? Colors.green : Colors.transparent,
fontWeight: FontWeight.bold), )
],
), ),
color: Colors.white, SizedBox(
), width: 20,
CustomDivider(
color: isDetails
? Colors.green
: Colors.transparent,
)
],
),
SizedBox(
width: 20,
),
Column(
children: [
FlatButton(
onPressed: () async {
if (widget.product.approvedTotalReviews >
0) {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getProductReviewsData(
widget.product.id);
GifLoaderDialogUtils.hideDialog(
context);
} else {
model.clearReview();
}
setState(() {
isDetails = false;
isReviews = true;
isAvailability = false;
});
},
child: Text(
TranslationBase.of(context).reviews,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
), ),
color: Colors.white, Column(
), children: [
CustomDivider( FlatButton(
color: isReviews onPressed: () async {
? Colors.green if (widget.product.approvedTotalReviews > 0) {
: Colors.transparent, GifLoaderDialogUtils.showMyDialog(context);
), await model.getProductReviewsData(widget.product.id);
], GifLoaderDialogUtils.hideDialog(context);
), } else {
SizedBox( model.clearReview();
width: 20, }
), setState(() {
Column( isDetails = false;
children: [ isReviews = true;
FlatButton( isAvailability = false;
onPressed: () async { });
GifLoaderDialogUtils.showMyDialog( },
context); child: Text(
await model.getProductLocationData(); TranslationBase.of(context).reviews,
GifLoaderDialogUtils.hideDialog(context); style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
color: Colors.white,
),
CustomDivider(
color: isReviews ? Colors.green : Colors.transparent,
),
],
),
SizedBox(
width: 20,
),
Column(
children: [
FlatButton(
onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getProductLocationData();
GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
isDetails = false; isDetails = false;
isReviews = false; isReviews = false;
isAvailability = true; isAvailability = true;
}); });
}, },
child: Text( child: Text(
TranslationBase.of(context).availability, TranslationBase.of(context).availability,
style: TextStyle( style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
fontSize: 16, ),
fontWeight: FontWeight.bold), color: Colors.white,
),
CustomDivider(
color: isAvailability ? Colors.green : Colors.transparent,
),
],
), ),
color: Colors.white, ],
), ),
CustomDivider( SizedBox(
color: isAvailability height: 10,
? Colors.green ),
: Colors.transparent, isDetails
), ? DetailsInfo(
], product: widget.product,
), )
], : isReviews
? ReviewsInfo(
product: widget.product,
previousModel: model,
)
: isAvailability
? AvailabilityInfo(
previousModel: model,
)
: Container(),
],
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
isDetails RecommendedProducts(
? DetailsInfo( product: widget.product,
product: widget.product, productDetailViewModel: model,
) addToWishlistFunction: (itemID) async {
: isReviews await addToWishlistFunction(itemID: itemID, model: model);
? ReviewsInfo( },
product: widget.product, deleteFromWishlistFunction: (itemID) async {
previousModel: model, await deleteFromWishlistFunction(itemID: itemID, model: model);
) },
: isAvailability )
? AvailabilityInfo(
previousModel: model,
)
: Container(),
], ],
), ),
), ),
SizedBox( // : AppCircularProgressIndicator(),
height: 10, bottomSheet: model.state == ViewState.Idle || model.state == ViewState.ErrorLocal
), ? FooterWidget(
RecommendedProducts( model.isStockAvailable,
product: widget.product, widget.product.orderMaximumQuantity,
productDetailViewModel: model, widget.product.orderMinimumQuantity,
addToWishlistFunction: (itemID) async { model.stockQuantity,
await addToWishlistFunction( widget.product,
itemID: itemID, model: model); quantity: quantity,
}, isOverQuantity: isOverQuantity,
deleteFromWishlistFunction: (itemID) async { addToCartFunction: addToCartFunction,
await deleteFromWishlistFunction( addToShoppingCartFunction: addToShoppingCartFunction,
itemID: itemID, model: model); model: model,
},
) )
], : SizedBox(),
),
),
bottomSheet: FooterWidget(
model.isStockAvailable,
widget.product.orderMaximumQuantity,
widget.product.orderMinimumQuantity,
model.stockQuantity,
widget.product,
quantity: quantity,
isOverQuantity: isOverQuantity,
addToCartFunction: addToCartFunction,
addToShoppingCartFunction: addToShoppingCartFunction,
model: model,
),
)); ));
} }
addToShoppingCartFunction( addToShoppingCartFunction({quantity, itemID, ProductDetailViewModel model}) async {
{quantity, itemID, ProductDetailViewModel model}) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.addToCartData(quantity, itemID); await model.addToCartData(quantity, itemID, context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if(model.state != ViewState.ErrorLocal)
Utils.navigateToCartPage();
} }
addToWishlistFunction({itemID, ProductDetailViewModel model}) async { addToWishlistFunction({itemID, ProductDetailViewModel model}) async {
isInWishList = true; isInWishList = true;
await model.addToWishlistData(itemID); await model.addToWishlistData(itemID, context);
setState(() {}); setState(() {});
} }
deleteFromWishlistFunction({itemID, ProductDetailViewModel model}) async { deleteFromWishlistFunction({itemID, ProductDetailViewModel model}) async {
isInWishList = false; isInWishList = false;
await model.deleteWishlistData(itemID); await model.deleteWishlistData(itemID, context);
setState(() {}); setState(() {});
} }
@ -371,12 +358,11 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
ProductDetailViewModel model, ProductDetailViewModel model,
}) async { }) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.addToCartData(quantity, itemID); await model.addToCartData(quantity, itemID, context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }
} }
notifyMeWhenAvailable( notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model, context}) async {
{itemId, customerId, ProductDetailViewModel model}) async { await model.notifyMe(customerId, itemId, context);
await model.notifyMe(customerId, itemId);
} }

@ -20,11 +20,12 @@ class ProductNameAndPrice extends StatefulWidget {
final Function addToWishlistFunction; final Function addToWishlistFunction;
final Function deleteFromWishlistFunction; final Function deleteFromWishlistFunction;
final bool isStockAvailable; final bool isStockAvailable;
final String stockAvailability;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
ProductNameAndPrice(this.context, this.item, ProductNameAndPrice(this.context, this.item,
{this.customerId, this.isInWishList, this.notifyMeWhenAvailable, this.addToWishlistFunction, this.deleteFromWishlistFunction, @required this.isStockAvailable}); {this.customerId, this.isInWishList, this.notifyMeWhenAvailable, this.addToWishlistFunction, this.deleteFromWishlistFunction, this.isStockAvailable = true, this.stockAvailability});
@override @override
_ProductNameAndPriceState createState() => _ProductNameAndPriceState(); _ProductNameAndPriceState createState() => _ProductNameAndPriceState();
@ -48,14 +49,14 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
children: [ children: [
Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20), Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20),
Texts( Texts(
projectViewModel.isArabic ? widget.item.stockAvailabilityn : widget.item.stockAvailability, widget.stockAvailability,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 15, fontSize: 15,
color: widget.isStockAvailable ? Colors.green : Colors.red, color: widget.isStockAvailable ? Colors.green : Colors.red,
), ),
// SizedBox(width: 20), // SizedBox(width: 20),
if (widget.authenticatedUserObject.isLogin) if (widget.authenticatedUserObject.isLogin)
widget.isStockAvailable && widget.customerId != null !widget.isStockAvailable && widget.customerId != null
? InkWell( ? InkWell(
onTap: () => widget.notifyMeWhenAvailable(context, widget.item.id), onTap: () => widget.notifyMeWhenAvailable(context, widget.item.id),
child: Row(children: [ child: Row(children: [
@ -128,11 +129,11 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Texts( // Texts(
"${widget.item.approvedRatingSum}", // "${widget.item.approvedRatingSum}",
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
fontSize: 12, // fontSize: 12,
), // ),
SizedBox( SizedBox(
width: 30, width: 30,
), ),

@ -2,9 +2,11 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -74,10 +76,13 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icons.shopping_cart, icon: Icons.shopping_cart,
color: Colors.grey[800], color: Colors.grey[800],
onPress: () { onPress: () {
Navigator.push(
context, Navigator.pushAndRemoveUntil(
MaterialPageRoute(builder: (context) => CartOrderPage()), locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 3)), (Route<dynamic> r) => false);
); // Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => CartOrderPage()),
// );
}), }),
if (Provider.of<OrderPreviewViewModel>(context, if (Provider.of<OrderPreviewViewModel>(context,
listen: false) listen: false)
@ -157,7 +162,9 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
AppToast.showErrorToast(message: "you should add quantity"); AppToast.showErrorToast(message: TranslationBase.of(context).addQuantity
// "you should add quantity"
);
} }
}), }),
ListTile( ListTile(
@ -184,7 +191,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
), ),
onTap: () { onTap: () {
Provider.of<CompareList>(context, listen: false) Provider.of<CompareList>(context, listen: false)
.addItem(specificationData); .addItem(specificationData,context);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
), ),

@ -534,13 +534,13 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
addToWishlistFunction(itemID) async { addToWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlist = true; isInWishlist = true;
await x.addToWishlistData(itemID); await x.addToWishlistData(itemID, context);
} }
deleteFromWishlistFunction(itemID) async { deleteFromWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlist = false; isInWishlist = false;
await x.addToWishlistData(itemID); await x.addToWishlistData(itemID, context);
} }
} }

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
class SearchBrandsPage extends StatefulWidget { class SearchBrandsPage extends StatefulWidget {
@override @override
@ -22,6 +24,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<BrandsViewModel>( return BaseView<BrandsViewModel>(
onModelReady: (model) => model.searchProducts(), onModelReady: (model) => model.searchProducts(),
builder: (BuildContext context, model, Widget child) => builder: (BuildContext context, model, Widget child) =>
@ -60,7 +63,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
RegExp regExp = RegExp(r'([A-Za-z0-9 a space])'); RegExp regExp = RegExp(r'([A-Za-z0-9 a space])');
if (value.isEmpty) { if (value.isEmpty) {
TranslationBase.of(context).pleaseEnterProductName; TranslationBase.of(context).pleaseEnterProductName;
}else if (regExp.hasMatch(value)){ }else if (!regExp.hasMatch(value)){
AppToast.showErrorToast(message: TranslationBase.of(context).noArabicLetters); AppToast.showErrorToast(message: TranslationBase.of(context).noArabicLetters);
} }
return null; return null;
@ -112,7 +115,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
model.searchList.length == 0 model.searchList.length == 0
? Container( ? Container(
child: Text( child: Text(
'no data' + model.searchList.length.toString()), TranslationBase.of(context).noData + model.searchList.length.toString()),
) )
: Expanded( : Expanded(
child: Container( child: Container(
@ -128,8 +131,9 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Text( child: Text( projectProvider.isArabic
model.searchList[index].name, ? model.searchList[index].namen
:model.searchList[index].name,
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
), ),

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class ProductTileItem extends StatelessWidget { class ProductTileItem extends StatelessWidget {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
@ -178,15 +179,31 @@ class ProductTileItem extends StatelessWidget {
), ),
Row( Row(
children: [ children: [
Expanded( // Expanded(
child: StarRating( RatingBar.readOnly(
totalAverage: item.approvedTotalReviews > 0 initialRating: item.approvedRatingSum.toDouble(),
? (item.approvedRatingSum.toDouble() / size: 15.0,
item.approvedTotalReviews.toDouble()) filledColor: Colors.yellow[700],
.toDouble() emptyColor: Colors.grey[500],
: 0, isHalfAllowed: true,
forceStars: true), halfFilledIcon: Icons.star_half,
), filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Texts(
"(${item.approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
// StarRating(
// totalAverage: item.approvedTotalReviews > 0
// ? (item.approvedRatingSum.toDouble() /
// item.approvedTotalReviews.toDouble())
// .toDouble()
// : 0,
// forceStars: true),
// ),
], ],
), ),
], ],

@ -36,7 +36,7 @@ class PrescriptionsWidget extends StatelessWidget {
ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()), ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()),
Container( Container(
margin: EdgeInsets.only(right: 10.0, left: 10.0), margin: EdgeInsets.only(right: 10.0, left: 10.0),
height: MediaQuery.of(context).size.height * 0.19, height: MediaQuery.of(context).size.height * 0.30,
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -13,13 +15,24 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
///TODO Elham* split this to tow files
class PharmacyAddressesPage extends StatefulWidget { class PharmacyAddressesPage extends StatefulWidget {
final OrderPreviewViewModel orderPreviewViewModel;
final Function changeMainState;
final bool isUpdate;
const PharmacyAddressesPage(
{Key key, this.orderPreviewViewModel, this.isUpdate = false, this.changeMainState})
: super(key: key);
@override @override
_PharmacyAddressesState createState() => _PharmacyAddressesState(); _PharmacyAddressesState createState() => _PharmacyAddressesState();
} }
class _PharmacyAddressesState extends State<PharmacyAddressesPage> { class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
void navigateToAddressPage(BuildContext ctx, PharmacyAddressesViewModel model, AddressInfo address) { void navigateToAddressPage(
BuildContext ctx, PharmacyAddressesViewModel model, AddressInfo address) {
Navigator.push( Navigator.push(
ctx, ctx,
FadePage( FadePage(
@ -35,7 +48,7 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
return BaseView<PharmacyAddressesViewModel>( return BaseView<PharmacyAddressesViewModel>(
onModelReady: (model) => model.getAddressesList(), onModelReady: (model) => model.getAddressesList(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).changeAddress, appBarTitle: widget.isUpdate?TranslationBase.of(context).changeAddress:"Add Address",
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
baseViewModel: model, baseViewModel: model,
@ -78,8 +91,9 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
}, },
), ),
), ),
SizedBox(height: height * 0.10,) SizedBox(
height: height * 0.10,
)
], ],
), ),
), ),
@ -108,8 +122,14 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
fontSize: 14, fontSize: 14,
vPadding: 8, vPadding: 8,
handler: () { handler: () {
model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]); //TODO Elham*
Navigator.pop(context, model.addresses[model.selectedAddressIndex]); widget.orderPreviewViewModel.paymentCheckoutData
.address =
Addresses.fromJson(
model.addresses[model.selectedAddressIndex].toJson());
model.saveSelectedAddressLocally(
model.addresses[model.selectedAddressIndex]);
_navigateToPaymentOption(model);
}, },
), ),
), ),
@ -119,6 +139,33 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
), ),
); );
} }
_navigateToPaymentOption(model) {
if(widget.isUpdate) {
print("sfsf");
widget.orderPreviewViewModel.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson());
widget.changeMainState();
Navigator.pop(context);
return;
}
Navigator.push(
context,
FadePage(
page: PaymentMethodSelectPage(
model: widget.orderPreviewViewModel,
))).then((result) => {
setState(() {
if (result != null) {
var paymentOption = result;
widget.orderPreviewViewModel.paymentCheckoutData.paymentOption =
paymentOption;
}
// widget.changeMainState();
})
});
}
} }
class AddressItemWidget extends StatelessWidget { class AddressItemWidget extends StatelessWidget {
@ -128,7 +175,8 @@ class AddressItemWidget extends StatelessWidget {
final bool isSelected; final bool isSelected;
final Function(AddressInfo) onTabEditAddress; final Function(AddressInfo) onTabEditAddress;
AddressItemWidget(this.model, this.address, this.selectAddress, this.isSelected, this.onTabEditAddress); AddressItemWidget(this.model, this.address, this.selectAddress,
this.isSelected, this.onTabEditAddress);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -154,13 +202,18 @@ class AddressItemWidget extends StatelessWidget {
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: !isSelected ? Colors.white : Colors.green, color: !isSelected ? Colors.white : Colors.green,
shape: BoxShape.circle, shape: BoxShape.circle,
border: Border.all(color: Colors.grey, style: BorderStyle.solid, width: 1.0), border: Border.all(
color: Colors.grey,
style: BorderStyle.solid,
width: 1.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(0.0), padding: const EdgeInsets.all(0.0),
child: Icon( child: Icon(
Icons.check, Icons.check,
color: isSelected ? Colors.white : Colors.transparent, color: isSelected
? Colors.white
: Colors.transparent,
size: 25, size: 25,
), ),
), ),
@ -173,7 +226,8 @@ class AddressItemWidget extends StatelessWidget {
Expanded( Expanded(
child: Container( child: Container(
child: Container( child: Container(
margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12), margin:
EdgeInsets.symmetric(vertical: 12, horizontal: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -236,7 +290,8 @@ class AddressItemWidget extends StatelessWidget {
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding:
const EdgeInsets.symmetric(horizontal: 8),
child: SizedBox( child: SizedBox(
child: Container( child: Container(
width: 1, width: 1,
@ -254,13 +309,21 @@ class AddressItemWidget extends StatelessWidget {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
title: "Are you sure want to delete", title: "Are you sure want to delete",
confirmMessage: "${address.address1} ${address.address2}", confirmMessage:
okText: TranslationBase.of(context).delete, "${address.address1} ${address.address2}",
cancelText: TranslationBase.of(context).cancel_nocaps, okText:
TranslationBase.of(context).delete,
cancelText: TranslationBase.of(context)
.cancel_nocaps,
okFunction: () => { okFunction: () => {
model.deleteAddresses(address).then((_) { model
ConfirmDialog.closeAlertDialog(context); .deleteAddresses(address)
AppToast.showErrorToast(message: "Address has been deleted"); .then((_) {
ConfirmDialog.closeAlertDialog(
context);
AppToast.showErrorToast(
message:
"Address has been deleted");
}) })
}, },
cancelFunction: () => {}); cancelFunction: () => {});

@ -80,7 +80,8 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
page: model.categorise[index].id != '12' page: model.categorise[index].id != '12'
? ParentCategorisePage( ? ParentCategorisePage(
id: model.categorise[index].id, id: model.categorise[index].id,
titleName: model.categorise[index].name, titleName: projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name,
// titleName: model.categorise[index].name,
) )
: FinalProductsPage( : FinalProductsPage(
id: model.categorise[index].id, id: model.categorise[index].id,

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
// import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart'; // import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -13,6 +14,7 @@ import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
@ -28,6 +30,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.clearSearchList(), onModelReady: (model) => model.clearSearchList(),
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model,
@ -67,7 +70,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
if (value.isEmpty) { if (value.isEmpty) {
TranslationBase.of(context) TranslationBase.of(context)
.pleaseEnterProductName; .pleaseEnterProductName;
} else if (regExp.hasMatch(value)) { } else if (!regExp.hasMatch(value)) {
AppToast.showErrorToast( AppToast.showErrorToast(
message: TranslationBase.of(context) message: TranslationBase.of(context)
.noArabicLetters); .noArabicLetters);
@ -220,19 +223,29 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
Radius.circular( Radius.circular(
6)), 6)),
), ),
child: Texts( child: model.searchList[index].rxMessage != null
model.searchList[index] ? Texts(
.rxMessage != projectProvider.isArabic
null ? model.searchList[index].rxMessagen
? model : model.searchList[index].rxMessage,
.searchList[index]
.rxMessage
: "",
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ): Texts(""),
// Texts(
// model.searchList[index]
// .rxMessage !=
// null
// ? model
// .searchList[index]
// .rxMessage
// : "",
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w400,
// ),
), ),
], ],
), ),
@ -245,9 +258,11 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(projectProvider.isArabic
model ? model.searchList[index].namen
.searchList[index].name, :model.searchList[index].name,
// model.searchList[index].name,
regular: true, regular: true,
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,

File diff suppressed because it is too large Load Diff

@ -140,7 +140,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future<dynamic> sendActivationCode(cellNumber, zipCode, patientIdentificationID) async { Future<dynamic> sendActivationCode(cellNumber, zipCode, patientIdentificationID, responseID) async {
try { try {
dynamic localRes; dynamic localRes;
var request = SendActivationRequest(); var request = SendActivationRequest();
@ -151,6 +151,8 @@ class FamilyFilesProvider with ChangeNotifier {
request.loginType = request.searchType = 1; request.loginType = request.searchType = 1;
request.oTPSendType = 1; request.oTPSendType = 1;
request.isRegister = false; request.isRegister = false;
request.responseID = responseID;
request.status = 2;
await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -166,7 +168,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
//TODO //TODO
Future<dynamic> checkActivationCode(loginTokenID, activationCode, indentification, mobileNo) async { Future<dynamic> checkActivationCode(loginTokenID, activationCode, indentification, mobileNo, requestID, responseID) async {
try { try {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
@ -175,6 +177,10 @@ class FamilyFilesProvider with ChangeNotifier {
request['PatientIdentificationID'] = indentification; request['PatientIdentificationID'] = indentification;
request['LogInTokenID'] = loginTokenID; request['LogInTokenID'] = loginTokenID;
request['activationCode'] = activationCode; request['activationCode'] = activationCode;
request['PatientShareRequestID'] = requestID;
request['ResponseID'] = responseID;
request['Status'] = 3;
// this.authService.authenticateRequest(request); // this.authService.authenticateRequest(request);
await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;

@ -2,15 +2,12 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/models/pharmacy/addToCartModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/models/pharmacy/specification.dart'; import 'package:diplomaticquarterapp/models/pharmacy/specification.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class ProductDetailService extends BaseService { class ProductDetailService extends BaseService {
bool isLogin = false; bool isLogin = false;
@ -20,8 +17,10 @@ class ProductDetailService extends BaseService {
num get stockQuantity => _stockQuantity; num get stockQuantity => _stockQuantity;
String _stockAvailability; String _stockAvailability;
String _stockAvailabilityn;
String get stockAvailability => _stockAvailability; String get stockAvailability => _stockAvailability;
String get stockAvailabilityn => _stockAvailabilityn;
bool _isStockAvailable; bool _isStockAvailable;
@ -49,7 +48,7 @@ class ProductDetailService extends BaseService {
Future getProductReviews(productID) async { Future getProductReviews(productID) async {
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL + productID + "?fields=reviews,stock_quantity,stock_availability,IsStockAvailable", onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL + productID + "?fields=reviews,stock_quantity,stock_availability,stock_availabilityn,IsStockAvailable", onSuccess: (dynamic response, int statusCode) {
_productDetailList.clear(); _productDetailList.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
_productDetailList.add(ProductDetail.fromJson(item)); _productDetailList.add(ProductDetail.fromJson(item));
@ -57,7 +56,10 @@ class ProductDetailService extends BaseService {
}); });
_stockQuantity = response['products'][0]['stock_quantity']; _stockQuantity = response['products'][0]['stock_quantity'];
_stockAvailability = response['products'][0]['stock_availability']; _stockAvailability = response['products'][0]['stock_availability'];
_isStockAvailable = response['products'][0]['IsStockAvailable']; _stockAvailabilityn = response['products'][0]['stock_availabilityn'];
// _isStockAvailable = response['products'][0]['IsStockAvailable'];
_isStockAvailable = _stockAvailability == "In stock" ? true : false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -93,7 +95,7 @@ class ProductDetailService extends BaseService {
}, body: request); }, body: request);
} }
Future<Map> addToCart(quantity, itemID) async { Future<Map> addToCart(quantity, itemID, context) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false; hasError = false;
Map<String, dynamic> request; Map<String, dynamic> request;
@ -108,7 +110,9 @@ class ProductDetailService extends BaseService {
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {
_addToCartModel.add(Wishlist.fromJson(item)); _addToCartModel.add(Wishlist.fromJson(item));
}); });
AppToast.showSuccessToast(message: 'You have added a product to the cart'); AppToast.showSuccessToast(message: TranslationBase.of(context).addToCartMsg
// 'You have added a product to the cart'
);
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -119,10 +123,12 @@ class ProductDetailService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future notifyMe(customerId, itemID) async { Future notifyMe(customerId, itemID, context) async {
hasError = false; hasError = false;
await baseAppClient.getPharmacy(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) {
AppToast.showSuccessToast(message: 'You will be notified when product available'); AppToast.showSuccessToast(message: TranslationBase.of(context).notifyMeMsg
//'You will be notified when product available'
);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -130,7 +136,7 @@ class ProductDetailService extends BaseService {
}); });
} }
Future addToWishlist(itemID) async { Future addToWishlist(itemID, context) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false; hasError = false;
Map<String, dynamic> request; Map<String, dynamic> request;
@ -143,7 +149,9 @@ class ProductDetailService extends BaseService {
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item)); _wishListProducts.add(Wishlist.fromJson(item));
}); });
AppToast.showSuccessToast(message: 'You have added a product to the Wishlist'); AppToast.showSuccessToast(message: TranslationBase.of(context).addToWishlistMsg
// 'You have added a product to the Wishlist'
);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -165,7 +173,7 @@ class ProductDetailService extends BaseService {
}); });
} }
Future deleteItemFromWishlist(itemID) async { Future deleteItemFromWishlist(itemID, context) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(DELETE_WISHLIST + customerId + "+&product_id=" + itemID + "&cart_type=Wishlist", onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(DELETE_WISHLIST + customerId + "+&product_id=" + itemID + "&cart_type=Wishlist", onSuccess: (dynamic response, int statusCode) {
@ -173,7 +181,9 @@ class ProductDetailService extends BaseService {
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item)); _wishListProducts.add(Wishlist.fromJson(item));
}); });
AppToast.showSuccessToast(message: 'You have removed a product from the Wishlist'); AppToast.showSuccessToast(message: TranslationBase.of(context).removeFromWishlistMsg
// 'You have removed a product from the Wishlist'
);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -509,7 +509,7 @@ class TranslationBase {
String get switchUser => localizedValues['switch-login'][locale.languageCode]; String get switchUser => localizedValues['switch-login'][locale.languageCode];
String get removeMember => localizedValues['remove-member'][locale.languageCode]; String get removeMember => localizedValues['remove-membe'][locale.languageCode];
String get allowView => localizedValues['allow-view'][locale.languageCode]; String get allowView => localizedValues['allow-view'][locale.languageCode];
@ -1206,6 +1206,26 @@ class TranslationBase {
String get refine => localizedValues['refine'][locale.languageCode]; String get refine => localizedValues['refine'][locale.languageCode];
String get max => localizedValues['max'][locale.languageCode];
String get min => localizedValues['min'][locale.languageCode];
String get addToCompareMsg => localizedValues['addToCompareMsg'][locale.languageCode];
String get itInListMsg => localizedValues['itInListMsg'][locale.languageCode];
String get compareListFull => localizedValues['compareListFull'][locale.languageCode];
String get addQuantity => localizedValues['addQuantity'][locale.languageCode];
String get addToCartMsg => localizedValues['addToCartMsg'][locale.languageCode];
String get addToWishlistMsg => localizedValues['addToWishlistMsg'][locale.languageCode];
String get notifyMeMsg => localizedValues['notifyMeMsg'][locale.languageCode];
String get removeFromWishlistMsg => localizedValues['removeFromWishlistMsg'][locale.languageCode];
String get apply => localizedValues['apply'][locale.languageCode]; String get apply => localizedValues['apply'][locale.languageCode];
String get reset => localizedValues['reset'][locale.languageCode]; String get reset => localizedValues['reset'][locale.languageCode];
@ -1770,8 +1790,6 @@ class TranslationBase {
String get requestSent => localizedValues['request-sent'][locale.languageCode]; String get requestSent => localizedValues['request-sent'][locale.languageCode];
String get submitReview => localizedValues['submitReview'][locale.languageCode];
String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode];
String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode];
@ -2692,6 +2710,73 @@ class TranslationBase {
String get dietUSDA => localizedValues["dietUSDA"][locale.languageCode]; String get dietUSDA => localizedValues["dietUSDA"][locale.languageCode];
String get dietZone => localizedValues["dietZone"][locale.languageCode]; String get dietZone => localizedValues["dietZone"][locale.languageCode];
String get useFullInfo => localizedValues["usefulInfo"][locale.languageCode];
String get babyAge => localizedValues["babyAge"][locale.languageCode];
String get babyAgeAvail => localizedValues["babyAgeAvail"][locale.languageCode];
String get deliveryDue => localizedValues["deliveryDue"][locale.languageCode];
String get almostInactive => localizedValues["almostInactive"][locale.languageCode];
String get lightActive1 => localizedValues["lightActive1"][locale.languageCode];
String get veryActive => localizedValues["veryActive"][locale.languageCode];
String get superActive => localizedValues["superActive"][locale.languageCode];
String get dailyIntake => localizedValues["dailyIntake"][locale.languageCode];
String get calculateAmount => localizedValues["calculateAmount"][locale.languageCode];
String get bodyWillBurn => localizedValues["bodyWillBurn"][locale.languageCode];
String get caloriesEachDay => localizedValues["caloriesEachDay"][locale.languageCode];
String get maintainWeight => localizedValues["maintainWeight"][locale.languageCode];
String get mediumFinger => localizedValues["mediumFinger"][locale.languageCode];
String get smallFinger => localizedValues["smallFinger"][locale.languageCode];
String get largeFinger => localizedValues["largeFinger"][locale.languageCode];
String get idealBodyWeight => localizedValues["idealBodyWeight"][locale.languageCode];
String get bodyFrameSize => localizedValues["bodyFrameSize"][locale.languageCode];
String get idealWeightRange => localizedValues["idealWeightRange"][locale.languageCode];
String get currentWeightPerfect => localizedValues["currentWeightPerfect"][locale.languageCode];
String get littleBitWeightMore => localizedValues["littleBitWeightMore"][locale.languageCode];
String get consultWithDoctor => localizedValues["consultWithDoctor"][locale.languageCode];
String get excessiveObesity => localizedValues["excessiveObesity"][locale.languageCode];
String get mayWish => localizedValues["mayWish"][locale.languageCode];
String get underObese => localizedValues["underObese"][locale.languageCode];
String get crossedLimits => localizedValues["crossedLimits"][locale.languageCode];
String get lowLimits => localizedValues["lowLimits"][locale.languageCode];
String get estimates => localizedValues["estimates"][locale.languageCode];
String get submitReview => localizedValues["submitReview"][locale.languageCode];
String get Protein => localizedValues["Protein"][locale.languageCode];
String get Cals => localizedValues["Cals"][locale.languageCode];
String get gramsPerDay => localizedValues["gramsPerDay"][locale.languageCode];
String get gr => localizedValues["gr"][locale.languageCode];
String get gramsPerMeal => localizedValues["gramsPerMeal"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart';
import 'package:diplomaticquarterapp/pages/medical/active_medications/ActiveMedicationsPage.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/ActiveMedicationsPage.dart';
import 'package:diplomaticquarterapp/pages/medical/allergies_page.dart'; import 'package:diplomaticquarterapp/pages/medical/allergies_page.dart';
import 'package:diplomaticquarterapp/pages/medical/ask_doctor/ask_doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/ask_doctor/ask_doctor_home_page.dart';
@ -44,13 +45,14 @@ import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../Constants.dart'; import '../Constants.dart';
import '../locator.dart';
import 'app_shared_preferences.dart'; import 'app_shared_preferences.dart';
import 'app_toast.dart'; import 'app_toast.dart';
import 'gif_loader_dialog_utils.dart'; import 'gif_loader_dialog_utils.dart';
import 'navigation_service.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
class Utils { class Utils {
// static ProgressDialog pr; // static ProgressDialog pr;
@ -66,8 +68,10 @@ class Utils {
/// Check The Internet Connection /// Check The Internet Connection
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); ConnectivityResult connectivityResult =
if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { await (Connectivity().checkConnectivity());
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true; return true;
} else { } else {
return false; return false;
@ -131,11 +135,19 @@ class Utils {
} }
static String getAppointmentTransID(int projectID, int clinicID, int appoNo) { static String getAppointmentTransID(int projectID, int clinicID, int appoNo) {
return projectID.toString() + '-' + clinicID.toString() + '-' + appoNo.toString(); return projectID.toString() +
'-' +
clinicID.toString() +
'-' +
appoNo.toString();
} }
static String getAdvancePaymentTransID(int projectID, int fileNumber) { static String getAdvancePaymentTransID(int projectID, int fileNumber) {
return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString(); return projectID.toString() +
'-' +
fileNumber.toString() +
'-' +
DateTime.now().millisecondsSinceEpoch.toString();
} }
bool validateIDBox(String value, type) { bool validateIDBox(String value, type) {
@ -195,14 +207,22 @@ class Utils {
} }
static validEmail(email) { static validEmail(email) {
return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email); return RegExp(
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
.hasMatch(email);
} }
static List<Widget> myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { static List<Widget> myMedicalList(
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List(); List<Widget> medical = List();
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null, onTap: () => projectViewModel.havePrivilege(5)
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin child: isLogin
? Stack(children: [ ? Stack(children: [
Container( Container(
@ -229,7 +249,11 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(count.toString(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -247,7 +271,11 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(count.toString(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -274,7 +302,9 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, onTap: () => projectViewModel.havePrivilege(7)
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg', imagePath: 'radiology.svg',
@ -284,7 +314,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, onTap: () => projectViewModel.havePrivilege(12)
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context).medicines,
imagePath: 'medicine_prescription.svg', imagePath: 'medicine_prescription.svg',
@ -310,7 +342,8 @@ class Utils {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () {
if (projectViewModel.havePrivilege(48)) Navigator.push(context, FadePage(page: ActiveMedicationsPage())); if (projectViewModel.havePrivilege(48))
Navigator.push(context, FadePage(page: ActiveMedicationsPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical, title: TranslationBase.of(context).myMedical,
@ -329,12 +362,17 @@ class Utils {
), ),
) )
: null, : null,
child: child: MedicalProfileItem(
MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), title: TranslationBase.of(context).myDoctor,
imagePath: 'my_doc.svg',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, onTap: () => projectViewModel.havePrivilege(14)
? Navigator.push(context, FadePage(page: MyInvoices()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).invoicesList, title: TranslationBase.of(context).invoicesList,
imagePath: 'invoice_list.svg', imagePath: 'invoice_list.svg',
@ -344,7 +382,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, onTap: () => projectViewModel.havePrivilege(14)
? Navigator.push(context, FadePage(page: EyeMeasurementsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement.svg', imagePath: 'eye_measurement.svg',
@ -354,7 +394,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard())) : null, onTap: () => projectViewModel.havePrivilege(22)
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insurance, title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card.svg', imagePath: 'insurance_card.svg',
@ -375,7 +417,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null, onTap: () => projectViewModel.havePrivilege(18)
? Navigator.push(context, FadePage(page: InsuranceApproval()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval, title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approval.svg', imagePath: 'insurance_approval.svg',
@ -385,7 +429,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null, onTap: () => projectViewModel.havePrivilege(23)
? Navigator.push(context, FadePage(page: AllergiesPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).allergies, title: TranslationBase.of(context).allergies,
imagePath: 'allergies_diagnosed.svg', imagePath: 'allergies_diagnosed.svg',
@ -395,7 +441,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null, onTap: () => projectViewModel.havePrivilege(26)
? Navigator.push(context, FadePage(page: MyVaccines()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines, title: TranslationBase.of(context).myVaccines,
imagePath: 'vaccine_list.svg', imagePath: 'vaccine_list.svg',
@ -405,7 +453,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null, onTap: () => projectViewModel.havePrivilege(20)
? Navigator.push(context, FadePage(page: HomeReportPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medical, title: TranslationBase.of(context).medical,
imagePath: 'medical_report.svg', imagePath: 'medical_report.svg',
@ -415,7 +465,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null, onTap: () => projectViewModel.havePrivilege(19)
? Navigator.push(context, FadePage(page: MonthlyReportsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).monthly, title: TranslationBase.of(context).monthly,
imagePath: 'monthly_report.svg', imagePath: 'monthly_report.svg',
@ -425,7 +477,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null, onTap: () => projectViewModel.havePrivilege(16)
? Navigator.push(context, FadePage(page: PatientSickLeavePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).sick, title: TranslationBase.of(context).sick,
imagePath: 'sick_leave.svg', imagePath: 'sick_leave.svg',
@ -435,7 +489,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null, onTap: () => projectViewModel.havePrivilege(47)
? Navigator.push(context, FadePage(page: MyBalancePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance, title: TranslationBase.of(context).myBalance,
imagePath: 'balance_credit.svg', imagePath: 'balance_credit.svg',
@ -452,7 +508,9 @@ class Utils {
// )); // ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null, onTap: () => projectViewModel.havePrivilege(24)
? Navigator.push(context, FadePage(page: MyTrackers()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers, title: TranslationBase.of(context).myTrackers,
imagePath: 'tracker.svg', imagePath: 'tracker.svg',
@ -462,7 +520,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null, onTap: () => projectViewModel.havePrivilege(30)
? Navigator.push(context, FadePage(page: SmartWatchInstructions()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatchesSubtitle, title: TranslationBase.of(context).smartWatchesSubtitle,
imagePath: 'smart_watch.svg', imagePath: 'smart_watch.svg',
@ -472,9 +532,14 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null, onTap: () => projectViewModel.havePrivilege(28)
? Navigator.push(context, FadePage(page: AskDoctorHomPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase.of(context).askYour, isEnable: projectViewModel.havePrivilege(28)), title: TranslationBase.of(context).askYourSubtitle,
imagePath: 'ask_doctor.svg',
subTitle: TranslationBase.of(context).askYour,
isEnable: projectViewModel.havePrivilege(28)),
)); ));
if (projectViewModel.havePrivilege(32) || true) { if (projectViewModel.havePrivilege(32) || true) {
@ -484,13 +549,18 @@ class Utils {
if (projectViewModel.isLogin && userData_ != null) { if (projectViewModel.isLogin && userData_ != null) {
String patientID = userData_.patientID.toString(); String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}).catchError((err) { projectViewModel
.platformBridge()
.connectHMGInternetWifi(patientID)
.then((value) => {GifLoaderDialogUtils.hideDialog(context)})
.catchError((err) {
print(err.toString()); print(err.toString());
}); });
} else { } else {
AlertDialogBox( AlertDialogBox(
context: context, context: context,
confirmMessage: "Please login with your account first to use this feature", confirmMessage:
"Please login with your account first to use this feature",
okText: "OK", okText: "OK",
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
@ -507,7 +577,9 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null, onTap: () => projectViewModel.havePrivilege(40)
? launch('whatsapp://send?phone=18885521858&text=')
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot, title: TranslationBase.of(context).chatbot,
imagePath: 'chatbot.svg', imagePath: 'chatbot.svg',
@ -519,13 +591,17 @@ class Utils {
return medical; return medical;
} }
static List<Widget> myMedicalListHomePage(
{ProjectViewModel projectViewModel,
static List<Widget> myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List(); List<Widget> medical = List();
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null, onTap: () => projectViewModel.havePrivilege(5)
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin child: isLogin
? Stack(children: [ ? Stack(children: [
MedicalProfileItem( MedicalProfileItem(
@ -548,7 +624,11 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(count.toString(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -566,7 +646,11 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(count.toString(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -593,7 +677,9 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, onTap: () => projectViewModel.havePrivilege(7)
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg', imagePath: 'radiology.svg',
@ -603,7 +689,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, onTap: () => projectViewModel.havePrivilege(12)
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context).medicines,
imagePath: 'medicine_prescription.svg', imagePath: 'medicine_prescription.svg',
@ -621,19 +709,24 @@ class Utils {
), ),
) )
: null, : null,
child: child: MedicalProfileItem(
MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), title: TranslationBase.of(context).myDoctor,
imagePath: 'my_doc.svg',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
)); ));
return medical; return medical;
} }
static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}) { static Widget loadNetworkImage(
{@required String url, BoxFit fitting = BoxFit.cover}) {
return CachedNetworkImage( return CachedNetworkImage(
placeholderFadeInDuration: Duration(milliseconds: 250), placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting, fit: fitting,
imageUrl: url, imageUrl: url,
placeholder: (context, url) => Container(child: Center(child: CircularProgressIndicator())), placeholder: (context, url) =>
Container(child: Center(child: CircularProgressIndicator())),
errorWidget: (context, url, error) { errorWidget: (context, url, error) {
return Icon( return Icon(
Icons.error, Icons.error,
@ -650,6 +743,14 @@ class Utils {
return route.runtimeType == equalsTo; return route.runtimeType == equalsTo;
} }
static navigateToCartPage() {
Navigator.pushAndRemoveUntil(
locator<NavigationService>().navigatorKey.currentContext,
MaterialPageRoute(
builder: (context) => LandingPagePharmacy(currentTab: 3)),
(Route<dynamic> r) => false);
}
static Widget tableColumnTitle(String text, {bool showDivider = true}) { static Widget tableColumnTitle(String text, {bool showDivider = true}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -658,7 +759,12 @@ class Utils {
SizedBox(height: 6), SizedBox(height: 6),
Text( Text(
text, text,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.48,
height: 18 / 12),
), ),
SizedBox(height: 5), SizedBox(height: 5),
if (showDivider) if (showDivider)
@ -671,16 +777,27 @@ class Utils {
); );
} }
static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel mProjectViewModel}) { static Widget tableColumnValue(String text,
ProjectViewModel projectViewModel = mProjectViewModel ?? Provider.of(AppGlobal.context); {bool isLast = false,
bool isCapitable = true,
ProjectViewModel mProjectViewModel}) {
ProjectViewModel projectViewModel =
mProjectViewModel ?? Provider.of(AppGlobal.context);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox(height: 12), SizedBox(height: 12),
Text( Text(
isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, isCapitable && !projectViewModel.isArabic
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ? text.toLowerCase().capitalizeFirstofEach
: text,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.4,
height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (!isLast) if (!isLast)
@ -693,7 +810,8 @@ class Utils {
); );
} }
static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) { static Widget tableColumnValueWithUnderLine(String text,
{bool isLast = false, bool isCapitable = true}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -704,7 +822,13 @@ class Utils {
isCapitable ? text.toLowerCase().capitalizeFirstofEach : text, isCapitable ? text.toLowerCase().capitalizeFirstofEach : text,
maxLines: 1, maxLines: 1,
minFontSize: 6, minFontSize: 6,
style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(
decoration: TextDecoration.underline,
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xffD02127),
letterSpacing: -0.48,
height: 18 / 12),
), ),
SizedBox(height: 10), SizedBox(height: 10),
if (!isLast) if (!isLast)
@ -718,7 +842,13 @@ class Utils {
} }
} }
Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { Widget applyShadow(
{Color color = Colors.grey,
double shadowOpacity = 0.5,
double spreadRadius = 2,
double blurRadius = 7,
Offset offset = const Offset(2, 2),
@required Widget child}) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
@ -735,7 +865,8 @@ Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, doubl
} }
Future<AuthenticatedUser> userData() async { Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER)); var userData = AuthenticatedUser.fromJson(
await AppSharedPreferences().getObject(MAIN_USER));
return userData; return userData;
} }
@ -749,9 +880,12 @@ extension IndexedIterable<E> on Iterable<E> {
openAppStore({String androidPackageName, String iOSAppID}) async { openAppStore({String androidPackageName, String iOSAppID}) async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter"); assert(!(androidPackageName == null),
if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg"); "Should have valid value in androidPackageName parameter");
if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg"); if ((await FlutterHmsGmsAvailability.isGmsAvailable))
launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isHmsAvailable))
launch("appmarket://details?id=com.ejada.hmg");
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
assert((iOSAppID == null), "Should have valid value in iOSAppID parameter"); assert((iOSAppID == null), "Should have valid value in iOSAppID parameter");
launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)"); launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)");
@ -777,7 +911,11 @@ String labelFrom({@required String className}) {
extension StringExtension on String { extension StringExtension on String {
String capitalize() { String capitalize() {
return this.splitMapJoin(RegExp(r'\w+'), onMatch: (m) => '${m.group(0)}'.substring(0, 1).toUpperCase() + '${m.group(0)}'.substring(1).toLowerCase(), onNonMatch: (n) => ' '); return this.splitMapJoin(RegExp(r'\w+'),
onMatch: (m) =>
'${m.group(0)}'.substring(0, 1).toUpperCase() +
'${m.group(0)}'.substring(1).toLowerCase(),
onNonMatch: (n) => ' ');
} }
} }

@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart'; import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart';
@ -544,8 +545,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
child: Icon(Icons.shopping_cart)), child: Icon(Icons.shopping_cart)),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
// Navigator.of(context).popUntil(ModalRoute.withName('/')); Utils.navigateToCartPage();
Navigator.of(context).popAndPushNamed(CART_ORDER_PAGE);
}) })
: Container(), : Container(),
(widget.isOfferPackages && widget.showOfferPackagesCart) (widget.isOfferPackages && widget.showOfferPackagesCart)

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-ord
import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -165,10 +166,7 @@ class productTile extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, productID, context); await addToCartFunction(1, productID, context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Utils.navigateToCartPage();
context,
FadePage(page: CartOrderPage()),
);
}, },
), ),
], ],
@ -295,6 +293,6 @@ class productTile extends StatelessWidget {
addToCartFunction(quantity, itemID, BuildContext context) async { addToCartFunction(quantity, itemID, BuildContext context) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
await x.addToCartData(quantity, itemID); await x.addToCartData(quantity, itemID, context);
} }
} }

Loading…
Cancel
Save