diff --git a/assets/images/powerd-by.jpg b/assets/images/powerd-by.jpg index 93bdbb18..eda1688c 100644 Binary files a/assets/images/powerd-by.jpg and b/assets/images/powerd-by.jpg differ diff --git a/assets/images/powerd-by2.jpg b/assets/images/powerd-by2.jpg new file mode 100644 index 00000000..93bdbb18 Binary files /dev/null and b/assets/images/powerd-by2.jpg differ diff --git a/lib/config/config.dart b/lib/config/config.dart index b197a515..a2640d90 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,7 +13,11 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; +<<<<<<< HEAD +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +======= //const BASE_URL = 'https://uat.hmgwebservices.com/'; +>>>>>>> bcb4f487854a894a41a6578a08e0e8f306120033 const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs @@ -33,8 +37,7 @@ const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; // Delivery Driver -const DRIVER_LOCATION = - 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; +const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; //weather const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; @@ -42,51 +45,36 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; // Wifi Credentials -const WIFI_CREDENTIALS = - "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; +const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; ///Doctor -const GET_MY_DOCTOR = - 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; -const GET_DOCTOR_RATING_NOTES = - 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; -const GET_DOCTOR_RATING_DETAILS = - 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; +const GET_DOCTOR_RATING_NOTES = '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'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_PRESCRIPTIONS_ALL_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = - 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; +const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; -const GET_PATIENT_ORDERS_DETAILS = - 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; +const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; -const SEND_RAD_REPORT_EMAIL = - 'Services/Notifications.svc/REST/SendRadReportEmail'; +const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; ///Feedback const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; @@ -95,32 +83,23 @@ const GET_PATIENT_AppointmentHistory = 'Services' '/Doctors.svc/REST/PateintHasAppoimentHistory'; ///VITAL SIGN -const GET_PATIENT_VITAL_SIGN = - 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; ///Er Nearest -const GET_NEAREST_HOSPITAL = - 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; +const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///ED Online -const ER_GET_VISUAL_TRIAGE_QUESTIONS = - "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; -const ER_SAVE_TRIAGE_INFORMATION = - "services/Doctors.svc/REST/ER_SaveTriageInformation"; +const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; +const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; ///Er Nearest -const GET_AMBULANCE_REQUEST = - 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; -const GET_PATIENT_ALL_PRES_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = - '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'; +const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +const GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = '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'; ///FindUs const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; @@ -129,15 +108,13 @@ const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; ///babyInformation -const GET_BABYINFORMATION_REQUEST = - 'Services/Community.svc/REST/GetBabyByUserID'; +const GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID'; ///Get Baby By User ID const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation -const GET_USERINFORMATION_REQUEST = - 'Services/Community.svc/REST/GetUserInformation_New'; +const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; ///Update email const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; @@ -159,29 +136,21 @@ const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable'; const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; ///BloodDetails -const GET_BLOOD_REQUEST = - 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; +const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; -const SAVE_BLOOD_REQUEST = - 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +const SAVE_BLOOD_REQUEST = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; -const GET_BLOOD_AGREEMENT = - 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; -const SAVE_BLOOD_AGREEMENT = - 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +const GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; +const SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; ///Reports const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; -const INSERT_REQUEST_FOR_MEDICAL_REPORT = - 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; -const SEND_MEDICAL_REPORT_EMAIL = - 'Services/Notifications.svc/REST/SendMedicalReportEmail'; +const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; +const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; ///Rate -const IS_LAST_APPOITMENT_RATED = - 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; -const GET_APPOINTMENT_DETAILS_BY_NO = - 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; +const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; +const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; @@ -193,8 +162,7 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; //URL to get active appointment list -const GET_ACTIVE_APPOINTMENTS_LIST_URL = - "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; +const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; //URL to get projects list const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; @@ -203,115 +171,85 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; //URL to dental doctors list -const GET_DENTAL_DOCTORS_LIST_URL = - "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; +const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; //URL to get doctor free slots const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; //URL to insert appointment -const INSERT_SPECIFIC_APPOINTMENT = - "Services/Doctors.svc/REST/InsertSpecificAppointment"; +const INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment"; //URL to get patient share -const GET_PATIENT_SHARE = - "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; +const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; //URL to get patient appointment history -const GET_PATIENT_APPOINTMENT_HISTORY = - "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; +const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; -const SEND_REPORT_EYE_EMAIL = - "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; +const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; -const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = - "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; +const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; //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"; //URL to confirm appointment -const CONFIRM_APPOINTMENT = - "Services/MobileNotifications.svc/REST/ConfirmAppointment"; +const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; -const INSERT_VIDA_REQUEST = - "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; +const INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; //URL to cancel appointment const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; //URL get appointment QR -const GENERATE_QR_APPOINTMENT = - "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; +const GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; //URL send email appointment QR -const EMAIL_QR_APPOINTMENT = - "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; +const EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; //URL check payment status -const CHECK_PAYMENT_STATUS = - "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; +const CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; //URL create advance payment const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; -const HIS_CREATE_ADVANCE_PAYMENT = - "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; +const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; -const ADD_ADVANCE_NUMBER_REQUEST = - 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; +const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; -const IS_ALLOW_ASK_DOCTOR = - 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; -const GET_CALL_REQUEST_TYPE = - 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; -const ADD_VIDA_REQUEST = - 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; +const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +const GET_CALL_REQUEST_TYPE = '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 GET_LIVECARE_CLINICS = - 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; +const GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; -const GET_LIVECARE_SCHEDULE_CLINICS = - 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; +const GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; -const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = - 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; +const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; -const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = - 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; +const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; -const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = - 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; +const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; const GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; -const GET_LIVECARE_CLINIC_TIMING = - 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; +const GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; -const GET_ER_APPOINTMENT_FEES = - 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; +const GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; -const ADD_NEW_CALL_FOR_PATIENT_ER = - 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; +const ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; -const GET_LIVECARE_HISTORY = - 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; -const CANCEL_LIVECARE_REQUEST = - 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; -const SEND_LIVECARE_INVOICE_EMAIL = - 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; +const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; +const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; +const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; -const UPDATE_HEALTH_TERMS = - 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; +const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; -const GET_PATIENT_HEALTH_STATS = - 'Services/Patients.svc/REST/Med_GetTransactionsSts'; +const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts'; //URL to get medicine and pharmacies list const CHANNEL = 3; @@ -332,21 +270,16 @@ var DeviceTypeID = Platform.isIOS ? 1 : 2; const LANGUAGE_ID = 2; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -const GET_PAtIENTS_INSURANCE = - "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; -const GET_PAtIENTS_INSURANCE_UPDATED = - "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; +const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; +const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; -const GET_PATIENT_INSURANCE_DETAILS = - "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; -const UPLOAD_INSURANCE_CARD = - 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; +const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; +const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; -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 GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; @@ -356,81 +289,54 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; -const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = - 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; -const GET_PATIENT_INFO_BY_ID = - 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; -const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = - 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; +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 = - 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; +const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; -const GET_COVID_DRIVETHRU_PAYMENT_INFO = - 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; +const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; -const GET_COVID_DRIVETHRU_FREE_SLOTS = - 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; +const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; ///Smartwatch Integration Services -const GET_PATIENT_LAST_RECORD = - 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; +const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; ///My Trackers -const GET_DIABETIC_RESULT_AVERAGE = - 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; -const GET_DIABTEC_RESULT = - 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; -const ADD_DIABTEC_RESULT = - 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; - -const GET_BLOOD_PRESSURE_RESULT_AVERAGE = - 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; -const GET_BLOOD_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; -const ADD_BLOOD_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; - -const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = - 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; -const GET_WEIGHT_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; -const ADD_WEIGHT_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; +const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; +const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; +const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; + +const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; +const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; + +const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; +const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; -const GET_CALL_INFO_HOURS_RESULT = - 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; -const GET_CALL_REQUEST_TYPE_LOV = - 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; - -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_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; +const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; + +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 UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; @@ -438,35 +344,25 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; // H2O -const H2O_GET_USER_PROGRESS = - "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; -const H2O_INSERT_USER_ACTIVITY = - "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; -const H2O_GET_USER_DETAIL = - "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"; +const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; +const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; +const H2O_GET_USER_DETAIL = "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 -const GET_ALL_RELATIONSHIP_TYPES = - "Services/Patients.svc/REST/GetAllRelationshipTypes"; -const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = - 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; -const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = - 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; +const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; +const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = '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 CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; // Encillary Orders -const GET_ANCILLARY_ORDERS = - 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; +const GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; -const GET_ANCILLARY_ORDERS_DETAILS = - 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; +const GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; //Pharmacy wishlist // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; @@ -496,50 +392,34 @@ const GET_SHIPPING_OPTIONS = "get_shipping_option/"; const DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; const ORDER_SHOPPING_CART = "orders"; -const GET_LACUM_ACCOUNT_INFORMATION = - "Services/Patients.svc/REST/GetLakumAccountInformation"; -const GET_LACUM_GROUP_INFORMATION = - "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; -const LACUM_ACCOUNT_ACTIVATE = - "Services/Patients.svc/REST/LakumAccountActivation"; -const LACUM_ACCOUNT_DEACTIVATE = - "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 GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; +const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; +const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation"; +const LACUM_ACCOUNT_DEACTIVATE = "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 GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; const GET_MOST_VIEWED_PRODUCTS = "mostview?"; const GET_NEW_PRODUCTS = "newproducts?"; // Home Health Care -const HHC_GET_ALL_SERVICES = - "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; -const HHC_GET_ALL_CMC_SERVICES = - "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; -const PATIENT_ER_UPDATE_PRES_ORDER = - "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 HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; +const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; +const PATIENT_ER_UPDATE_PRES_ORDER = "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 PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; -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 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 BLOOD_DONATION_REGISTER_BLOOD_TYPE = - 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; -const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = - 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; //Pharmacy wishlist const GET_WISHLIST = "shopping_cart_items/"; @@ -572,8 +452,7 @@ const GET_SUB_PRODUCTS = 'products?categoryid='; 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='; const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; -const GET_DISEASE_BY_CLINIC_ID = - 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; +const GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; const TIMER_MIN = 10; @@ -589,6 +468,10 @@ const SCAN_QR_CODE = 'productbysku/'; const FILTERED_PRODUCTS = 'products?categoryids='; +const GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; + +const GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime"; + class AppGlobal { static var context; diff --git a/lib/core/model/health_calcolator/get_doctor_by_time_model.dart b/lib/core/model/health_calcolator/get_doctor_by_time_model.dart new file mode 100644 index 00000000..02c4a6ca --- /dev/null +++ b/lib/core/model/health_calcolator/get_doctor_by_time_model.dart @@ -0,0 +1,198 @@ +class DoctorListByTimeModel { + dynamic clinicID; + String clinicName; + String doctorTitle; + dynamic iD; + String name; + dynamic projectID; + String projectName; + dynamic actualDoctorRate; + dynamic clinicRoomNo; + dynamic date; + dynamic dayName; + double decimalDoctorRate; + dynamic doctorAvailability; + dynamic doctorID; + String doctorImageURL; + dynamic doctorProfile; + dynamic doctorProfileInfo; + dynamic doctorRate; + dynamic doctorStarsRate; + dynamic gender; + String genderDescription; + bool isAllowWaitList; + bool isAppointmentAllowed; + bool isDoctorAllowVedioCall; + bool isDoctorDummy; + bool isDoctorHasPrePostImages; + bool isLiveCare; + String latitude; + String longitude; + String nationalityFlagURL; + String nationalityID; + String nationalityName; + dynamic nearestFreeSlot; + dynamic noOfPatientsRate; + dynamic originalClinicID; + dynamic personRate; + dynamic projectDistanceInKiloMeters; + String qR; + dynamic qRString; + dynamic rateNumber; + dynamic serviceID; + String setupID; + List speciality; + dynamic workingHours; + + DoctorListByTimeModel( + {this.clinicID, + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.decimalDoctorRate, + this.doctorAvailability, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.doctorStarsRate, + this.gender, + this.genderDescription, + this.isAllowWaitList, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isDoctorHasPrePostImages, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); + + DoctorListByTimeModel.fromJson(Map json) { + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + doctorTitle = json['DoctorTitle']; + iD = json['ID']; + name = json['Name']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + actualDoctorRate = json['ActualDoctorRate']; + clinicRoomNo = json['ClinicRoomNo']; + date = json['Date']; + dayName = json['DayName']; + decimalDoctorRate = json['DecimalDoctorRate']; + doctorAvailability = json['DoctorAvailability']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorProfile = json['DoctorProfile']; + doctorProfileInfo = json['DoctorProfileInfo']; + doctorRate = json['DoctorRate']; + doctorStarsRate = json['DoctorStarsRate']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isAllowWaitList = json['IsAllowWaitList']; + isAppointmentAllowed = json['IsAppointmentAllowed']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isDoctorDummy = json['IsDoctorDummy']; + isDoctorHasPrePostImages = json['IsDoctorHasPrePostImages']; + isLiveCare = json['IsLiveCare']; + latitude = json['Latitude']; + longitude = json['Longitude']; + nationalityFlagURL = json['NationalityFlagURL']; + nationalityID = json['NationalityID']; + nationalityName = json['NationalityName']; + nearestFreeSlot = json['NearestFreeSlot']; + noOfPatientsRate = json['NoOfPatientsRate']; + originalClinicID = json['OriginalClinicID']; + personRate = json['PersonRate']; + projectDistanceInKiloMeters = json['ProjectDistanceInKiloMeters']; + qR = json['QR']; + qRString = json['QRString']; + rateNumber = json['RateNumber']; + serviceID = json['ServiceID']; + setupID = json['SetupID']; + speciality = json['Speciality'].cast(); + workingHours = json['WorkingHours']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicID'] = this.clinicID; + data['ClinicName'] = this.clinicName; + data['DoctorTitle'] = this.doctorTitle; + data['ID'] = this.iD; + data['Name'] = this.name; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicRoomNo'] = this.clinicRoomNo; + data['Date'] = this.date; + data['DayName'] = this.dayName; + data['DecimalDoctorRate'] = this.decimalDoctorRate; + data['DoctorAvailability'] = this.doctorAvailability; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorProfile'] = this.doctorProfile; + data['DoctorProfileInfo'] = this.doctorProfileInfo; + data['DoctorRate'] = this.doctorRate; + data['DoctorStarsRate'] = this.doctorStarsRate; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsAllowWaitList'] = this.isAllowWaitList; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsDoctorDummy'] = this.isDoctorDummy; + data['IsDoctorHasPrePostImages'] = this.isDoctorHasPrePostImages; + data['IsLiveCare'] = this.isLiveCare; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NationalityID'] = this.nationalityID; + data['NationalityName'] = this.nationalityName; + data['NearestFreeSlot'] = this.nearestFreeSlot; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OriginalClinicID'] = this.originalClinicID; + data['PersonRate'] = this.personRate; + data['ProjectDistanceInKiloMeters'] = this.projectDistanceInKiloMeters; + data['QR'] = this.qR; + data['QRString'] = this.qRString; + data['RateNumber'] = this.rateNumber; + data['ServiceID'] = this.serviceID; + data['SetupID'] = this.setupID; + data['Speciality'] = this.speciality; + data['WorkingHours'] = this.workingHours; + return data; + } +} + +class DoctorsListTime { + List doctorsByTimeList = List(); + String filterName = ""; + + DoctorsListTime({filterName, DoctorListByTimeModel doctor}) { + doctorsByTimeList.add(doctor); + this.filterName = filterName; + } +} diff --git a/lib/core/model/health_calcolator/get_doctor_by_time_request_model.dart b/lib/core/model/health_calcolator/get_doctor_by_time_request_model.dart new file mode 100644 index 00000000..cf9b2004 --- /dev/null +++ b/lib/core/model/health_calcolator/get_doctor_by_time_request_model.dart @@ -0,0 +1,80 @@ +class DoctorListByTimeRequestModel { + int clinicID; + bool isGetNearAppointment; + bool continueDentalPlan; + bool isSearchAppointmnetByClinicID; + int patientID; + int latitude; + int longitude; + bool license; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + dynamic sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + DoctorListByTimeRequestModel( + {this.clinicID, + this.isGetNearAppointment, + this.continueDentalPlan, + this.isSearchAppointmnetByClinicID, + this.patientID, + this.latitude, + this.longitude, + this.license, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + DoctorListByTimeRequestModel.fromJson(Map json) { + clinicID = json['ClinicID']; + isGetNearAppointment = json['IsGetNearAppointment']; + continueDentalPlan = json['ContinueDentalPlan']; + isSearchAppointmnetByClinicID = json['IsSearchAppointmnetByClinicID']; + patientID = json['PatientID']; + latitude = json['Latitude']; + longitude = json['Longitude']; + license = json['License']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicID'] = this.clinicID; + data['IsGetNearAppointment'] = this.isGetNearAppointment; + data['ContinueDentalPlan'] = this.continueDentalPlan; + data['IsSearchAppointmnetByClinicID'] = this.isSearchAppointmnetByClinicID; + data['PatientID'] = this.patientID; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['License'] = this.license; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/health_calcolator/get_doctor_list_calcolation_model.dart b/lib/core/model/health_calcolator/get_doctor_list_calcolation_model.dart new file mode 100644 index 00000000..409cab60 --- /dev/null +++ b/lib/core/model/health_calcolator/get_doctor_list_calcolation_model.dart @@ -0,0 +1,64 @@ +class GetDoctorListModel { + int calcID; + int projectID; + int clinicID; + String clinicName; + int doctorID; + String doctorImageURL; + String doctorName; + String doctorTitle; + int gender; + String genderDescription; + String nationality; + String nationalityFlagURL; + String projectName; + + GetDoctorListModel( + {this.calcID, + this.projectID, + this.clinicID, + this.clinicName, + this.doctorID, + this.doctorImageURL, + this.doctorName, + this.doctorTitle, + this.gender, + this.genderDescription, + this.nationality, + this.nationalityFlagURL, + this.projectName}); + + GetDoctorListModel.fromJson(Map json) { + calcID = json['CalcID']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + nationality = json['Nationality']; + nationalityFlagURL = json['NationalityFlagURL']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['CalcID'] = this.calcID; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['ClinicName'] = this.clinicName; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['Nationality'] = this.nationality; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['ProjectName'] = this.projectName; + return data; + } +} diff --git a/lib/core/model/health_calcolator/get_doctor_list_calcolation_request_model.dart b/lib/core/model/health_calcolator/get_doctor_list_calcolation_request_model.dart new file mode 100644 index 00000000..80002341 --- /dev/null +++ b/lib/core/model/health_calcolator/get_doctor_list_calcolation_request_model.dart @@ -0,0 +1,52 @@ +class GetDoctorListRequestModel { + int calculationID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + GetDoctorListRequestModel( + {this.calculationID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + GetDoctorListRequestModel.fromJson(Map json) { + calculationID = json['CalculationID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['CalculationID'] = this.calculationID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart b/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart index b59eadac..37fdae75 100644 --- a/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart +++ b/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart @@ -2,24 +2,28 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart'; +import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_by_time_model.dart'; +import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_by_time_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_model.dart'; +import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_request_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; class BariatricsService extends BaseService { List clinicCategoryList = []; List diseasesList = []; + List doctorList = []; + List doctorListByTime = []; Future getClinicCategory() async { hasError = false; Map body = Map(); - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); body['ClinicID'] = 108; // hint: it is static depend on IONIC project body['isDentalAllowedBackend'] = false; body['LanguageID'] = languageID == 'ar' ? 1 : 2; - await baseAppClient.post(GET_CLINIC_CATEGORY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CLINIC_CATEGORY, onSuccess: (dynamic response, int statusCode) { clinicCategoryList.clear(); if (response['ClinicCategoryList'] != null) response['ClinicCategoryList'].forEach((city) { @@ -36,8 +40,7 @@ class BariatricsService extends BaseService { Map body = Map(); body['ClinicID'] = 108; // hint: it is static depend on IONIC project - await baseAppClient.post(GET_DISEASE_BY_CLINIC_ID, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_DISEASE_BY_CLINIC_ID, onSuccess: (dynamic response, int statusCode) { diseasesList.clear(); if (response['DiseasesByClinicList'] != null) response['DiseasesByClinicList'].forEach((city) { @@ -51,8 +54,7 @@ class BariatricsService extends BaseService { Future searchDoctorsByTime(DiseasesByClinic disease) async { hasError = false; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Map body = Map(); body['ClinicID'] = 108; // hint: it is static depend on IONIC project @@ -66,11 +68,36 @@ class BariatricsService extends BaseService { body['Longitude'] = 0; body['isDentalAllowedBackend'] = false; - await baseAppClient.post(SEARCH_DOCTOR_BY_TIME, - onSuccess: (dynamic response, int statusCode) { - }, onFailure: (String error, int statusCode) { + await baseAppClient.post(SEARCH_DOCTOR_BY_TIME, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); } + + Future getDoctorList() async { + hasError = false; + DoctorListByTimeRequestModel _doctorListReq = DoctorListByTimeRequestModel(); + _doctorListReq.isGetNearAppointment = false; + _doctorListReq.continueDentalPlan = false; + _doctorListReq.isSearchAppointmnetByClinicID = true; + _doctorListReq.latitude = 0; + _doctorListReq.longitude = 0; + _doctorListReq.license = true; + _doctorListReq.clinicID = 108; + _doctorListReq.patientID = 0; + + //body['ClinicID'] = 108; // hint: it is static depend on IONIC project + + await baseAppClient.post(GET_DOCTOR_LIST_BY_TIME, onSuccess: (dynamic response, int statusCode) { + doctorListByTime.clear(); + if (response['DoctorList'] != null) + response['DoctorList'].forEach((city) { + doctorListByTime.add(DoctorListByTimeModel.fromJson(city)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _doctorListReq.toJson()); + } } diff --git a/lib/core/service/medical/WeightPressureService.dart b/lib/core/service/medical/WeightPressureService.dart index b48c4795..6d150c28 100644 --- a/lib/core/service/medical/WeightPressureService.dart +++ b/lib/core/service/medical/WeightPressureService.dart @@ -7,12 +7,9 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; class WeightService extends BaseService { ///Average - List - monthWeightMeasurementResultAverage = List(); - List weekWeightMeasurementResultAverage = - List(); - List yearWeightMeasurementResultAverage = - List(); + List monthWeightMeasurementResultAverage = List(); + List weekWeightMeasurementResultAverage = List(); + List yearWeightMeasurementResultAverage = List(); ///Result List monthWeightMeasurementResult = List(); @@ -23,24 +20,20 @@ class WeightService extends BaseService { hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) { monthWeightMeasurementResultAverage.clear(); weekWeightMeasurementResultAverage.clear(); yearWeightMeasurementResultAverage.clear(); response['List_MonthWeightMeasurementResultAverage'].forEach((item) { - monthWeightMeasurementResultAverage - .add(MonthWeightMeasurementResultAverage.fromJson(item)); + monthWeightMeasurementResultAverage.add(MonthWeightMeasurementResultAverage.fromJson(item)); }); response['List_WeekWeightMeasurementResultAverage'].forEach((item) { - weekWeightMeasurementResultAverage - .add(WeekWeightMeasurementResultAverage.fromJson(item)); + weekWeightMeasurementResultAverage.add(WeekWeightMeasurementResultAverage.fromJson(item)); }); response['List_YearWeightMeasurementResultAverage'].forEach((item) { - yearWeightMeasurementResultAverage - .add(YearWeightMeasurementResultAverage.fromJson(item)); + yearWeightMeasurementResultAverage.add(YearWeightMeasurementResultAverage.fromJson(item)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -50,8 +43,7 @@ class WeightService extends BaseService { Future getWeightMeasurementResult() async { hasError = false; - await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, onSuccess: (dynamic response, int statusCode) { monthWeightMeasurementResult.clear(); weekWeightMeasurementResult.clear(); yearWeightMeasurementResult.clear(); @@ -61,8 +53,7 @@ class WeightService extends BaseService { }); response['List_MonthWeightMeasurementResult'].forEach((item) { - monthWeightMeasurementResult - .add(WeightMeasurementResult.fromJson(item)); + monthWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); }); response['List_YearWeightMeasurementResult'].forEach((item) { @@ -74,8 +65,7 @@ class WeightService extends BaseService { }, body: Map()); } - addWeightResult( - {String weightDate, String weightMeasured, int weightUnit}) async { + addWeightResult({String weightDate, String weightMeasured, int weightUnit}) async { hasError = false; super.error = ""; @@ -85,15 +75,14 @@ class WeightService extends BaseService { body['weightUnit'] = weightUnit; body['isDentalAllowedBackend'] = false; - await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT, - onSuccess: (response, statusCode) async {}, + await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); } - updateWeightResult({int lineItemNo, int weightUnit,String weightMeasured,String weightDate}) async { + updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured, String weightDate}) async { hasError = false; super.error = ""; Map body = Map(); @@ -103,36 +92,36 @@ class WeightService extends BaseService { body['WeightDate'] = weightDate; body['isDentalAllowedBackend'] = false; - await baseAppClient.post(UPDATE_WEIGHT_PRESSURE_RESULT, - onSuccess: (response, statusCode) async {}, + await baseAppClient.post(UPDATE_WEIGHT_PRESSURE_RESULT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); } + Future sendReportByEmail() async { hasError = false; super.error = ""; Map body = Map(); body['isDentalAllowedBackend'] = false; body['to'] = user.emailAddress; - await baseAppClient.post(SEND_AVERAGE_BLOOD_WEIGHT_REPORT, - onSuccess: (response, statusCode) async {}, + await baseAppClient.post(SEND_AVERAGE_BLOOD_WEIGHT_REPORT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + hasError = true; + super.error = error; + }, body: body); } - deleteWeightResult({int lineItemNo, }) async { + deleteWeightResult({ + int lineItemNo, + }) async { hasError = false; super.error = ""; Map body = Map(); body['LineItemNo'] = lineItemNo; body['isDentalAllowedBackend'] = false; - await baseAppClient.post(DEACTIVATE_WEIGHT_PRESSURE_RESULT, - onSuccess: (response, statusCode) async {}, + await baseAppClient.post(DEACTIVATE_WEIGHT_PRESSURE_RESULT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart b/lib/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart index 5853cc8f..609e5424 100644 --- a/lib/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart +++ b/lib/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart @@ -2,6 +2,8 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart'; +import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_by_time_model.dart'; +import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; @@ -13,6 +15,9 @@ class BariatricsViewModel extends BaseViewModel { List get clinicCategoryList => _service.clinicCategoryList; List get diseasesList => _service.diseasesList; + List get doctorList => _service.doctorList; + List get doctorListByTime => _service.doctorListByTime; + List doctorLists = List(); void getClinicCategory() async { setState(ViewState.Busy); @@ -46,4 +51,27 @@ class BariatricsViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + void getDoctorList() async { + setState(ViewState.Busy); + await _service.getDoctorList(); + if (_service.hasError) { + error = _service.error; + setState(ViewState.Error); + } else { + { + _service.doctorListByTime.forEach((element) { + List patientLabOrdersClinic = + doctorLists.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); + + if (patientLabOrdersClinic.length != 0) { + doctorLists[doctorLists.indexOf(patientLabOrdersClinic[0])].doctorsByTimeList.add(element); + } else { + doctorLists.add(DoctorsListTime(filterName: element.projectName, doctor: element)); + } + }); + setState(ViewState.Idle); + } + } + } } diff --git a/lib/core/viewModels/medical/blood_pressure_view_model.dart b/lib/core/viewModels/medical/blood_pressure_view_model.dart index ae3abbcb..16a43a6f 100644 --- a/lib/core/viewModels/medical/blood_pressure_view_model.dart +++ b/lib/core/viewModels/medical/blood_pressure_view_model.dart @@ -9,14 +9,11 @@ import '../../../core/viewModels/base_view_model.dart'; class BloodPressureViewMode extends BaseViewModel { BloodPressureService bloodPressureService = locator(); - List get monthDiabtecPatientResult => - bloodPressureService.monthDiabtecPatientResult; + List get monthDiabtecPatientResult => bloodPressureService.monthDiabtecPatientResult; - List get weekDiabtecPatientResult => - bloodPressureService.weekDiabtecPatientResult; + List get weekDiabtecPatientResult => bloodPressureService.weekDiabtecPatientResult; - List get yearDiabtecPatientResult => - bloodPressureService.yearDiabtecPatientResult; + List get yearDiabtecPatientResult => bloodPressureService.yearDiabtecPatientResult; List weightWeekTimeSeriesDataTop = []; List weightWeekTimeSeriesDataLow = []; @@ -37,35 +34,36 @@ class BloodPressureViewMode extends BaseViewModel { } else { clearDate(); bloodPressureService.weekDiabtectResultAverageList.forEach((element) { - weightWeekTimeSeriesDataTop.add(TimeSeriesSales2( - element.bloodPressureDate, - element.dailyDiastolicPressureAverageResult.toDouble())); - weightWeekTimeSeriesDataLow.add(TimeSeriesSales2( - element.bloodPressureDate, - element.dailySystolicePressureAverageResult.toDouble())); + weightWeekTimeSeriesDataTop + .add(TimeSeriesSales2(element.bloodPressureDate, element.dailyDiastolicPressureAverageResult.toDouble())); + weightWeekTimeSeriesDataLow + .add(TimeSeriesSales2(element.bloodPressureDate, element.dailySystolicePressureAverageResult.toDouble())); for (int index = 0; index < bloodPressureService.monthDiabtectResultAverageList.length; index++) { - - weighMonthTimeSeriesDataTop.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult.toDouble())); - - weighMonthTimeSeriesDataLow.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult.toDouble())); + weighMonthTimeSeriesDataTop.add(TimeSeriesSales3( + index, + bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult + .toDouble())); + + weighMonthTimeSeriesDataLow.add(TimeSeriesSales3( + index, + bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult + .toDouble())); } bloodPressureService.yearDiabtecResultAverageList.forEach((element) { - weightYearTimeSeriesDataTop.add(TimeSeriesSales2(element.date, - element.monthSystolicePressureAverageResult.toDouble())); + weightYearTimeSeriesDataTop + .add(TimeSeriesSales2(element.date, element.monthSystolicePressureAverageResult.toDouble())); - weightYearTimeSeriesDataLow.add(TimeSeriesSales2(element.date, - element.monthDiastolicPressureAverageResult.toDouble())); + weightYearTimeSeriesDataLow + .add(TimeSeriesSales2(element.date, element.monthDiastolicPressureAverageResult.toDouble())); }); - }); setState(ViewState.Idle); } } - - void clearDate(){ + void clearDate() { weightWeekTimeSeriesDataTop.clear(); weightWeekTimeSeriesDataLow.clear(); weighMonthTimeSeriesDataTop.clear(); @@ -86,24 +84,25 @@ class BloodPressureViewMode extends BaseViewModel { } } - Future addORUpdateDiabtecResult( + Future addORUpdateDiabtecResult( {String bloodPressureDate, String diastolicPressure, String systolicePressure, - int measuredArm,bool isUpdate = false}) async { + int measuredArm, + bool isUpdate = false}) async { setState(ViewState.BusyLocal); - if(!isUpdate) - await bloodPressureService.addDiabtecResult( - bloodPressureDate: bloodPressureDate, - diastolicPressure: diastolicPressure, - systolicePressure: systolicePressure, - measuredArm: measuredArm); + if (!isUpdate) + await bloodPressureService.addDiabtecResult( + bloodPressureDate: bloodPressureDate, + diastolicPressure: diastolicPressure, + systolicePressure: systolicePressure, + measuredArm: measuredArm); else await bloodPressureService.updateDiabtecResult( - bloodPressureDate: bloodPressureDate, - diastolicPressure: diastolicPressure, - systolicePressure: systolicePressure, - measuredArm: measuredArm); + bloodPressureDate: bloodPressureDate, + diastolicPressure: diastolicPressure, + systolicePressure: systolicePressure, + measuredArm: measuredArm); if (bloodPressureService.hasError) { error = bloodPressureService.error; setState(ViewState.ErrorLocal); @@ -113,7 +112,6 @@ class BloodPressureViewMode extends BaseViewModel { } } - Future deactivateDiabeticStatus({int lineItemNo}) async { setState(ViewState.BusyLocal); diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 9e3f09e5..4473c117 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -16,14 +16,11 @@ class LabsViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; - List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); List get patientLabOrdersList => - filterType == FilterType.Clinic - ? _patientLabOrdersListClinic - : _patientLabOrdersListHospital; + filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; void getLabs() async { if (authenticatedUserObject.isLogin) { @@ -34,41 +31,33 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { - List patientLabOrdersClinic = - _patientLabOrdersListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List patientLabOrdersClinic = _patientLabOrdersListClinic + .where((elementClinic) => elementClinic.filterName == element.clinicDescription) + .toList(); if (patientLabOrdersClinic.length != 0) { - _patientLabOrdersListClinic[_patientLabOrdersListClinic - .indexOf(patientLabOrdersClinic[0])] + _patientLabOrdersListClinic[_patientLabOrdersListClinic.indexOf(patientLabOrdersClinic[0])] .patientLabOrdersList .add(element); } else { - _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription, - patientDoctorAppointment: element)); + _patientLabOrdersListClinic + .add(PatientLabOrdersList(filterName: element.clinicDescription, patientDoctorAppointment: element)); } // doctor list sort via project - List patientLabOrdersHospital = - _patientLabOrdersListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List patientLabOrdersHospital = _patientLabOrdersListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (patientLabOrdersHospital.length != 0) { - _patientLabOrdersListHospital[_patientLabOrdersListHospital - .indexOf(patientLabOrdersHospital[0])] + _patientLabOrdersListHospital[_patientLabOrdersListHospital.indexOf(patientLabOrdersHospital[0])] .patientLabOrdersList .add(element); } else { - _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName, - patientDoctorAppointment: element)); + _patientLabOrdersListHospital + .add(PatientLabOrdersList(filterName: element.projectName, patientDoctorAppointment: element)); } }); @@ -82,24 +71,16 @@ class LabsViewModel extends BaseViewModel { notifyListeners(); } - List get patientLabSpecialResult => - _labsService.patientLabSpecialResult; + List get patientLabSpecialResult => _labsService.patientLabSpecialResult; List get labResultList => _labsService.labResultList; List labResultLists = List(); - getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( - invoiceNo: invoiceNo, - orderNo: orderNo, - projectID: projectID, - clinicID: clinicID); + invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -116,14 +97,16 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); + List patientLabOrdersClinic = + labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); if (patientLabOrdersClinic.length != 0) { - - var value= labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList - .where((e) => e.sampleCollectedOn== element.sampleCollectedOn && e.resultValue ==element.resultValue ).toList(); - if(value.isEmpty) - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); + var value = labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .where((e) => e.sampleCollectedOn == element.sampleCollectedOn && e.resultValue == element.resultValue) + .toList(); + if (value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); } else { labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); } @@ -132,32 +115,30 @@ class LabsViewModel extends BaseViewModel { } } - - getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder,procedure: procedure); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); } else { bool isShouldClear = false; - if(_labsService.labOrdersResultsList.length==1) - { - labOrdersResultsList.forEach((element) { - if(element.resultValue.contains('/') ||element.resultValue.contains('*' )|| element.resultValue.isEmpty ) - isShouldClear = true; - });} - if(isShouldClear) - _labsService.labOrdersResultsList.clear(); + if (_labsService.labOrdersResultsList.length == 1) { + labOrdersResultsList.forEach((element) { + if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) + isShouldClear = true; + }); + } + if (isShouldClear) _labsService.labOrdersResultsList.clear(); setState(ViewState.Idle); } } - sendLabReportEmail({PatientLabOrders patientLabOrder,String mes}) async { + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { error = _labsService.error; - }else + } else AppToast.showSuccessToast(message: mes); } } diff --git a/lib/core/viewModels/medical/weight_pressure_view_model.dart b/lib/core/viewModels/medical/weight_pressure_view_model.dart index 42db0a58..4a01bd3b 100644 --- a/lib/core/viewModels/medical/weight_pressure_view_model.dart +++ b/lib/core/viewModels/medical/weight_pressure_view_model.dart @@ -16,14 +16,11 @@ import '../../../core/viewModels/base_view_model.dart'; class WeightPressureViewModel extends BaseViewModel { WeightService weightService = locator(); - List get monthWeightMeasurementResult => - weightService.monthWeightMeasurementResult; + List get monthWeightMeasurementResult => weightService.monthWeightMeasurementResult; - List get weekWeightMeasurementResult => - weightService.weekWeightMeasurementResult; + List get weekWeightMeasurementResult => weightService.weekWeightMeasurementResult; - List get yearWeightMeasurementResult => - weightService.yearWeightMeasurementResult; + List get yearWeightMeasurementResult => weightService.yearWeightMeasurementResult; List weightWeekTimeSeriesData = []; List weighMonthTimeSeriesData = []; @@ -35,7 +32,7 @@ class WeightPressureViewModel extends BaseViewModel { await weightService.getWeightMeasurementResult(); if (weightService.hasError) { error = weightService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { weightService.weekWeightMeasurementResultAverage.forEach((element) { weightWeekTimeSeriesData.add(TimeSeriesSales2( @@ -44,14 +41,10 @@ class WeightPressureViewModel extends BaseViewModel { )); }); - for (int index = 0; - index < weightService.monthWeightMeasurementResultAverage.length; - index++) { + for (int index = 0; index < weightService.monthWeightMeasurementResultAverage.length; index++) { weighMonthTimeSeriesData.add(TimeSeriesSales3( index, - weightService - .monthWeightMeasurementResultAverage[index].weekAverageResult - .toDouble(), + weightService.monthWeightMeasurementResultAverage[index].weekAverageResult.toDouble(), )); } @@ -66,8 +59,7 @@ class WeightPressureViewModel extends BaseViewModel { } } - addWeightResult( - {String weightDate, String weightMeasured, int weightUnit}) async { + addWeightResult({String weightDate, String weightMeasured, int weightUnit}) async { setState(ViewState.BusyLocal); await weightService.addWeightResult( weightDate: weightDate, @@ -82,6 +74,7 @@ class WeightPressureViewModel extends BaseViewModel { setState(ViewState.Idle); } } + Future sendReportByEmail() async { setState(ViewState.BusyLocal); @@ -94,14 +87,10 @@ class WeightPressureViewModel extends BaseViewModel { } } - updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured,String weightDate}) async { + updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured, String weightDate}) async { setState(ViewState.BusyLocal); await weightService.updateWeightResult( - lineItemNo: lineItemNo, - weightMeasured: weightMeasured, - weightUnit: weightUnit, - weightDate: weightDate - ); + lineItemNo: lineItemNo, weightMeasured: weightMeasured, weightUnit: weightUnit, weightDate: weightDate); if (weightService.hasError) { error = weightService.error; setState(ViewState.Error); @@ -111,7 +100,9 @@ class WeightPressureViewModel extends BaseViewModel { } } - deleteWeightResult({int lineItemNo, }) async { + deleteWeightResult({ + int lineItemNo, + }) async { setState(ViewState.BusyLocal); await weightService.deleteWeightResult( lineItemNo: lineItemNo, diff --git a/lib/core/viewModels/vaccine_view_model.dart b/lib/core/viewModels/vaccine_view_model.dart index 9f8dfecf..37b57da4 100644 --- a/lib/core/viewModels/vaccine_view_model.dart +++ b/lib/core/viewModels/vaccine_view_model.dart @@ -22,7 +22,7 @@ class VaccineViewModel extends BaseViewModel { await _vaccineService.getMyVaccine(); if (_vaccineService.hasError) { error = _vaccineService.error; - setState(ViewState.ErrorLocal); + setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index b6cddf18..5a3271f2 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -292,7 +292,9 @@ class MobileNumberTextFiled extends StatelessWidget { padding: EdgeInsets.all(5), decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.white), - child: Row(children: [ + child: Row( + textDirection: TextDirection.ltr, + children: [ Expanded( flex: 1, child: Icon( diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart index d9665aa4..a3d67613 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart @@ -3,12 +3,14 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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:provider/provider.dart'; @@ -33,122 +35,117 @@ class _BariatricsPageState extends State { return BaseView( onModelReady: (model) => model.getClinicCategory(), - builder: (_, model, w) => - AppScaffold( - isShowAppBar: true, - appBarTitle: "${TranslationBase - .of(context) - .bariatrics}", - baseViewModel: model, - body: Column( - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Center( - child: Texts(TranslationBase - .of(context) - .bariatricsHeaderMsg), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.symmetric( - horizontal: 16.0, vertical: 8.0), - child: Row( - children: [ - Expanded( - child: SingleChildScrollView( - child: Column( - children: [ - ...model.diseasesList - .map((item) => - RadioListTile( + builder: (_, model, w) => AppScaffold( + isShowDecPage: false, + isShowAppBar: true, + appBarTitle: "${TranslationBase.of(context).bariatrics}", + baseViewModel: model, + body: Column( + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Center( + child: Texts(TranslationBase.of(context).bariatricsHeaderMsg), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + child: Row( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + ...model.diseasesList + .map((item) => RadioListTile( title: Texts("${item.diseases}"), activeColor: Colors.blue.shade700, value: item.diseasesID, - groupValue: _selectedDisease != null - ? _selectedDisease.diseasesID - : -1, - selected: _selectedDisease != null ? item - .diseasesID == - _selectedDisease.diseasesID : false, + groupValue: _selectedDisease != null ? _selectedDisease.diseasesID : -1, + selected: _selectedDisease != null + ? item.diseasesID == _selectedDisease.diseasesID + : false, onChanged: (val) { setState(() { _selectedDisease = item; }); }, )) - .toList() - ], - ), - ), - ), - Image.asset( - _getImageName(widget.gender, widget.obeseResult, - projectProvider.isArabic), - fit: BoxFit.cover, + .toList() + ], ), - ], + ), ), - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: BorderedButton( - TranslationBase - .of(context) - .continues, - fontSize: SizeConfig.textMultiplier * 2.1, - textColor: Colors.white, - vPadding: 8, - hPadding: 8, - backgroundColor: Theme - .of(context) - .primaryColor, - radius: 8, - fontWeight: FontWeight.bold, - handler: () async { - await model.searchDoctorsByTime(_selectedDisease); - if(model.state == ViewState.ErrorLocal){ - AppToast.showErrorToast(message: model.error); - } - // Navigator.push( - // context, - // MaterialPageRoute(builder: (context) => BariatricsPage()), - // ); - }, - ), - ), - Container( - margin: EdgeInsets.only(bottom: 16.0, left: 16, right: 16), - child: BorderedButton( - TranslationBase - .of(context) - .skip, - fontSize: SizeConfig.textMultiplier * 2.1, - textColor: Colors.blue, - vPadding: 8, - hPadding: 8, - backgroundColor: Color(0x00000000), - radius: 8, - hasBorder: true, - borderColor: Color(0x00000000), - fontWeight: FontWeight.bold, - handler: () async { - await model.searchDoctorsByTime(_selectedDisease); - if(model.state == ViewState.ErrorLocal){ - AppToast.showErrorToast(message: model.error); - } - // Navigator.push( - // context, - // MaterialPageRoute(builder: (context) => BariatricsPage()), - // ); - }, - ), + Image.asset( + _getImageName(widget.gender, widget.obeseResult, projectProvider.isArabic), + fit: BoxFit.cover, + ), + ], ), - ], + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: BorderedButton( + TranslationBase.of(context).continues, + fontSize: SizeConfig.textMultiplier * 2.1, + textColor: Colors.white, + vPadding: 8, + hPadding: 8, + backgroundColor: Theme.of(context).primaryColor, + radius: 8, + fontWeight: FontWeight.bold, + handler: () async { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + // await model.searchDoctorsByTime(_selectedDisease); + // if (model.state == ViewState.ErrorLocal) { + // AppToast.showErrorToast(message: model.error); + // } else {} + + // Navigator.push( + // context, + // MaterialPageRoute(builder: (context) => BariatricsPage()), + // ); + }, + ), + ), + Container( + margin: EdgeInsets.only(bottom: 16.0, left: 16, right: 16), + child: BorderedButton( + TranslationBase.of(context).skip, + fontSize: SizeConfig.textMultiplier * 2.1, + textColor: Colors.blue, + vPadding: 8, + hPadding: 8, + backgroundColor: Color(0x00000000), + radius: 8, + hasBorder: true, + borderColor: Color(0x00000000), + fontWeight: FontWeight.bold, + handler: () async { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + await model.searchDoctorsByTime(_selectedDisease); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } + + // Navigator.push( + // context, + // MaterialPageRoute(builder: (context) => BariatricsPage()), + // ); + }, + ), ), - ), + ], + ), + ), ); } diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart index 2282472b..45ea16fd 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart @@ -121,8 +121,7 @@ class _BMICalculatorState extends State { return AppScaffold( isShowAppBar: true, isShowDecPage: false, - appBarTitle: - "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", + appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -159,8 +158,7 @@ class _BMICalculatorState extends State { Row( children: [ Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), child: Center( child: Container( width: 60.0, @@ -181,8 +179,7 @@ class _BMICalculatorState extends State { Container( height: 38.0, child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Container( @@ -264,18 +261,15 @@ class _BMICalculatorState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: - Offset(0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], color: cmCard, borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 0.0, horizontal: 18.0), - child: Center( - child: Texts(TranslationBase.of(context).cm)), + padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts(TranslationBase.of(context).cm)), ), ), ), @@ -296,16 +290,13 @@ class _BMICalculatorState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: - Offset(0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), - child: Center( - child: Texts(TranslationBase.of(context).feet)), + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts(TranslationBase.of(context).feet)), ), ), ), @@ -337,8 +328,7 @@ class _BMICalculatorState extends State { Row( children: [ Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), child: Center( child: Container( width: 60.0, @@ -359,8 +349,7 @@ class _BMICalculatorState extends State { Container( height: 38.0, child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Container( @@ -442,18 +431,15 @@ class _BMICalculatorState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: - Offset(0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], color: kgCard, borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 0.0, horizontal: 18.0), - child: Center( - child: Texts(TranslationBase.of(context).kg)), + padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts(TranslationBase.of(context).kg)), ), ), ), @@ -474,17 +460,13 @@ class _BMICalculatorState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: - Offset(0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), - child: Center( - child: - Texts(TranslationBase.of(context).pound)), + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts(TranslationBase.of(context).pound)), ), ), ), diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart index a541b3ce..9b0ee417 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -50,9 +50,9 @@ class ResultPage extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( + isShowDecPage: false, isShowAppBar: true, - appBarTitle: - "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", + appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", body: Column( children: [ Expanded( @@ -112,11 +112,10 @@ class ResultPage extends StatelessWidget { backgroundColor: Theme.of(context).primaryColor, radius: 8, fontWeight: FontWeight.bold, - handler: (){ + handler: () { Navigator.push( context, - FadePage( - page: BariatricsPage(1, 1, finalResult)), + FadePage(page: BariatricsPage(1, 1, finalResult)), ); }, ), diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart index a3fdb5f7..6e7d6279 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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:percent_indicator/circular_percent_indicator.dart'; @@ -12,6 +14,7 @@ class BmrResultPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, + isShowDecPage: false, appBarTitle: 'BMR Calculator', body: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -55,8 +58,13 @@ class BmrResultPage extends StatelessWidget { Container( width: 350, child: Button( - label: 'See List Of Doctors', - ), + label: 'See List Of Doctors', + onTap: () { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + }), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index 1530d0ee..0ce34e42 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -148,18 +148,10 @@ class _BodyFatState extends State { void calculateBodyFat() { if (isMale == true) { - bodyFat = 495 / - (1.0324 - - 0.19077 * (log(waist - neck) / ln10) + - 0.15456 * (log(heightCm) / ln10)) - - 450; + bodyFat = 495 / (1.0324 - 0.19077 * (log(waist - neck) / ln10) + 0.15456 * (log(heightCm) / ln10)) - 450; fat = (bodyFat * 10) / 10.round(); } else if (isMale == false) { - bodyFat = 495 / - (1.29579 - - 0.35004 * (log(waist + hip - neck) / ln10) + - 0.22100 * (log(heightCm) / ln10)) - - 450; + bodyFat = 495 / (1.29579 - 0.35004 * (log(waist + hip - neck) / ln10) + 0.22100 * (log(heightCm) / ln10)) - 450; fat = (bodyFat * 10) / 10.round(); } if (fat <= 0) { @@ -180,11 +172,9 @@ class _BodyFatState extends State { } else if (bodyFat > 31 && bodyFat <= 60) { textResult = 'The category falls under obese'; } else if (bodyFat > 60) { - textResult = - 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + textResult = 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; } else if (bodyFat <= 9) { - textResult = - 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + textResult = 'Please check the value you have entered, since the body fat percentage cannot be this low.'; } } else { if (bodyFat > 5 && fat <= 13) { @@ -196,11 +186,9 @@ class _BodyFatState extends State { } else if (bodyFat > 24 && bodyFat <= 45) { textResult = 'The category falls under obese'; } else if (bodyFat > 45) { - textResult = - 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + textResult = 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; } else if (bodyFat <= 5) { - textResult = - 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + textResult = 'Please check the value you have entered, since the body fat percentage cannot be this low.'; } } } @@ -229,8 +217,7 @@ class _BodyFatState extends State { children: [ Padding( padding: EdgeInsets.all(10.0), - child: - Texts('Estimates the total body fat based on\n the size'), + child: Texts('Estimates the total body fat based on\n the size'), ), Divider( thickness: 2.0, @@ -308,14 +295,12 @@ class _BodyFatState extends State { child: Row( children: [ Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), child: Center( child: Container( width: 60.0, foregroundDecoration: BoxDecoration( - borderRadius: - BorderRadius.circular(5.0), + borderRadius: BorderRadius.circular(5.0), border: Border.all( color: Colors.blueGrey, width: 2.0, @@ -331,10 +316,8 @@ class _BodyFatState extends State { Container( height: 38.0, child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( decoration: BoxDecoration( @@ -351,8 +334,7 @@ class _BodyFatState extends State { ), onTap: () { setState(() { - if (heightCm < 250) - heightCm++; + if (heightCm < 250) heightCm++; }); }, ), @@ -364,8 +346,7 @@ class _BodyFatState extends State { ), onTap: () { setState(() { - if (heightCm > 0) - heightCm--; + if (heightCm > 0) heightCm--; }); }, ), @@ -420,16 +401,14 @@ class _BodyFatState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], color: cmCard, borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 0.0, horizontal: 18.0), + padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), child: Center(child: Texts('CM')), ), ), @@ -452,14 +431,12 @@ class _BodyFatState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), + padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Center(child: Texts('Ft')), ), ), @@ -484,14 +461,12 @@ class _BodyFatState extends State { child: Row( children: [ Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), child: Center( child: Container( width: 60.0, foregroundDecoration: BoxDecoration( - borderRadius: - BorderRadius.circular(5.0), + borderRadius: BorderRadius.circular(5.0), border: Border.all( color: Colors.blueGrey, width: 2.0, @@ -507,10 +482,8 @@ class _BodyFatState extends State { Container( height: 38.0, child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( decoration: BoxDecoration( @@ -594,16 +567,14 @@ class _BodyFatState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], color: neckCmCard, borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 0.0, horizontal: 18.0), + padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), child: Center(child: Texts('CM')), ), ), @@ -626,14 +597,12 @@ class _BodyFatState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), + padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Center(child: Texts('Ft')), ), ), @@ -658,14 +627,12 @@ class _BodyFatState extends State { child: Row( children: [ Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), child: Center( child: Container( width: 60.0, foregroundDecoration: BoxDecoration( - borderRadius: - BorderRadius.circular(5.0), + borderRadius: BorderRadius.circular(5.0), border: Border.all( color: Colors.blueGrey, width: 2.0, @@ -681,10 +648,8 @@ class _BodyFatState extends State { Container( height: 38.0, child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( decoration: BoxDecoration( @@ -701,8 +666,7 @@ class _BodyFatState extends State { ), onTap: () { setState(() { - if (waist < 200) - waist++; + if (waist < 200) waist++; }); }, ), @@ -769,16 +733,14 @@ class _BodyFatState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], color: waistCmCard, borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 0.0, horizontal: 18.0), + padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), child: Center(child: Texts('CM')), ), ), @@ -801,14 +763,12 @@ class _BodyFatState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), + padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Center(child: Texts('Ft')), ), ), @@ -833,14 +793,12 @@ class _BodyFatState extends State { child: Row( children: [ Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), child: Center( child: Container( width: 60.0, foregroundDecoration: BoxDecoration( - borderRadius: - BorderRadius.circular(5.0), + borderRadius: BorderRadius.circular(5.0), border: Border.all( color: Colors.blueGrey, width: 2.0, @@ -856,10 +814,8 @@ class _BodyFatState extends State { Container( height: 38.0, child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( decoration: BoxDecoration( @@ -943,16 +899,14 @@ class _BodyFatState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], color: hipCmCard, borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 0.0, horizontal: 18.0), + padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), child: Center(child: Texts('CM')), ), ), @@ -975,14 +929,12 @@ class _BodyFatState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), + padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Center(child: Texts('Ft')), ), ), @@ -995,7 +947,7 @@ class _BodyFatState extends State { ], ), Container( - height: 100.0, + height: MediaQuery.of(context).size.height * 0.084, width: 350.0, child: SecondaryButton( label: 'CALCULATE', diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart index c8c5476e..f41f9598 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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:percent_indicator/circular_percent_indicator.dart'; @@ -68,6 +70,12 @@ class FatResult extends StatelessWidget { width: 350, child: Button( label: 'See List Of Doctors', + onTap: () { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + }, ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart index 110b2afc..ed3dd8f8 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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:percent_indicator/circular_percent_indicator.dart'; @@ -45,13 +47,18 @@ class CalorieResultPage extends StatelessWidget { ), ), Container( - child: - Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'), + child: Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'), ), Container( width: 350, child: Button( label: 'See List Of Doctors', + onTap: () { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + }, ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart index f8d0815a..474b8613 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'dart:math'; @@ -156,6 +158,12 @@ class CarbsResult extends StatelessWidget { width: 350, child: Button( label: 'See List Of Doctors', + onTap: () { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + }, ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart index d19c6017..db5a585c 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart @@ -70,9 +70,7 @@ class _DeliveryDueState extends State { onConfirm: (date) { print('confirm $date'); setState(() { - bloodSugarDate == date - ? null - : bloodSugarDate = DateTime.now(); + bloodSugarDate = date; dateFrom = date.add(Duration(days: 10)); dateTo = date.add(Duration(days: 20)); @@ -90,9 +88,7 @@ class _DeliveryDueState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -124,14 +120,14 @@ class _DeliveryDueState extends State { context, FadePage( page: DeliveryDueResult( - conceivedDate: conceivedDate, - dateFrom: dateFrom, - dateTo: dateTo, - deliveryDue: deliveryDue, - firstTrimester: firstTrimester, - secondTrimester: secondTrimester, - thirdTrimester: thirdTrimester, - )), + conceivedDate: conceivedDate, + dateFrom: dateFrom, + dateTo: dateTo, + deliveryDue: deliveryDue, + firstTrimester: firstTrimester, + secondTrimester: secondTrimester, + thirdTrimester: thirdTrimester, + )), ); } }); diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart index fc53b044..e03e5fce 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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:intl/intl.dart'; @@ -43,17 +45,13 @@ class DeliveryDueResult extends StatelessWidget { fontWeight: FontWeight.w400, ), Texts(DateFormat.yMMMEd().format(dateFrom), - fontWeight: FontWeight.w800, - fontSize: 21.0, - color: Color(0xffC5272D)), + fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), Texts( 'To:', fontWeight: FontWeight.w400, ), Texts(DateFormat.yMMMEd().format(dateTo), - fontWeight: FontWeight.w800, - fontSize: 21.0, - color: Color(0xffC5272D)), + fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), Texts( 'You have conceived on:', fontWeight: FontWeight.w400, @@ -94,6 +92,12 @@ class DeliveryDueResult extends StatelessWidget { width: 350, child: Button( label: 'See List Of Doctors', + onTap: () { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + }, ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/doctor_list.dart b/lib/pages/AlHabibMedicalService/health_calculator/doctor_list.dart new file mode 100644 index 00000000..b7d50303 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/doctor_list.dart @@ -0,0 +1,126 @@ +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; + +class DoctorList extends StatelessWidget { + const DoctorList({Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + allowAny: true, + onModelReady: (model) => model.getDoctorList(), + builder: (BuildContext context, BariatricsViewModel model, Widget child) => AppScaffold( + isShowDecPage: false, + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Doctors List", + description: TranslationBase.of(context).infoApprovals, + infoList: TranslationBase.of(context).infoApprovalPoints, + body: ListView.builder( + itemCount: model.doctorLists.length, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 10.0), + child: Container( + //height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration(color: Colors.white), + + child: ExpansionTile( + title: Padding( + padding: EdgeInsets.all(21.0), + child: Texts(model.doctorLists[index].filterName), + ), + children: model.doctorLists[index].doctorsByTimeList + .map((doctor) => Card( + margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(doctor.doctorImageURL, + fit: BoxFit.fill, height: 60.0, width: 60.0), + ), + ), + Expanded( + flex: 4, + child: Container( + width: MediaQuery.of(context).size.width * 0.55, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (doctor.doctorTitle != null) + Text(doctor.doctorTitle + " " + doctor.name, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(doctor.clinicName != null ? doctor.clinicName : "", + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(doctor.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: doctor.actualDoctorRate.toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + child: Image.network(doctor.nationalityFlagURL, + width: 25.0, height: 25.0), + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + )) + .toList(), + ), + ), + ); + }), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart index 605e499a..24fc768f 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'dart:math'; @@ -11,12 +13,7 @@ class IdealBodyResult extends StatelessWidget { final double overWeightBy; final String textResult; - IdealBodyResult( - {this.idealBodyWeight, - this.minRange, - this.mixRange, - this.overWeightBy, - this.textResult}); + IdealBodyResult({this.idealBodyWeight, this.minRange, this.mixRange, this.overWeightBy, this.textResult}); @override Widget build(BuildContext context) { return AppScaffold( @@ -82,8 +79,7 @@ class IdealBodyResult extends StatelessWidget { : overWeightBy > 10 && overWeightBy < 17 ? Column( children: [ - Texts( - 'This means that the weight is a little bit more than ideal weight by'), + Texts('This means that the weight is a little bit more than ideal weight by'), Texts(overWeightBy.toStringAsFixed(1)), Texts( 'May wish to consult with the doctor for medical help. Click to view our list of Doctors'), @@ -161,6 +157,12 @@ class IdealBodyResult extends StatelessWidget { width: 350, child: Button( label: 'See List Of Doctors', + onTap: () { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + }, ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart index 6669bf75..6ced14b2 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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:intl/intl.dart'; @@ -9,8 +11,7 @@ class OvulationResult extends StatelessWidget { var dateTo; var conceivedDate; var deliveryDue; - OvulationResult( - {this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate}); + OvulationResult({this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate}); //var newFormat = DateFormat("yy-MM-dd"); @override @@ -84,6 +85,12 @@ class OvulationResult extends StatelessWidget { width: 350, child: Button( label: 'See List Of Doctors', + onTap: () { + Navigator.push( + context, + FadePage(page: DoctorList()), + ); + }, ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart index cf230466..27c89383 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -112,8 +112,7 @@ class _BloodSugarState extends State { onTap: () { setState(() { updateColor(1); - inputValue = - double.parse(textController.text); + inputValue = double.parse(textController.text); inputValue = inputValue / 15; unit = 'mmol/l'; }); @@ -127,16 +126,14 @@ class _BloodSugarState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], color: cardMGColor, borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 0.0, horizontal: 18.0), + padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), child: Texts('MG/DLt TO \nMMOL/L'), ), ), @@ -145,8 +142,7 @@ class _BloodSugarState extends State { onTap: () { setState(() { updateColor(2); - inputValue = - double.parse(textController.text); + inputValue = double.parse(textController.text); inputValue = inputValue * 18; unit = 'mg/dlt'; }); @@ -162,15 +158,13 @@ class _BloodSugarState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset( - 0, 3), // changes position of shadow + offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16.0), - child: Texts('MG/DLt TO\n MMOL/L'), + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Texts('\nMMOL/L TO MG/DLt '), ), ), ), @@ -197,8 +191,7 @@ class _BloodSugarState extends State { keyboardType: TextInputType.number, decoration: InputDecoration( labelText: TranslationBase.of(context).enterReadingValue, - border: OutlineInputBorder( - borderSide: BorderSide(color: Colors.black45)), + border: OutlineInputBorder(borderSide: BorderSide(color: Colors.black45)), labelStyle: TextStyle( color: Colors.black87, ), @@ -260,9 +253,7 @@ class _BloodSugarState extends State { label: TranslationBase.of(context).calculate, onTap: () { setState(() { - _visible == false - ? _visible = !_visible - : _visible = _visible; + _visible == false ? _visible = !_visible : _visible = _visible; calculateBloodSugar(); }); }, diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart index 59163c15..c4841a24 100644 --- a/lib/pages/AlHabibMedicalService/my_web_view.dart +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -8,8 +8,7 @@ class MyWebView extends StatelessWidget { final String title; final String selectedUrl; - final Completer _controller = - Completer(); + final Completer _controller = Completer(); MyWebView({ @required this.title, @@ -21,17 +20,12 @@ class MyWebView extends StatelessWidget { return AppScaffold( isShowAppBar: true, appBarTitle: title, - - body: - WebView( + body: WebView( initialUrl: selectedUrl, javascriptMode: JavascriptMode.unrestricted, onWebViewCreated: (WebViewController webViewController) { _controller.complete(webViewController); }, - ) - - - ); + )); } -} \ No newline at end of file +} diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart index dbd8939c..fab4eb6d 100644 --- a/lib/pages/AlHabibMedicalService/​ health_calculators.dart +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -9,7 +9,6 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; - import 'health_calculator/bmi_calculator/bmi_calculator.dart'; import 'health_calculator/bmr_calculator/bmr_calculator.dart'; import 'health_calculator/calorie_calculator/calorie_calculator.dart'; @@ -21,8 +20,7 @@ class HealthCalculators extends StatefulWidget { _HealthCalculatorsState createState() => _HealthCalculatorsState(); } -class _HealthCalculatorsState extends State - with SingleTickerProviderStateMixin { +class _HealthCalculatorsState extends State with SingleTickerProviderStateMixin { TabController _tabController; void initState() { super.initState(); @@ -67,22 +65,19 @@ class _HealthCalculatorsState extends State indicatorWeight: 4.0, indicatorColor: Colors.red, labelColor: Theme.of(context).buttonColor, - labelPadding: - EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), unselectedLabelColor: Colors.grey, tabs: [ Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts( - TranslationBase.of(context).generalHealth), + child: Texts(TranslationBase.of(context).generalHealth), ), ), Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: - Texts(TranslationBase.of(context).womanHealth), + child: Texts(TranslationBase.of(context).womanHealth), ), ), ], @@ -121,8 +116,7 @@ class _HealthCalculatorsState extends State child: MedicalProfileItem( title: TranslationBase.of(context).bmi, imagePath: 'bmi_health_calculator.png', - subTitle: - TranslationBase.of(context).calcHealth, + subTitle: TranslationBase.of(context).calcHealth, ), ), ), @@ -140,8 +134,7 @@ class _HealthCalculatorsState extends State child: MedicalProfileItem( title: TranslationBase.of(context).calories, imagePath: 'calories-calculator.png', - subTitle: - TranslationBase.of(context).calcHealth, + subTitle: TranslationBase.of(context).calcHealth, ), ), ), @@ -163,8 +156,7 @@ class _HealthCalculatorsState extends State child: MedicalProfileItem( title: TranslationBase.of(context).bmr, imagePath: 'BMR_calculator.png', - subTitle: - TranslationBase.of(context).calcHealth, + subTitle: TranslationBase.of(context).calcHealth, ), ), ), @@ -220,11 +212,9 @@ class _HealthCalculatorsState extends State ); }, child: MedicalProfileItem( - title: - TranslationBase.of(context).carbohydrate, + title: TranslationBase.of(context).carbohydrate, imagePath: 'carb_protein.png', - subTitle: - TranslationBase.of(context).proteinFat, + subTitle: TranslationBase.of(context).proteinFat, ), ), ), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 51692461..62a7350c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -416,7 +416,7 @@ class _HomePageState extends State { height: 40, ), Texts( - "${model.heightCm}", + "${model.heightCm} ${TranslationBase.of(context).cm}", color: Colors.white, fontSize: 17, ) @@ -434,7 +434,7 @@ class _HomePageState extends State { width: 25, height: 40, ), - Texts('${model.weightKg}', + Texts('${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 17) ], @@ -445,8 +445,6 @@ class _HomePageState extends State { ), Expanded( child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ Image.asset( 'assets/images/blood_icon.png', @@ -456,6 +454,7 @@ class _HomePageState extends State { Texts( '${model.booldType}', color: Colors.white, + fontSize: 17 ) ], ), diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index c90b29a7..41592110 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -20,8 +20,7 @@ class WeightHomePage extends StatefulWidget { _WeightHomePageState createState() => _WeightHomePageState(); } -class _WeightHomePageState extends State - with SingleTickerProviderStateMixin { +class _WeightHomePageState extends State with SingleTickerProviderStateMixin { TabController _tabController; @override @@ -42,33 +41,38 @@ class _WeightHomePageState extends State onModelReady: (model) => model.getWeight(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + isShowDecPage: false, appBarTitle: TranslationBase.of(context).weight, - appBarIcons: [IconButton( - icon: Icon(Icons.email), - color: Colors.white, - onPressed: () { - showDialog( - context: context, - child: ConfirmSendEmailDialog( - email: model.user.emailAddress, - onTapSendEmail: () async{ - GifLoaderDialogUtils.showMyDialog(context); - model.sendReportByEmail().then((value) { - GifLoaderDialogUtils.hideDialog(context); - if(model.state == ViewState.ErrorLocal){ + appBarIcons: [ + IconButton( + icon: Icon(Icons.email), + color: Colors.white, + onPressed: () { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () async { + GifLoaderDialogUtils.showMyDialog(context); + model.sendReportByEmail().then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).emailSentSuccessfully, + ); + } + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: model.error); - }else{ - AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, ); - } - }).catchError((e){ - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: model.error); - }); - }, - ), - ); - }, - ),], + }); + }, + ), + ); + }, + ), + ], baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -89,7 +93,7 @@ class _WeightHomePageState extends State model: model, ), WeightYearPage( - model: model, + model: model, ) ], ), @@ -98,7 +102,12 @@ class _WeightHomePageState extends State ), floatingActionButton: InkWell( onTap: () { - Navigator.push(context, FadePage(page: AddWeightPage(model: model,))); + Navigator.push( + context, + FadePage( + page: AddWeightPage( + model: model, + ))); }, child: Container( width: 55, diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart index 6f64bacb..0de0f451 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -28,46 +28,52 @@ class WeightMonthlyPage extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: model.weighMonthTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( - children: [ - Container( - width: double.maxFinite, - color: Colors.white, - child: MonthLineChartCurved( - horizontalInterval: 1.0, - title: TranslationBase.of(context).weight, - timeSeries: model.weighMonthTimeSeriesData, - indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, - )), - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).details), - ), - Container( - padding: EdgeInsets.all(10), - color: Colors.transparent, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), - ), - children: fullData(context, projectViewModel, model), + isShowDecPage: false, + body: model.weighMonthTimeSeriesData.isEmpty + ? Container( + child: Center( + child: Texts(TranslationBase.of(context).noDataAvailable), + ), + ) + : ListView( + children: [ + Container( + width: double.maxFinite, + color: Colors.white, + child: MonthLineChartCurved( + horizontalInterval: 1.0, + title: TranslationBase.of(context).weight, + timeSeries: model.weighMonthTimeSeriesData, + indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, + )), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).details), ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(context, projectViewModel, model), + ), + ], + ), + ) ], ), - ) - ], - ), ); } - List fullData(BuildContext context, - ProjectViewModel projectViewModel, WeightPressureViewModel model) { + List fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( @@ -76,12 +82,8 @@ class WeightMonthlyPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), - topRight: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), + topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), ), ), child: Center( @@ -109,12 +111,8 @@ class WeightMonthlyPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), - topRight: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), ), ), child: Center( diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 866c2b5b..47afd9fe 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -1,5 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; @@ -26,47 +24,57 @@ class WeightWeeklyPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: model.weightWeekTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( - children: [ - Container( - margin: EdgeInsets.only(top: 12, left: 8, right: 8), - color: Colors.white, - child: LineChartCurved( - horizontalInterval: 1.0, - title: TranslationBase.of(context).weight, - timeSeries: model.weightWeekTimeSeriesData, - indexes: model.weightWeekTimeSeriesData.length ~/ 5.5, - ), - ), - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).details), - ), - Container( - padding: EdgeInsets.all(10), - color: Colors.transparent, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), + isShowDecPage: false, + body: model.weightWeekTimeSeriesData.isEmpty + ? Container( + child: Center( + child: Container( + child: Center( + child: Texts(TranslationBase.of(context).noDataAvailable), ), - children: fullData(context, projectViewModel, model), ), + ), + ) + : ListView( + children: [ + Container( + margin: EdgeInsets.only(top: 12, left: 8, right: 8), + color: Colors.white, + child: LineChartCurved( + horizontalInterval: 1.0, + title: TranslationBase.of(context).weight, + timeSeries: model.weightWeekTimeSeriesData, + indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0, + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).details), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(context, projectViewModel, model), + ), + ], + ), + ) ], ), - ) - ], - ), ); } - List fullData(BuildContext context, - ProjectViewModel projectViewModel, WeightPressureViewModel model) { + List fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( @@ -75,12 +83,8 @@ class WeightWeeklyPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), - topRight: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), + topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), ), ), child: Center( @@ -120,12 +124,8 @@ class WeightWeeklyPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), - topRight: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), ), ), child: Center( diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index 7fa03819..a3b443d4 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -18,55 +18,61 @@ import 'package:provider/provider.dart'; class WeightYearPage extends StatelessWidget { final WeightPressureViewModel model; - - const WeightYearPage({Key key, this.model, }) - : super(key: key); + const WeightYearPage({ + Key key, + this.model, + }) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: model.weightYearTimeSeriesData.isEmpty ? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),) : ListView( - children: [ - Container( - width: double.maxFinite, - color: Colors.white, - child: LineChartCurved( - horizontalInterval: 2.0, - title: TranslationBase.of(context).weight, - timeSeries: model.weightYearTimeSeriesData, - indexes: model.weightYearTimeSeriesData.length ~/ 5.5, - ) - ), - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).details), - ), - Container( - padding: EdgeInsets.all(10), - color: Colors.transparent, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), - ), - children: fullData(context, projectViewModel, model), + isShowDecPage: false, + body: model.weightYearTimeSeriesData.isEmpty + ? Container( + child: Center( + child: Texts(TranslationBase.of(context).noDataAvailable), + ), + ) + : ListView( + children: [ + Container( + width: double.maxFinite, + color: Colors.white, + child: LineChartCurved( + horizontalInterval: 2.0, + title: TranslationBase.of(context).weight, + timeSeries: model.weightYearTimeSeriesData, + indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "", + )), + SizedBox( + height: 12, ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).details), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(context, projectViewModel, model), + ), + ], + ), + ) ], ), - ) - ], - ), ); } - List fullData(BuildContext context, - ProjectViewModel projectViewModel, WeightPressureViewModel model) { + List fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( @@ -75,12 +81,8 @@ class WeightYearPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), - topRight: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), + topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), ), ), child: Center( @@ -108,12 +110,8 @@ class WeightYearPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), - topRight: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), ), ), child: Center( @@ -128,7 +126,7 @@ class WeightYearPage extends StatelessWidget { ), ); model.yearWeightMeasurementResult.forEach( - (diabtec) { + (diabtec) { tableRow.add( TableRow( children: [ diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index ade2c366..1d4fba82 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -42,12 +42,10 @@ class AddBloodPressurePage extends StatefulWidget { class _AddBloodPressurePageState extends State { TextEditingController _bloodSystolicValueController = TextEditingController(); - TextEditingController _bloodDiastolicValueController = - TextEditingController(); + TextEditingController _bloodDiastolicValueController = TextEditingController(); DateTime bloodSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now(); int measuredArm = 1; - bool isButtonDisabled = false; final List measureTimeEnList = [ 'Left', 'Right', @@ -71,7 +69,6 @@ class _AddBloodPressurePageState extends State { measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType); _bloodSystolicValueController.text = widget.bloodSystolicValue; _bloodDiastolicValueController.text = widget.bloodDiastolicValue; - validateForm(); } } @@ -81,9 +78,7 @@ class _AddBloodPressurePageState extends State { return AppScaffold( isShowAppBar: true, - appBarTitle: widget.isUpdate - ? TranslationBase.of(context).update - : TranslationBase.of(context).add, + appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, appBarIcons: widget.isUpdate ? [ IconButton( @@ -99,14 +94,10 @@ class _AddBloodPressurePageState extends State { ConfirmDialog.closeAlertDialog(context); GifLoaderDialogUtils.showMyDialog(context); - widget.model - .deactivateDiabeticStatus( - lineItemNo: widget.lineItemNo) - .then((value) { + widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) { GifLoaderDialogUtils.hideDialog(context); if (widget.model.state == ViewState.ErrorLocal) - AppToast.showErrorToast( - message: widget.model.error); + AppToast.showErrorToast(message: widget.model.error); else Navigator.pop(context); }).catchError((e) { @@ -133,8 +124,6 @@ class _AddBloodPressurePageState extends State { hintText: TranslationBase.of(context).systolicAdd, controller: _bloodSystolicValueController, keyboardType: TextInputType.number, - maxLength: 3, - onChanged: (value) => validateForm(), ), SizedBox( height: 8, @@ -143,25 +132,19 @@ class _AddBloodPressurePageState extends State { hintText: TranslationBase.of(context).diastolicAdd, controller: _bloodDiastolicValueController, keyboardType: TextInputType.number, - maxLength: 3, - onChanged: (value) => validateForm(), ), SizedBox( height: 8, ), InkWell( onTap: () { - confirmSelectMeasureTimeDialog(projectViewModel.isArabic - ? measureTimeEnList - : measureTimeArList); + confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList); }, child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -188,17 +171,13 @@ class _AddBloodPressurePageState extends State { bloodSugarDate = date; }, ); - }, - currentTime: bloodSugarDate, - locale: projectViewModel.localeType); + }, currentTime: bloodSugarDate, locale: projectViewModel.localeType); }, child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -213,30 +192,22 @@ class _AddBloodPressurePageState extends State { ), InkWell( onTap: () { - DatePicker.showTimePicker(context, showTitleActions: true, - onConfirm: (date) { + DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { setState( () { timeSugarDate = date; }, ); - }, - currentTime: timeSugarDate, - locale: projectViewModel.localeType); + }, currentTime: timeSugarDate, locale: projectViewModel.localeType); }, child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(TranslationBase.of(context).time), - Texts(getTime()) - ], + children: [Texts(TranslationBase.of(context).time), Texts(getTime())], ), ), ), @@ -254,12 +225,8 @@ class _AddBloodPressurePageState extends State { loading: widget.model.state == ViewState.BusyLocal, label: TranslationBase.of(context).save.toUpperCase(), textColor: Colors.white, - color: isButtonDisabled - ? Colors.grey[900] - : Colors.grey, onTap: () async { - if (_bloodSystolicValueController.text.isNotEmpty && - _bloodDiastolicValueController.text.isNotEmpty) { + if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); widget.model @@ -267,10 +234,8 @@ class _AddBloodPressurePageState extends State { isUpdate: widget.isUpdate, bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - diastolicPressure: - _bloodDiastolicValueController.text.toString(), - systolicePressure: - _bloodSystolicValueController.text.toString(), + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), measuredArm: measuredArm, ) .then((value) { @@ -310,43 +275,9 @@ class _AddBloodPressurePageState extends State { setState(() { measureTimeSelectedType = value; measuredArm = list.indexOf(value); - validateForm(); }); }, ), ); } - - void validateForm() { - print("_bloodSystolicValueController "+_bloodSystolicValueController.text.length.toString()); - if (measureTimeSelectedType != 'Left Arm' && - _bloodSystolicValueController.text.length > 0 && - _bloodDiastolicValueController.text.length > 0) { - setState(() { - isButtonDisabled = true; - }); - } else { - setState(() { - isButtonDisabled = false; - }); - } - // if(measureTimeSelectedType == 'Left Arm'){ - // setState(() { - // isButtonDisabled = false; - // }); - // }else if(_bloodSystolicValueController.text.length < 0){ - // setState(() { - // isButtonDisabled = false; - // }); - // }else if(_bloodDiastolicValueController.text.length < 0){ - // setState(() { - // isButtonDisabled = false; - // }); - // }else{ - // setState(() { - // isButtonDisabled = true; - // }); - // } - } - } diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart index 842d55f1..2f654526 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -17,8 +17,7 @@ class BloodYearPage extends StatelessWidget { final List diabtecPatientResult; final List timeSeriesData; - const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData}) - : super(key: key); + const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData}) : super(key: key); @override Widget build(BuildContext context) { @@ -38,7 +37,7 @@ class BloodYearPage extends StatelessWidget { child: LineChartCurved( title: 'Sugar', timeSeries: timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5, + indexes: timeSeriesData.length ~/ 5.5 ?? 0, )), SizedBox( height: 12, @@ -55,8 +54,7 @@ class BloodYearPage extends StatelessWidget { children: [ Table( border: TableBorder.symmetric( - inside: - BorderSide(width: 2.0, color: Colors.grey[300]), + inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), children: fullData(context, projectViewModel), ), @@ -68,8 +66,7 @@ class BloodYearPage extends StatelessWidget { ); } - List fullData( - BuildContext context, ProjectViewModel projectViewModel) { + List fullData(BuildContext context, ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add( TableRow( @@ -79,12 +76,8 @@ class BloodYearPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), - topRight: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), + topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), ), ), child: Center( @@ -130,12 +123,8 @@ class BloodYearPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), - topRight: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), ), ), child: Center( diff --git a/lib/pages/medical/my_trackers/my_trackers.dart b/lib/pages/medical/my_trackers/my_trackers.dart index 5e5c4527..c133c67a 100644 --- a/lib/pages/medical/my_trackers/my_trackers.dart +++ b/lib/pages/medical/my_trackers/my_trackers.dart @@ -15,6 +15,7 @@ class MyTrackers extends StatelessWidget { return AppScaffold( appBarTitle: TranslationBase.of(context).myTracker, isShowAppBar: true, + isShowDecPage: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(12), @@ -27,22 +28,24 @@ class MyTrackers extends StatelessWidget { children: [ Expanded( child: InkWell( - onTap: ()=> Navigator.push(context, FadePage(page: BloodSugarHomePage())), + onTap: () => Navigator.push(context, FadePage(page: BloodSugarHomePage())), child: Container( margin: EdgeInsets.all(5), - width: MediaQuery.of(context).size.width*0.35, - height:MediaQuery.of(context).size.width*0.35 , + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.width * 0.35, decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - color: Colors.white - ), + shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset('assets/tracker/blood-suger.png',width: 60.0,), - SizedBox(height: 15,), + Image.asset( + 'assets/tracker/blood-suger.png', + width: 60.0, + ), + SizedBox( + height: 15, + ), Texts(TranslationBase.of(context).bloodSugar), ], ), @@ -51,22 +54,24 @@ class MyTrackers extends StatelessWidget { ), Expanded( child: InkWell( - onTap: ()=> Navigator.push(context, FadePage(page: BloodPressureHomePage())), + onTap: () => Navigator.push(context, FadePage(page: BloodPressureHomePage())), child: Container( margin: EdgeInsets.all(5), - width: MediaQuery.of(context).size.width*0.35, - height:MediaQuery.of(context).size.width*0.35 , + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.width * 0.35, decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - color: Colors.white - ), + shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset('assets/tracker/blood-pressure.png',width: 60.0,), - SizedBox(height: 15,), + Image.asset( + 'assets/tracker/blood-pressure.png', + width: 60.0, + ), + SizedBox( + height: 15, + ), Texts(TranslationBase.of(context).bloodPressure), ], ), @@ -80,22 +85,24 @@ class MyTrackers extends StatelessWidget { children: [ Expanded( child: InkWell( - onTap: ()=> Navigator.push(context, FadePage(page: WeightHomePage())), + onTap: () => Navigator.push(context, FadePage(page: WeightHomePage())), child: Container( margin: EdgeInsets.all(5), - width: MediaQuery.of(context).size.width*0.35, - height:MediaQuery.of(context).size.width*0.35 , + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.width * 0.35, decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - color: Colors.white - ), + shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset('assets/tracker/weight.png',width: 60.0,), - SizedBox(height: 15,), + Image.asset( + 'assets/tracker/weight.png', + width: 60.0, + ), + SizedBox( + height: 15, + ), Texts(TranslationBase.of(context).weight), ], ), diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 72d0422b..922fb239 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -61,15 +61,13 @@ class ReportListWidget extends StatelessWidget { ), Texts(reportList[index].projectName), Texts(reportList[index].clinicDescription), - Texts(TranslationBase.of(context).invoiceNo + - ': ${reportList[index].invoiceNo}'), + Texts(TranslationBase.of(context).invoiceNo + ': ${reportList[index].invoiceNo}'), SizedBox(height: 12), ], ), reportList[index].status == 2 ? Container( - margin: - EdgeInsets.only(left: 15.0, right: 15.0), + margin: EdgeInsets.only(left: 15.0, right: 15.0), child: InkWell( onTap: () { showConfirmMessage(reportList[index]); @@ -78,7 +76,7 @@ class ReportListWidget extends StatelessWidget { child: Icon( Icons.email, color: Theme.of(context).primaryColor, - size: 35.0, + size: 30.0, ), ), ) @@ -123,8 +121,7 @@ class ReportListWidget extends StatelessWidget { report.setupId) .then((value) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - AppToast.showSuccessToast( - message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); + AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(err); diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart index fe112767..76610708 100644 --- a/lib/pages/medical/vital_sign/LineChartCurved.dart +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -27,7 +27,7 @@ class LineChartCurved extends StatelessWidget { getYaxix(); calculateMaxAndMin(); return AspectRatio( - aspectRatio: 1.1, + aspectRatio: 1.0, child: Container( decoration: const BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(18)), @@ -80,14 +80,6 @@ class LineChartCurved extends StatelessWidget { } getYaxix() { - // int indexess= (timeSeries.length*0.30).toInt(); - // for (int index = 0; index < timeSeries.length; index++) { - // int mIndex = indexess * index; - // if (mIndex < timeSeries.length) { - // yAxixs.add(timeSeries[mIndex].sales); - // } - // } - for (int index = 0; index < timeSeries.length; index++) { int mIndex = indexes * index; if (mIndex < timeSeries.length) { @@ -181,7 +173,7 @@ class LineChartCurved extends StatelessWidget { minX: minX, maxX: maxX, maxY: maxY, - minY: minY, + minY: 0, lineBarsData: getData(context), ); } diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index fb723a1f..27ce8399 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -30,173 +30,190 @@ class _MyVaccinesState extends State { onModelReady: (model) => model.getVaccine(), builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).myVaccines, - baseViewModel: model, - body: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - RoundedContainer( - backgroundColor: Colors.white, - child: ExpansionTile( - title: Container( - height: 65.0, - child: Text('2018'), - ), - children: [ - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.vaccineList == null - ? 0 - : model.vaccineList.length, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - RoundedContainer( - child: Column( - children: [ - Row( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).myVaccines, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null + ? 0 + : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( children: [ - Expanded( - child: Column( - children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, - vertical: 20.0), - child: Image.network( - model.vaccineList[index] - .doctorImageURL, - height: SizeConfig + Row( + children: [ + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 20.0, + vertical: 20.0), + child: Image.network( + model + .vaccineList[ + index] + .doctorImageURL, + height: SizeConfig .imageSizeMultiplier * - 23, - width: SizeConfig + 23, + width: SizeConfig .imageSizeMultiplier * - 20, - fit: BoxFit.fill, - ), + 20, + fit: BoxFit.fill, + ), + ), + ], ), - ], - ), - flex: 2, - ), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - model.vaccineList[index] + flex: 2, + ), + Expanded( + child: Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + model + .vaccineList[ + index] .doctorTitle + - model.vaccineList[index] - .doctorName, - style: TextStyle( - fontWeight: + model + .vaccineList[ + index] + .doctorName, + style: TextStyle( + fontWeight: FontWeight.w900, - fontSize: 16.6, - ), - ), - SizedBox(height: 7.0), - Text( - model.vaccineList[index] - .projectName, - style: TextStyle( - fontSize: 17.0, - letterSpacing: 0.5, - ), - ), - SizedBox(height: 7.0), - Text( - model.vaccineList[index] - .vaccineName, - style: TextStyle( - fontSize: 17.0, - ), - ), - SizedBox(height: 7.0), - Text( - 'Date Taken ' + - convertDateFormat(model - .vaccineList[index] - .invoiceDate), - style: TextStyle( - fontSize: 17.0), + fontSize: 16.6, + ), + ), + SizedBox(height: 7.0), + Text( + model + .vaccineList[ + index] + .projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SizedBox(height: 7.0), + Text( + model + .vaccineList[ + index] + .vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SizedBox(height: 7.0), + Text( + 'Date Taken ' + + convertDateFormat(model + .vaccineList[ + index] + .invoiceDate), + style: TextStyle( + fontSize: 17.0), + ), + ], ), - ], + ), + flex: 5, ), - ), - flex: 5, + ], ), ], ), - ], - ), - ), - ], - ); - }), - ) - ], - ), - ), - // SpaceBetweenTexts(space: 165.0), - ], - ), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(12), - height: MediaQuery.of(context).size.height * 0.25, - width: double.infinity, - child: Column( - children: [ - Divider( - height: 2, - thickness: 1, - ), - SizedBox( - height: 6, - ), - Container( - width: double.infinity, - // height: 80.0, - child: Button( - disabled: true, - label: TranslationBase.of(context).checkVaccineAvailability, - backgroundColor: Color(0xff9EA3A4), - onTap: () => Navigator.push( - context, FadePage(page: MyVaccinesItemPage())), - ), + ), + ], + ); + }), + ) + ], + ), + ), + // SpaceBetweenTexts(space: 165.0), + ], ), - if (projectViewModel.havePrivilege(27)) - Container( - width: double.infinity, - // height: 80.0, - child: SecondaryButton( - label: TranslationBase.of(context).sendEmail, - color: Color(0xffF62426), - textColor: Colors.white, - disabled: model.vaccineList.length == 0, - loading: model.state == ViewState.BusyLocal, - onTap: () async { - model.sendEmail( - message: TranslationBase.of(context) - .emailSentSuccessfully); - }, + ), + bottomSheet: model.state == ViewState.Busy?Container(height: 0,): model.vaccineList.length > 0 + ? Container( + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + height: MediaQuery.of(context).size.height * 0.25, + width: double.infinity, + child: Column( + children: [ + Divider( + height: 2, + thickness: 1, + ), + SizedBox( + height: 6, ), - ), - ], + Container( + width: double.infinity, + // height: 80.0, + child: Button( + disabled: true, + label: TranslationBase.of(context) + .checkVaccineAvailability, + backgroundColor: Color(0xff9EA3A4), + onTap: () => Navigator.push( + context, FadePage(page: MyVaccinesItemPage())), + ), + ), + if (projectViewModel.havePrivilege(27)) + Container( + width: double.infinity, + // height: 80.0, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + color: Color(0xffF62426), + textColor: Colors.white, + disabled: model.vaccineList.length == 0, + loading: model.state == ViewState.BusyLocal, + onTap: () async { + model.sendEmail( + message: TranslationBase.of(context) + .emailSentSuccessfully); + }, + ), + ), + ], + ), + ) + : Container(height: 0,), ), - ), - ), ); }