From e934d3b0034ed2bd45dff3ad2f65ab2c6cf7e960 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 18 May 2021 20:31:42 +0300 Subject: [PATCH] first step from upgrade --- ios/Podfile | 7 +- ios/Podfile.lock | 325 --- .../contents.xcworkspacedata | 2 +- lib/UpdatePage.dart | 16 +- lib/client/base_app_client.dart | 76 +- lib/config/config.dart | 2 +- lib/config/size_config.dart | 22 +- lib/core/enum/auth_method_types.dart | 6 +- .../insurance_approval_request_model.dart | 26 +- .../model/Prescriptions/Prescriptions.dart | 74 +- .../in_patient_prescription_model.dart | 2 +- .../Prescriptions/perscription_pharmacy.dart | 38 +- .../post_prescrition_req_model.dart | 42 +- .../prescription_in_patient.dart | 68 +- .../Prescriptions/prescription_model.dart | 8 +- .../Prescriptions/prescription_report.dart | 84 +- .../prescription_report_enh.dart | 52 +- .../Prescriptions/prescription_req_model.dart | 2 +- .../Prescriptions/prescriptions_order.dart | 34 +- ...t_get_list_pharmacy_for_prescriptions.dart | 24 +- .../request_prescription_report.dart | 38 +- .../request_prescription_report_enh.dart | 38 +- .../admissionRequest/admission-request.dart | 92 +- .../model/admissionRequest/clinic-model.dart | 10 +- .../model/admissionRequest/ward-model.dart | 8 +- .../model/auth/activation_Code_req_model.dart | 20 +- ...on_code_for_verification_screen_model.dart | 26 +- ...on_code_for_doctor_app_response_model.dart | 68 +- .../check_activation_code_request_model.dart | 28 +- lib/core/model/auth/imei_details.dart | 42 +- lib/core/model/auth/insert_imei_model.dart | 52 +- .../new_login_information_response_model.dart | 40 +- ...on_code_for_doctor_app_response_model.dart | 8 +- .../model/calculate_box_request_model.dart | 10 +- .../get_hospitals_request_model.dart | 18 +- .../get_hospitals_response_model.dart | 6 +- lib/core/model/hospitals_model.dart | 26 +- .../model/insurance/insurance_approval.dart | 66 +- .../insurance_approval_in_patient_model.dart | 72 +- lib/core/model/labs/LabOrderResult.dart | 30 +- lib/core/model/labs/lab_result.dart | 36 +- lib/core/model/labs/patient_lab_orders.dart | 68 +- .../labs/patient_lab_special_result.dart | 8 +- .../labs/request_patient_lab_orders.dart | 26 +- .../request_patient_lab_special_result.dart | 36 +- .../labs/request_send_lab_report_email.dart | 50 +- .../medical_report/medical_file_model.dart | 258 +-- .../medical_file_request_model.dart | 6 +- lib/core/model/note/CreateNoteModel.dart | 38 +- lib/core/model/note/note_model.dart | 38 +- lib/core/model/note/update_note_model.dart | 34 +- .../patient_muse/PatientMuseResultsModel.dart | 24 +- .../PatientSearchRequestModel.dart | 24 +- lib/core/model/procedure/ControlsModel.dart | 4 +- .../model/procedure/categories_procedure.dart | 36 +- .../get_ordered_procedure_model.dart | 58 +- .../get_ordered_procedure_request_model.dart | 4 +- .../model/procedure/get_procedure_model.dart | 32 +- .../procedure/get_procedure_req_model.dart | 12 +- .../procedure/post_procedure_req_model.dart | 28 +- .../procedure_category_list_model.dart | 14 +- .../procedure/procedure_valadate_model.dart | 14 +- .../procedure_valadate_request_model.dart | 10 +- .../update_procedure_request_model.dart | 28 +- lib/core/model/radiology/final_radiology.dart | 24 +- .../request_patient_rad_orders_details.dart | 40 +- .../request_send_rad_report_email.dart | 52 +- .../referral/DischargeReferralPatient.dart | 84 +- .../referral/MyReferralPatientModel.dart | 106 +- lib/core/model/referral/ReferralRequest.dart | 48 +- .../get_medication_response_model.dart | 12 +- .../search_drug/item_by_medicine_model.dart | 42 +- .../item_by_medicine_request_model.dart | 4 +- .../model/search_drug/search_drug_model.dart | 10 +- .../search_drug_request_model.dart | 2 +- .../sick_leave/sick_leave_patient_model.dart | 66 +- .../sick_leave_patient_request_model.dart | 24 +- lib/core/provider/robot_provider.dart | 2 +- lib/core/service/authentication_service.dart | 14 +- lib/core/service/base/base_service.dart | 12 +- .../service/hospitals/hospitals_service.dart | 2 +- .../patient/DischargedPatientService.dart | 8 +- .../patient/MyReferralPatientService.dart | 6 +- .../service/patient/PatientMuseService.dart | 4 +- lib/core/service/patient/ReferralService.dart | 28 +- .../patient-doctor-referral-service.dart | 26 +- .../patient/patientInPatientService.dart | 8 +- lib/core/service/patient/patient_service.dart | 41 +- .../patient-admission-request-service.dart | 8 +- .../insurance/InsuranceCardService.dart | 12 +- .../lab_order/labs_service.dart | 46 +- .../medical_report/medical_file_service.dart | 4 +- .../prescription/medicine_service.dart | 10 +- .../prescription/prescription_service.dart | 28 +- .../prescription/prescriptions_service.dart | 46 +- .../procedure/procedure_service.dart | 14 +- .../radiology/radiology_service.dart | 20 +- .../sick_leave/sickleave_service.dart | 27 +- .../soap/SOAP_service.dart | 2 +- .../ucaf/patient-ucaf-service.dart | 2 +- .../patient-vital-signs-service.dart | 8 +- .../viewModel/DischargedPatientViewModel.dart | 22 +- lib/core/viewModel/InsuranceViewModel.dart | 24 +- lib/core/viewModel/PatientMuseViewModel.dart | 12 +- .../viewModel/PatientSearchViewModel.dart | 78 +- lib/core/viewModel/SOAP_view_model.dart | 192 +- .../viewModel/authentication_view_model.dart | 148 +- lib/core/viewModel/base_view_model.dart | 10 +- lib/core/viewModel/dashboard_view_model.dart | 24 +- .../viewModel/doctor_replay_view_model.dart | 16 +- lib/core/viewModel/hospitals_view_model.dart | 8 +- lib/core/viewModel/labs_view_model.dart | 84 +- .../viewModel/leave_rechdule_response.dart | 22 +- lib/core/viewModel/livecare_view_model.dart | 2 +- .../viewModel/medical_file_view_model.dart | 12 +- lib/core/viewModel/medicine_view_model.dart | 132 +- .../patient-admission-request-viewmodel.dart | 102 +- .../viewModel/patient-referral-viewmodel.dart | 168 +- .../viewModel/patient-ucaf-viewmodel.dart | 78 +- .../patient-vital-sign-viewmodel.dart | 28 +- lib/core/viewModel/patient_view_model.dart | 160 +- .../viewModel/prescription_view_model.dart | 132 +- .../viewModel/prescriptions_view_model.dart | 56 +- lib/core/viewModel/procedure_View_model.dart | 176 +- lib/core/viewModel/project_view_model.dart | 10 +- lib/core/viewModel/radiology_view_model.dart | 30 +- lib/core/viewModel/referral_view_model.dart | 16 +- lib/core/viewModel/referred_view_model.dart | 10 +- lib/core/viewModel/schedule_view_model.dart | 10 +- lib/core/viewModel/sick_leave_view_model.dart | 86 +- lib/icons_app/doctor_app_icons.dart | 2 +- lib/landing_page.dart | 14 +- lib/models/SOAP/Allergy_model.dart | 24 +- .../GetChiefComplaintReqModel.dart | 8 +- .../GetChiefComplaintResModel.dart | 24 +- lib/models/SOAP/GeneralGetReqForSOAP.dart | 6 +- lib/models/SOAP/GetAllergiesResModel.dart | 26 +- lib/models/SOAP/GetAssessmentReqModel.dart | 12 +- lib/models/SOAP/GetAssessmentResModel.dart | 30 +- .../SOAP/GetGetProgressNoteReqModel.dart | 12 +- .../SOAP/GetGetProgressNoteResModel.dart | 22 +- lib/models/SOAP/GetHistoryReqModel.dart | 14 +- lib/models/SOAP/GetHistoryResModel.dart | 14 +- .../SOAP/GetPhysicalExamListResModel.dart | 36 +- lib/models/SOAP/GetPhysicalExamReqModel.dart | 10 +- lib/models/SOAP/PatchAssessmentReqModel.dart | 18 +- lib/models/SOAP/PostEpisodeReqModel.dart | 8 +- .../SOAP/get_Allergies_request_model.dart | 10 +- lib/models/SOAP/master_key_model.dart | 16 +- lib/models/SOAP/my_selected_allergy.dart | 16 +- lib/models/SOAP/my_selected_assement.dart | 26 +- lib/models/SOAP/my_selected_examination.dart | 16 +- lib/models/SOAP/my_selected_history.dart | 8 +- lib/models/SOAP/order-procedure.dart | 48 +- .../SOAP/post_allergy_request_model.dart | 34 +- .../SOAP/post_assessment_request_model.dart | 24 +- .../post_chief_complaint_request_model.dart | 18 +- .../SOAP/post_histories_request_model.dart | 22 +- .../post_physical_exam_request_model.dart | 46 +- .../post_progress_note_request_model.dart | 8 +- lib/models/dashboard/dashboard_model.dart | 26 +- lib/models/doctor/clinic_model.dart | 10 +- lib/models/doctor/doctor_profile_model.dart | 54 +- ...list_doctor_working_hours_table_model.dart | 14 +- .../list_gt_my_patients_question_model.dart | 52 +- lib/models/doctor/profile_req_Model.dart | 26 +- .../request_add_referred_doctor_remarks.dart | 32 +- lib/models/doctor/request_doctor_reply.dart | 24 +- lib/models/doctor/request_schedule.dart | 28 +- .../statstics_for_certain_doctor_request.dart | 12 +- lib/models/doctor/user_model.dart | 24 +- .../verify_referral_doctor_remarks.dart | 42 +- lib/models/livecare/end_call_req.dart | 10 +- lib/models/livecare/get_panding_req_list.dart | 14 +- lib/models/livecare/get_pending_res_list.dart | 56 +- lib/models/livecare/session_status_model.dart | 8 +- lib/models/livecare/start_call_req.dart | 22 +- lib/models/livecare/start_call_res.dart | 10 +- lib/models/livecare/transfer_to_admin.dart | 12 +- lib/models/patient/PatientArrivalEntity.dart | 36 +- .../get_clinic_by_project_id_request.dart | 22 +- .../get_doctor_by_clinic_id_request.dart | 24 +- ...t_list_stp_referral_frequency_request.dart | 20 +- .../patient/get_pending_patient_er_model.dart | 58 +- .../patient/insurance_aprovals_request.dart | 26 +- .../lab_orders/lab_orders_req_model.dart | 24 +- .../lab_orders/lab_orders_res_model.dart | 38 +- lib/models/patient/lab_result/lab_result.dart | 38 +- .../lab_result/lab_result_req_model.dart | 28 +- .../patient/my_referral/PendingReferral.dart | 62 +- .../patient/my_referral/clinic-doctor.dart | 78 +- .../my_referral_patient_model.dart | 98 +- .../my_referred_patient_model.dart | 128 +- lib/models/patient/orders_request.dart | 26 +- lib/models/patient/patiant_info_model.dart | 116 +- ...et_patient_arrival_list_request_model.dart | 16 +- lib/models/patient/patient_model.dart | 86 +- .../prescription/prescription_report.dart | 52 +- .../prescription_report_for_in_patient.dart | 68 +- .../prescription/prescription_req_model.dart | 26 +- .../prescription/prescription_res_model.dart | 66 +- .../request_prescription_report.dart | 28 +- lib/models/patient/progress_note_request.dart | 26 +- .../radiology/radiology_req_model.dart | 24 +- .../radiology/radiology_res_model.dart | 28 +- ...st_prescription_report_for_in_patient.dart | 26 +- .../patient/refer_to_doctor_request.dart | 80 +- .../request_my_referral_patient_model.dart | 40 +- .../patient/topten_users_res_model.dart | 6 +- .../vital_sign/patient-vital-sign-data.dart | 52 +- .../patient-vital-sign-history.dart | 4 +- .../vital_sign/vital_sign_req_model.dart | 28 +- .../vital_sign/vital_sign_res_model.dart | 6 +- .../pharmacies_List_request_model.dart | 22 +- .../pharmacies_items_request_model.dart | 24 +- .../sickleave/add_sickleave_request.dart | 10 +- .../sickleave/extend_sick_leave_request.dart | 8 +- .../sickleave/get_all_sickleave_response.dart | 18 +- lib/screens/auth/login_screen.dart | 66 +- .../auth/verification_methods_screen.dart | 98 +- lib/screens/base/base_view.dart | 16 +- lib/screens/doctor/doctor_repaly_chat.dart | 20 +- lib/screens/doctor/doctor_reply_screen.dart | 10 +- .../doctor/my_referral_patient_screen.dart | 4 +- lib/screens/doctor/my_schedule_screen.dart | 75 +- .../doctor/patient_arrival_screen.dart | 10 +- .../home/dashboard_slider-item-widget.dart | 4 +- lib/screens/home/dashboard_swipe_widget.dart | 36 +- lib/screens/home/home_page_card.dart | 14 +- lib/screens/home/home_patient_card.dart | 16 +- lib/screens/home/home_screen.dart | 34 +- lib/screens/live_care/panding_list.dart | 22 +- lib/screens/live_care/video_call.dart | 20 +- .../medical-file/health_summary_page.dart | 116 +- .../medical-file/medical_file_details.dart | 358 ++-- .../medicine/medicine_search_screen.dart | 28 +- .../medicine/pharmacies_list_screen.dart | 20 +- .../patients/DischargedPatientPage.dart | 21 +- lib/screens/patients/ECGPage.dart | 16 +- lib/screens/patients/InPatientPage.dart | 10 +- .../patients/PatientsInPatientScreen.dart | 16 +- .../ReferralDischargedPatientDetails.dart | 18 +- .../ReferralDischargedPatientPage.dart | 4 +- .../insurance_approval_screen_patient.dart | 44 +- .../patients/insurance_approvals_details.dart | 180 +- .../out_patient/filter_date_page.dart | 62 +- .../out_patient/out_patient_screen.dart | 42 +- ...t_patient_prescription_details_screen.dart | 14 +- .../patient_search/patient_search_header.dart | 4 +- .../patient_search_result_screen.dart | 35 +- .../patient_search/patient_search_screen.dart | 12 +- .../patients/patient_search/time_bar.dart | 26 +- .../profile/UCAF/UCAF-detail-screen.dart | 64 +- .../profile/UCAF/UCAF-input-screen.dart | 30 +- .../profile/UCAF/page-stepper-widget.dart | 16 +- .../admission-request-detail-screen.dart | 36 +- .../admission-request-first-screen.dart | 108 +- .../admission-request-third-screen.dart | 50 +- .../admission-request_second-screen.dart | 131 +- .../profile/in_patient_profile_screen.dart | 56 +- .../profile/lab_result/FlowChartPage.dart | 10 +- .../profile/lab_result/LabResultWidget.dart | 42 +- .../Lab_Result_details_wideget.dart | 10 +- .../profile/lab_result/LineChartCurved.dart | 40 +- .../lab_result_chart_and_detials.dart | 10 +- .../lab_result/lab_result_secreen.dart | 22 +- .../lab_result/laboratory_result_page.dart | 36 +- .../lab_result/laboratory_result_widget.dart | 24 +- .../profile/lab_result/labs_home_page.dart | 54 +- .../AddVerifyMedicalReport.dart | 18 +- .../MedicalReportDetailPage.dart | 20 +- .../medical_report/MedicalReportPage.dart | 6 +- .../profile/note/progress_note_screen.dart | 66 +- .../patients/profile/note/update_note.dart | 112 +- ...n_patient_prescription_details_screen.dart | 42 +- ...out_patient_prescription_details_item.dart | 14 +- .../PatientProfileCardModel.dart | 10 +- .../patient_profile_screen.dart | 66 +- .../profile_gird_for_InPatient.dart | 74 +- .../profile_gird_for_other.dart | 74 +- .../profile_gird_for_search.dart | 74 +- .../radiology/radiology_details_page.dart | 40 +- .../radiology/radiology_home_page.dart | 54 +- .../radiology/radiology_report_screen.dart | 12 +- .../referral/AddReplayOnReferralPatient.dart | 20 +- .../referral/my-referral-detail-screen.dart | 84 +- .../my-referral-inpatient-screen.dart | 6 +- .../referral/my-referral-patient-screen.dart | 12 +- .../referral/patient_referral_screen.dart | 16 +- .../refer-patient-screen-in-patient.dart | 106 +- .../referral/refer-patient-screen.dart | 99 +- .../referral_patient_detail_in-paint.dart | 32 +- .../referral/referred-patient-screen.dart | 6 +- .../referred_patient_detail_in-paint.dart | 42 +- .../assessment/add_assessment_details.dart | 153 +- .../assessment/update_assessment_page.dart | 84 +- .../objective/add_examination_page.dart | 22 +- .../objective/add_examination_widget.dart | 46 +- .../objective/examination_item_card.dart | 28 +- .../examinations_list_search_widget.dart | 27 +- .../objective/update_objective_page.dart | 88 +- .../soap_update/plan/update_plan_page.dart | 84 +- .../shared_soap_widgets/SOAP_open_items.dart | 10 +- .../shared_soap_widgets/SOAP_step_header.dart | 10 +- .../bottom_sheet_title.dart | 4 +- .../expandable_SOAP_widget.dart | 18 +- .../shared_soap_widgets/steps_widget.dart | 66 +- .../subjective/allergies/add_allergies.dart | 46 +- .../allergies/update_allergies_widget.dart | 40 +- .../update_Chief_complaints.dart | 22 +- .../history/add_history_dialog.dart | 48 +- .../subjective/history/priority_bar.dart | 6 +- .../history/update_history_widget.dart | 34 +- .../subjective/medication/add_medication.dart | 107 +- .../medication/update_medication_widget.dart | 6 +- .../subjective/update_subjective_page.dart | 156 +- .../soap_update/update_soap_index.dart | 20 +- .../profile/vital_sign/LineChartCurved.dart | 60 +- .../LineChartCurvedBloodPressure.dart | 76 +- .../vital_sign/vital-signs-screen.dart | 124 +- .../vital_sign_detail_pain_scale.dart | 28 +- ...al_sign_details_blood_pressurewideget.dart | 26 +- .../vital_sign/vital_sign_details_screen.dart | 86 +- .../vital_sign_details_wideget.dart | 20 +- .../profile/vital_sign/vital_sign_item.dart | 14 +- .../vital_sign_item_details_screen.dart | 20 +- .../vital_sing_chart_and_detials.dart | 36 +- .../vital_sing_chart_blood_pressure.dart | 34 +- .../prescription/add_prescription_form.dart | 198 +- lib/screens/prescription/drugtodrug.dart | 20 +- .../prescription_details_page.dart | 36 +- .../prescription_item_in_patient_page.dart | 66 +- .../prescription/prescription_items_page.dart | 54 +- .../prescription/prescription_screen.dart | 90 +- .../prescription_screen_history.dart | 54 +- .../prescription/prescriptions_page.dart | 32 +- .../update_prescription_form.dart | 208 +- lib/screens/procedures/ProcedureCard.dart | 38 +- .../procedures/add-procedure-form.dart | 54 +- lib/screens/procedures/add_lab_orders.dart | 50 +- .../procedures/add_radiology_order.dart | 50 +- .../entity_list_checkbox_search_widget.dart | 64 +- .../entity_list_procedure_widget.dart | 50 +- lib/screens/procedures/procedure_screen.dart | 56 +- lib/screens/procedures/update-procedure.dart | 96 +- lib/screens/qr_reader/QR_reader_screen.dart | 18 +- .../add-rescheduleleave.dart | 30 +- .../reschedule-leaves/reschedule_leave.dart | 83 +- lib/screens/sick-leave/add-sickleave.dart | 50 +- lib/screens/sick-leave/show-sickleave.dart | 26 +- lib/screens/sick-leave/sick_leave.dart | 57 +- lib/util/VideoChannel.dart | 8 +- lib/util/date-utils.dart | 22 +- lib/util/extenstions.dart | 4 +- lib/util/helpers.dart | 20 +- lib/util/translations_delegate_base.dart | 1800 ++++++++--------- lib/widgets/auth/method_type_card.dart | 12 +- lib/widgets/auth/sms-popup.dart | 26 +- .../auth/verification_methods_list.dart | 42 +- lib/widgets/charts/app_bar_chart.dart | 43 - lib/widgets/charts/app_line_chart.dart | 8 +- lib/widgets/charts/app_time_series_chart.dart | 12 +- .../dashboard_item_texts_widget.dart | 2 +- lib/widgets/dashboard/guage_chart.dart | 14 +- lib/widgets/dashboard/out_patient_stack.dart | 8 +- lib/widgets/dashboard/row_count.dart | 2 +- .../data_display/list/custom_Item.dart | 22 +- .../data_display/list/flexible_container.dart | 6 +- lib/widgets/doctor/doctor_reply_widget.dart | 36 +- lib/widgets/doctor/lab_result_widget.dart | 14 +- .../doctor/my_referral_patient_widget.dart | 64 +- lib/widgets/doctor/my_schedule_widget.dart | 22 +- .../medicine/medicine_item_widget.dart | 8 +- lib/widgets/patients/PatientCard.dart | 130 +- .../patients/clinic_list_dropdwon.dart | 16 +- lib/widgets/patients/dynamic_elements.dart | 12 +- .../patient-referral-item-widget.dart | 50 +- .../profile/PatientHeaderWidgetNoAvatar.dart | 2 +- .../profile/PatientProfileButton.dart | 28 +- .../profile/Profile_general_info_Widget.dart | 14 +- .../profile/add-order/addNewOrder.dart | 8 +- .../patients/profile/large_avatar.dart | 18 +- .../profile/patient-page-header-widget.dart | 14 +- ...ent-profile-header-new-design-app-bar.dart | 98 +- .../patient-profile-header-new-design.dart | 64 +- ...-profile-header-new-design_in_patient.dart | 24 +- ..._profile_header_with_appointment_card.dart | 92 +- ..._header_with_appointment_card_app_bar.dart | 92 +- .../prescription_in_patinets_widget.dart | 24 +- .../prescription_out_patinets_widget.dart | 26 +- .../profile/profile-welcome-widget.dart | 2 +- .../profile_general_info_content_widget.dart | 4 +- .../profile/profile_header_widget.dart | 8 +- .../profile/profile_medical_info_widget.dart | 76 +- ...rofile_medical_info_widget_in_patient.dart | 50 +- .../profile_medical_info_widget_search.dart | 126 +- .../profile/profile_status_info_widget.dart | 6 +- .../patients/vital_sign_details_wideget.dart | 18 +- lib/widgets/shared/StarRating.dart | 2 +- lib/widgets/shared/TextFields.dart | 72 +- lib/widgets/shared/app_drawer_widget.dart | 18 +- .../shared/app_expandable_notifier.dart | 8 +- .../shared/app_expandable_notifier_new.dart | 12 +- lib/widgets/shared/app_loader_widget.dart | 6 +- lib/widgets/shared/app_scaffold_widget.dart | 22 +- lib/widgets/shared/app_texts_widget.dart | 62 +- lib/widgets/shared/bottom_nav_bar.dart | 16 +- .../shared/bottom_navigation_item.dart | 16 +- .../shared/buttons/app_buttons_widget.dart | 16 +- .../shared/buttons/button_bottom_sheet.dart | 12 +- .../shared/buttons/secondary_button.dart | 28 +- .../shared/card_with_bgNew_widget.dart | 2 +- lib/widgets/shared/card_with_bg_widget.dart | 4 +- lib/widgets/shared/charts/app_line_chart.dart | 6 +- .../shared/charts/app_time_series_chart.dart | 121 -- .../shared/dialogs/ShowImageDialog.dart | 6 +- .../shared/dialogs/dailog-list-select.dart | 38 +- .../shared/dialogs/master_key_dailog.dart | 24 +- .../dialogs/search-drugs-dailog-list.dart | 14 +- .../shared/divider_with_spaces_around.dart | 2 +- lib/widgets/shared/doctor_card.dart | 30 +- lib/widgets/shared/doctor_card_insurance.dart | 32 +- .../dr_app_circular_progress_Indeicator.dart | 2 +- lib/widgets/shared/drawer_item_widget.dart | 10 +- .../shared/errors/dr_app_embedded_error.dart | 6 +- lib/widgets/shared/errors/error_message.dart | 6 +- .../shared/expandable-widget-header-body.dart | 12 +- .../shared/loader/gif_loader_container.dart | 4 +- ..._key_checkbox_search_allergies_widget.dart | 95 +- .../master_key_checkbox_search_widget.dart | 53 +- lib/widgets/shared/network_base_view.dart | 10 +- lib/widgets/shared/profile_image_widget.dart | 14 +- .../shared/rounded_container_widget.dart | 8 +- lib/widgets/shared/speech-text-popup.dart | 18 +- .../text_fields/app-textfield-custom.dart | 28 +- .../text_fields/app_text_form_field.dart | 28 +- .../text_fields/auto_complete_text_field.dart | 12 +- .../shared/text_fields/html_rich_editor.dart | 50 + .../shared/text_fields/new_text_Field.dart | 56 +- .../shared/text_fields/text_field_error.dart | 6 +- .../shared/text_fields/text_fields_utils.dart | 4 +- .../app_anchored_overlay_widget.dart | 34 +- .../shared/user-guid/app_get_position.dart | 12 +- .../shared/user-guid/app_shape_painter.dart | 10 +- .../shared/user-guid/app_showcase.dart | 80 +- .../shared/user-guid/app_showcase_widget.dart | 30 +- .../shared/user-guid/app_tool_tip_widget.dart | 100 +- .../user-guid/custom_validation_error.dart | 6 +- .../user-guid/in_patient_doctor_card.dart | 20 +- lib/widgets/transitions/fade_page.dart | 4 +- lib/widgets/transitions/slide_up_page.dart | 4 +- pubspec.lock | 1102 ---------- pubspec.yaml | 9 +- 453 files changed, 9178 insertions(+), 10713 deletions(-) delete mode 100644 ios/Podfile.lock delete mode 100644 lib/widgets/charts/app_bar_chart.dart delete mode 100644 lib/widgets/shared/charts/app_time_series_chart.dart create mode 100644 lib/widgets/shared/text_fields/html_rich_editor.dart delete mode 100644 pubspec.lock diff --git a/ios/Podfile b/ios/Podfile index bebf8f5b..14f8bd58 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -53,12 +53,7 @@ target 'Runner' do generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; - unless File.exist?(copied_framework_path) - FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) - end - unless File.exist?(copied_podspec_path) - FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) - end + end # Keep pod path relative so it can be checked into Podfile.lock. diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 2f4607e0..00000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,325 +0,0 @@ -PODS: - - Alamofire (4.9.1) - - barcode_scan (0.0.1): - - Flutter - - MTBBarcodeScanner - - SwiftProtobuf - - connectivity (0.0.1): - - Flutter - - Reachability - - connectivity_for_web (0.1.0): - - Flutter - - connectivity_macos (0.0.1): - - Flutter - - device_info (0.0.1): - - Flutter - - Firebase/CoreOnly (6.33.0): - - FirebaseCore (= 6.10.3) - - Firebase/Messaging (6.33.0): - - Firebase/CoreOnly - - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.3): - - Firebase/CoreOnly (~> 6.33.0) - - Flutter - - firebase_core_web (0.1.0): - - Flutter - - firebase_messaging (7.0.3): - - Firebase/CoreOnly (~> 6.33.0) - - Firebase/Messaging (~> 6.33.0) - - firebase_core - - Flutter - - FirebaseCore (6.10.3): - - FirebaseCoreDiagnostics (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - FirebaseCoreDiagnostics (1.7.0): - - GoogleDataTransport (~> 7.4) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - nanopb (~> 1.30906.0) - - FirebaseInstallations (1.7.0): - - FirebaseCore (~> 6.10) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - PromisesObjC (~> 1.2) - - FirebaseInstanceID (4.8.0): - - FirebaseCore (~> 6.10) - - FirebaseInstallations (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - FirebaseMessaging (4.7.1): - - FirebaseCore (~> 6.10) - - FirebaseInstanceID (~> 4.7) - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Reachability (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - Protobuf (>= 3.9.2, ~> 3.9) - - Flutter (1.0.0) - - flutter_flexible_toast (0.0.1): - - Flutter - - flutter_plugin_android_lifecycle (0.0.1): - - Flutter - - GoogleDataTransport (7.5.1): - - nanopb (~> 1.30906.0) - - GoogleUtilities/AppDelegateSwizzler (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Environment (6.7.2): - - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Network (6.7.2): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.7.2)" - - GoogleUtilities/Reachability (6.7.2): - - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.7.2): - - GoogleUtilities/Logger - - hexcolor (0.0.1): - - Flutter - - imei_plugin (0.0.1): - - Flutter - - local_auth (0.0.1): - - Flutter - - maps_launcher (0.0.1): - - Flutter - - MTBBarcodeScanner (5.0.11) - - nanopb (1.30906.0): - - nanopb/decode (= 1.30906.0) - - nanopb/encode (= 1.30906.0) - - nanopb/decode (1.30906.0) - - nanopb/encode (1.30906.0) - - OpenTok (2.15.3) - - path_provider_linux (0.0.1): - - Flutter - - path_provider_windows (0.0.1): - - Flutter - - "permission_handler (5.1.0+2)": - - Flutter - - PromisesObjC (1.2.11) - - Protobuf (3.13.0) - - Reachability (3.2) - - screen (0.0.1): - - Flutter - - shared_preferences (0.0.1): - - Flutter - - shared_preferences_linux (0.0.1): - - Flutter - - shared_preferences_macos (0.0.1): - - Flutter - - shared_preferences_web (0.0.1): - - Flutter - - shared_preferences_windows (0.0.1): - - Flutter - - speech_to_text (0.0.1): - - Flutter - - Try - - SwiftProtobuf (1.9.0) - - Try (2.1.1) - - url_launcher (0.0.1): - - Flutter - - url_launcher_linux (0.0.1): - - Flutter - - url_launcher_macos (0.0.1): - - Flutter - - url_launcher_web (0.0.1): - - Flutter - - url_launcher_windows (0.0.1): - - Flutter - - video_player (0.0.1): - - Flutter - - video_player_web (0.0.1): - - Flutter - - wakelock (0.0.1): - - Flutter - - webview_flutter (0.0.1): - - Flutter - -DEPENDENCIES: - - Alamofire - - barcode_scan (from `.symlinks/plugins/barcode_scan/ios`) - - connectivity (from `.symlinks/plugins/connectivity/ios`) - - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - - device_info (from `.symlinks/plugins/device_info/ios`) - - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - - Flutter (from `Flutter`) - - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) - - hexcolor (from `.symlinks/plugins/hexcolor/ios`) - - imei_plugin (from `.symlinks/plugins/imei_plugin/ios`) - - local_auth (from `.symlinks/plugins/local_auth/ios`) - - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) - - OpenTok - - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) - - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - - screen (from `.symlinks/plugins/screen/ios`) - - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) - - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) - - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) - - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) - - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) - - video_player (from `.symlinks/plugins/video_player/ios`) - - video_player_web (from `.symlinks/plugins/video_player_web/ios`) - - wakelock (from `.symlinks/plugins/wakelock/ios`) - - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) - -SPEC REPOS: - trunk: - - Alamofire - - Firebase - - FirebaseCore - - FirebaseCoreDiagnostics - - FirebaseInstallations - - FirebaseInstanceID - - FirebaseMessaging - - GoogleDataTransport - - GoogleUtilities - - MTBBarcodeScanner - - nanopb - - OpenTok - - PromisesObjC - - Protobuf - - Reachability - - SwiftProtobuf - - Try - -EXTERNAL SOURCES: - barcode_scan: - :path: ".symlinks/plugins/barcode_scan/ios" - connectivity: - :path: ".symlinks/plugins/connectivity/ios" - connectivity_for_web: - :path: ".symlinks/plugins/connectivity_for_web/ios" - connectivity_macos: - :path: ".symlinks/plugins/connectivity_macos/ios" - device_info: - :path: ".symlinks/plugins/device_info/ios" - firebase_core: - :path: ".symlinks/plugins/firebase_core/ios" - firebase_core_web: - :path: ".symlinks/plugins/firebase_core_web/ios" - firebase_messaging: - :path: ".symlinks/plugins/firebase_messaging/ios" - Flutter: - :path: Flutter - flutter_flexible_toast: - :path: ".symlinks/plugins/flutter_flexible_toast/ios" - flutter_plugin_android_lifecycle: - :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" - hexcolor: - :path: ".symlinks/plugins/hexcolor/ios" - imei_plugin: - :path: ".symlinks/plugins/imei_plugin/ios" - local_auth: - :path: ".symlinks/plugins/local_auth/ios" - maps_launcher: - :path: ".symlinks/plugins/maps_launcher/ios" - path_provider_linux: - :path: ".symlinks/plugins/path_provider_linux/ios" - path_provider_windows: - :path: ".symlinks/plugins/path_provider_windows/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" - screen: - :path: ".symlinks/plugins/screen/ios" - shared_preferences: - :path: ".symlinks/plugins/shared_preferences/ios" - shared_preferences_linux: - :path: ".symlinks/plugins/shared_preferences_linux/ios" - shared_preferences_macos: - :path: ".symlinks/plugins/shared_preferences_macos/ios" - shared_preferences_web: - :path: ".symlinks/plugins/shared_preferences_web/ios" - shared_preferences_windows: - :path: ".symlinks/plugins/shared_preferences_windows/ios" - speech_to_text: - :path: ".symlinks/plugins/speech_to_text/ios" - url_launcher: - :path: ".symlinks/plugins/url_launcher/ios" - url_launcher_linux: - :path: ".symlinks/plugins/url_launcher_linux/ios" - url_launcher_macos: - :path: ".symlinks/plugins/url_launcher_macos/ios" - url_launcher_web: - :path: ".symlinks/plugins/url_launcher_web/ios" - url_launcher_windows: - :path: ".symlinks/plugins/url_launcher_windows/ios" - video_player: - :path: ".symlinks/plugins/video_player/ios" - video_player_web: - :path: ".symlinks/plugins/video_player_web/ios" - wakelock: - :path: ".symlinks/plugins/wakelock/ios" - webview_flutter: - :path: ".symlinks/plugins/webview_flutter/ios" - -SPEC CHECKSUMS: - Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 - barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479 - connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 - connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b - connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 - device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 - Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 - firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 - firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 - FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd - FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 - FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 - FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 - FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 - flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 - GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 - imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd - local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd - maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 - MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb - nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc - OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 - path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 - path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 - PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f - Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 - Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 - shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d - shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 - shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 - shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 - shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae - speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe - SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932 - Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 - url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef - url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 - url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 - url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c - url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 - video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e - video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 - wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 - webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 - -PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 - -COCOAPODS: 1.10.0.rc.1 diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16..919434a6 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index 16284ed1..53024316 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -10,11 +10,11 @@ import 'package:url_launcher/url_launcher.dart'; import 'widgets/shared/buttons/secondary_button.dart'; class UpdatePage extends StatelessWidget { - final String message; - final String androidLink; - final String iosLink; + final String? message; + final String? androidLink; + final String? iosLink; - const UpdatePage({Key key, this.message, this.androidLink, this.iosLink}) + const UpdatePage({Key? key, this.message, this.androidLink, this.iosLink}) : super(key: key); @override @@ -35,7 +35,7 @@ class UpdatePage extends StatelessWidget { Image.asset('assets/images/HMG_logo.png'), SizedBox(height: 8,), AppText( - TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17, + TranslationBase.of(context)!.updateTheApp!.toUpperCase(),fontSize: 17, fontWeight: FontWeight.w600, ), SizedBox(height: 12,), @@ -55,11 +55,11 @@ class UpdatePage extends StatelessWidget { color: Colors.red[800], onTap: () { if (Platform.isIOS) - launch(iosLink); + launch(iosLink!); else - launch(androidLink); + launch(androidLink!); }, - label: TranslationBase.of(context).updateNow.toUpperCase(), + label: TranslationBase.of(context)!.updateNow!.toUpperCase(), ), ), ), diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 42e3ef87..3c74c413 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -18,9 +18,9 @@ Helpers helpers = new Helpers(); class BaseAppClient { //TODO change the post fun to nun static when you change all service post(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, + {required Map body, + Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, bool isAllowAny = false}) async { String url = BASE_URL + endPoint; @@ -29,7 +29,7 @@ class BaseAppClient { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); if (profile != null) { - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile as Map); if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; @@ -91,7 +91,7 @@ class BaseAppClient { }); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { - onFailure(Helpers.generateContactAdminMsg(), statusCode); + onFailure!(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { @@ -101,37 +101,37 @@ class BaseAppClient { if (!parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { - onFailure(getError(parsed), statusCode); + onFailure!(getError(parsed), statusCode); } else if (!isAllowAny) { await Provider.of(AppGlobal.CONTEX, listen: false).logout(isSessionTimeout: true); Helpers.showErrorToast('Your session expired Please login again'); } if (isAllowAny) { - onFailure(getError(parsed), statusCode); + onFailure!(getError(parsed), statusCode); } } else if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) - onFailure(getError(parsed), statusCode); + onFailure!(getError(parsed), statusCode); else - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { - onFailure(getError(parsed), statusCode); + onFailure!(getError(parsed), statusCode); } } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); } } catch (e) { print(e); - onFailure(e.toString(), -1); + onFailure!(e.toString(), -1); } } postPatient(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - @required PatiantInformtion patient, + {required Map body, + Function(dynamic response, int statusCode)? onSuccess, + Function(String? error, int statusCode)? onFailure, + required PatiantInformtion? patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; @@ -178,7 +178,7 @@ class BaseAppClient { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null ? body['PatientType'] - : patient.patientType != null + : patient!.patientType != null ? patient.patientType : PATIENT_TYPE : PATIENT_TYPE; @@ -186,7 +186,7 @@ class BaseAppClient { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] - : patient.patientType != null + : patient!.patientType != null ? patient.patientType : PATIENT_TYPE_ID : PATIENT_TYPE_ID; @@ -194,7 +194,7 @@ class BaseAppClient { body['TokenID'] = token; body['PatientID'] = body['PatientID'] != null ? body['PatientID'] - : patient.patientId ?? patient.patientMRN; + : patient!.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -214,12 +214,12 @@ class BaseAppClient { final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); + onFailure!('Error While Fetching data', statusCode); } else { // var parsed = json.decode(response.body.toString()); var parsed = json.decode(utf8.decode(response.bodyBytes)); if (parsed['Response_Message'] != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], @@ -227,36 +227,36 @@ class BaseAppClient { } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['MessageStatus'] == 1) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['Result'] == 'OK') { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { - onFailure(getError(parsed), statusCode); + onFailure!(getError(parsed), statusCode); } } } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", + onFailure!("Server Error found with no available message", statusCode); } else { - onFailure(parsed['ErrorSearchMsg'], statusCode); + onFailure!(parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure( + onFailure!( parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], @@ -265,12 +265,12 @@ class BaseAppClient { } } else { if (parsed['SameClinicApptList'] != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure(parsed['message'] ?? parsed['message'], statusCode); + onFailure!(parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure( + onFailure!( parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } @@ -279,17 +279,17 @@ class BaseAppClient { } } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); } } catch (e) { print(e); - onFailure(e.toString(), -1); + onFailure!(e.toString(), -1); } } String getError(parsed) { //TODO change this fun - String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; + String? error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; if (parsed["ValidationErrors"] != null) { error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; @@ -298,7 +298,7 @@ class BaseAppClient { for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { - error = error + + error = error! + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; } diff --git a/lib/config/config.dart b/lib/config/config.dart index 852e7bab..e0f22fac 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -350,6 +350,6 @@ const PATIENT_TYPE_ID = 1; const TIMER_MIN = 10; class AppGlobal { - static var CONTEX; + static late var CONTEX; static Color appPrimaryColor = Color(0xFFB9382C); } diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 6b996b3f..5d0720a9 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -5,14 +5,14 @@ class SizeConfig { static double _blockWidth = 0; static double _blockHeight = 0; - static double realScreenWidth; - static double realScreenHeight; - static double screenWidth; - static double screenHeight; - static double textMultiplier; - static double imageSizeMultiplier; - static double heightMultiplier; - static double widthMultiplier; + static double? realScreenWidth; + static double? realScreenHeight; + static double? screenWidth; + static double? screenHeight; + static late double textMultiplier; + static late double imageSizeMultiplier; + static late double heightMultiplier; + static late double widthMultiplier; static bool isPortrait = true; static bool isMobilePortrait = false; @@ -28,7 +28,7 @@ class SizeConfig { } if (orientation == Orientation.portrait) { isPortrait = true; - if (realScreenWidth < 450) { + if (realScreenWidth! < 450) { isMobilePortrait = true; } // textMultiplier = _blockHeight; @@ -43,8 +43,8 @@ class SizeConfig { screenHeight = realScreenWidth; screenWidth = realScreenHeight; } - _blockWidth = screenWidth / 100; - _blockHeight = screenHeight / 100; + _blockWidth = screenWidth! / 100; + _blockHeight = screenHeight! / 100; textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; diff --git a/lib/core/enum/auth_method_types.dart b/lib/core/enum/auth_method_types.dart index 82577eeb..572a36f1 100644 --- a/lib/core/enum/auth_method_types.dart +++ b/lib/core/enum/auth_method_types.dart @@ -1,5 +1,5 @@ enum AuthMethodTypes { SMS, WhatsApp, Fingerprint,FaceID,MoreOptions } -extension SelectedAuthMethodTypesService on AuthMethodTypes { +extension SelectedAuthMethodTypesService on AuthMethodTypes? { // ignore: missing_return int getTypeIdService() { switch (this) { @@ -18,12 +18,14 @@ extension SelectedAuthMethodTypesService on AuthMethodTypes { case AuthMethodTypes.MoreOptions: return 5; break; + default: return 1; + } } // ignore: missing_return - static getMethodsTypeService( int typeId) { + static getMethodsTypeService( int? typeId) { switch (typeId) { case 1: return AuthMethodTypes.SMS; diff --git a/lib/core/insurance_approval_request_model.dart b/lib/core/insurance_approval_request_model.dart index 02f71ecb..11f7804e 100644 --- a/lib/core/insurance_approval_request_model.dart +++ b/lib/core/insurance_approval_request_model.dart @@ -1,17 +1,17 @@ class InsuranceApprovalInPatientRequestModel { - int patientID; - int patientTypeID; - int eXuldAPPNO; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? patientTypeID; + int? eXuldAPPNO; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; InsuranceApprovalInPatientRequestModel( {this.patientID, diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart index c47a813a..952e7f69 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class Prescriptions { - String setupID; - int projectID; - int patientID; - int appointmentNo; - String appointmentDate; - String doctorName; - String clinicDescription; - String name; - int episodeID; - int actualDoctorRate; - int admission; - int clinicID; - String companyName; - String despensedStatus; - DateTime dischargeDate; - int dischargeNo; - int doctorID; - String doctorImageURL; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - bool isLiveCareAppointment; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isInsurancePatient; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - List speciality; + String? setupID; + int? projectID; + int? patientID; + int? appointmentNo; + String? appointmentDate; + String? doctorName; + String? clinicDescription; + String? name; + int? episodeID; + int? actualDoctorRate; + int? admission; + int? clinicID; + String? companyName; + String? despensedStatus; + DateTime? dischargeDate; + int? dischargeNo; + int? doctorID; + String? doctorImageURL; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + bool? isLiveCareAppointment; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isInsurancePatient; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + List? speciality; Prescriptions( {this.setupID, @@ -149,10 +149,10 @@ class Prescriptions { } class PrescriptionsList { - String filterName = ""; - List prescriptionsList = List(); + String? filterName = ""; + List prescriptionsList = []; - PrescriptionsList({this.filterName, Prescriptions prescriptions}) { + PrescriptionsList({this.filterName, Prescriptions? prescriptions}) { prescriptionsList.add(prescriptions); } } diff --git a/lib/core/model/Prescriptions/in_patient_prescription_model.dart b/lib/core/model/Prescriptions/in_patient_prescription_model.dart index f6e88bf7..3f67e659 100644 --- a/lib/core/model/Prescriptions/in_patient_prescription_model.dart +++ b/lib/core/model/Prescriptions/in_patient_prescription_model.dart @@ -1,5 +1,5 @@ class InPatientPrescriptionRequestModel { - String vidaAuthTokenID; + String? vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/perscription_pharmacy.dart b/lib/core/model/Prescriptions/perscription_pharmacy.dart index 3adaef7e..54809e1c 100644 --- a/lib/core/model/Prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/Prescriptions/perscription_pharmacy.dart @@ -1,27 +1,27 @@ class PharmacyPrescriptions { - String expiryDate; + String? expiryDate; dynamic sellingPrice; - int quantity; - int itemID; - int locationID; - int projectID; - String setupID; - String locationDescription; + int? quantity; + int? itemID; + int? locationID; + int? projectID; + String? setupID; + String? locationDescription; Null locationDescriptionN; - String itemDescription; + String? itemDescription; Null itemDescriptionN; - String alias; - int locationTypeID; - int barcode; + String? alias; + int? locationTypeID; + int? barcode; Null companybarcode; - int cityID; - String cityName; - int distanceInKilometers; - String latitude; - int locationType; - String longitude; - String phoneNumber; - String projectImageURL; + int? cityID; + String? cityName; + int? distanceInKilometers; + String? latitude; + int? locationType; + String? longitude; + String? phoneNumber; + String? projectImageURL; Null sortOrder; PharmacyPrescriptions( diff --git a/lib/core/model/Prescriptions/post_prescrition_req_model.dart b/lib/core/model/Prescriptions/post_prescrition_req_model.dart index 06a524ed..43bcb09a 100644 --- a/lib/core/model/Prescriptions/post_prescrition_req_model.dart +++ b/lib/core/model/Prescriptions/post_prescrition_req_model.dart @@ -1,10 +1,10 @@ class PostPrescriptionReqModel { - String vidaAuthTokenID; - int clinicID; - int episodeID; - int appointmentNo; - int patientMRN; - List prescriptionRequestModel; + String? vidaAuthTokenID; + int? clinicID; + int? episodeID; + int? appointmentNo; + int? patientMRN; + List? prescriptionRequestModel; PostPrescriptionReqModel( {this.vidaAuthTokenID, @@ -21,9 +21,9 @@ class PostPrescriptionReqModel { appointmentNo = json['AppointmentNo']; patientMRN = json['PatientMRN']; if (json['prescriptionRequestModel'] != null) { - prescriptionRequestModel = new List(); + prescriptionRequestModel = []; json['prescriptionRequestModel'].forEach((v) { - prescriptionRequestModel.add(new PrescriptionRequestModel.fromJson(v)); + prescriptionRequestModel!.add(new PrescriptionRequestModel.fromJson(v)); }); } } @@ -37,25 +37,25 @@ class PostPrescriptionReqModel { data['PatientMRN'] = this.patientMRN; if (this.prescriptionRequestModel != null) { data['prescriptionRequestModel'] = - this.prescriptionRequestModel.map((v) => v.toJson()).toList(); + this.prescriptionRequestModel!.map((v) => v.toJson()).toList(); } return data; } } class PrescriptionRequestModel { - int itemId; - String doseStartDate; - int duration; - double dose; - int doseUnitId; - int route; - int frequency; - int doseTime; - bool covered; - bool approvalRequired; - String remarks; - String icdcode10Id; + int? itemId; + String? doseStartDate; + int? duration; + double? dose; + int? doseUnitId; + int? route; + int? frequency; + int? doseTime; + bool? covered; + bool? approvalRequired; + String? remarks; + String? icdcode10Id; PrescriptionRequestModel({ this.itemId, diff --git a/lib/core/model/Prescriptions/prescription_in_patient.dart b/lib/core/model/Prescriptions/prescription_in_patient.dart index c66bc8a4..bbb2b756 100644 --- a/lib/core/model/Prescriptions/prescription_in_patient.dart +++ b/lib/core/model/Prescriptions/prescription_in_patient.dart @@ -1,50 +1,50 @@ class PrescriotionInPatient { - int admissionNo; - int authorizedBy; + int? admissionNo; + int? authorizedBy; dynamic bedNo; - String comments; - int createdBy; - String createdByName; + String? comments; + int? createdBy; + String? createdByName; dynamic createdByNameN; - String createdOn; - String direction; - int directionID; + String? createdOn; + String? direction; + int? directionID; dynamic directionN; - String dose; - int editedBy; + String? dose; + int? editedBy; dynamic iVDiluentLine; - int iVDiluentType; + int? iVDiluentType; dynamic iVDiluentVolume; dynamic iVRate; dynamic iVStability; - String itemDescription; - int itemID; - int lineItemNo; - int locationId; - int noOfDoses; - int orderNo; - int patientID; - String pharmacyRemarks; - String prescriptionDatetime; - int prescriptionNo; - String processedBy; - int projectID; - int refillID; - String refillType; + String? itemDescription; + int? itemID; + int? lineItemNo; + int? locationId; + int? noOfDoses; + int? orderNo; + int? patientID; + String? pharmacyRemarks; + String? prescriptionDatetime; + int? prescriptionNo; + String? processedBy; + int? projectID; + int? refillID; + String? refillType; dynamic refillTypeN; - int reviewedPharmacist; + int? reviewedPharmacist; dynamic roomId; - String route; - int routeId; + String? route; + int? routeId; dynamic routeN; dynamic setupID; - String startDatetime; - int status; - String statusDescription; + String? startDatetime; + int? status; + String? statusDescription; dynamic statusDescriptionN; - String stopDatetime; - int unitofMeasurement; - String unitofMeasurementDescription; + String? stopDatetime; + int? unitofMeasurement; + String? unitofMeasurementDescription; dynamic unitofMeasurementDescriptionN; PrescriotionInPatient( diff --git a/lib/core/model/Prescriptions/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart index 92574c66..fa45ff13 100644 --- a/lib/core/model/Prescriptions/prescription_model.dart +++ b/lib/core/model/Prescriptions/prescription_model.dart @@ -1,5 +1,5 @@ class PrescriptionModel { - List entityList; + List? entityList; dynamic rowcount; dynamic statusMessage; @@ -7,9 +7,9 @@ class PrescriptionModel { PrescriptionModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class PrescriptionModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index d2427004..c442d37d 100644 --- a/lib/core/model/Prescriptions/prescription_report.dart +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -1,48 +1,48 @@ class PrescriptionReport { - String address; - int appointmentNo; - String clinic; - String companyName; - int days; - String doctorName; + String? address; + int? appointmentNo; + String? clinic; + String? companyName; + int? days; + String? doctorName; var doseDailyQuantity; - String frequency; - int frequencyNumber; - String image; - String imageExtension; - String imageSRCUrl; - String imageString; - String imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; - String prescriptionQR; - int prescriptionTimes; - String productImage; - String productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String? frequency; + int? frequencyNumber; + String? image; + String? imageExtension; + String? imageSRCUrl; + String? imageString; + String? imageThumbUrl; + String? isCovered; + String? itemDescription; + int? itemID; + String? orderDate; + int? patientID; + String? patientName; + String? phoneOffice1; + String? prescriptionQR; + int? prescriptionTimes; + String? productImage; + String? productImageBase64; + String? productImageString; + int? projectID; + String? projectName; + String? remarks; + String? route; + String? sKU; + int? scaleOffset; + String? startDate; - String patientAge; - String patientGender; - String phoneOffice; - int doseTimingID; - int frequencyID; - int routeID; - String name; - String itemDescriptionN; - String routeN; - String frequencyN; + String? patientAge; + String? patientGender; + String? phoneOffice; + int? doseTimingID; + int? frequencyID; + int? routeID; + String? name; + String? itemDescriptionN; + String? routeN; + String? frequencyN; PrescriptionReport({ this.address, diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart index 203eaaff..66c57349 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -1,37 +1,37 @@ class PrescriptionReportEnh { - String address; - int appointmentNo; - String clinic; + String? address; + int? appointmentNo; + String? clinic; Null companyName; - int days; - String doctorName; - int doseDailyQuantity; - String frequency; - int frequencyNumber; + int? days; + String? doctorName; + int? doseDailyQuantity; + String? frequency; + int? frequencyNumber; Null image; Null imageExtension; - String imageSRCUrl; + String? imageSRCUrl; Null imageString; - String imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; + String? imageThumbUrl; + String? isCovered; + String? itemDescription; + int? itemID; + String? orderDate; + int? patientID; + String? patientName; + String? phoneOffice1; Null prescriptionQR; - int prescriptionTimes; + int? prescriptionTimes; Null productImage; Null productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String? productImageString; + int? projectID; + String? projectName; + String? remarks; + String? route; + String? sKU; + int? scaleOffset; + String? startDate; PrescriptionReportEnh( {this.address, diff --git a/lib/core/model/Prescriptions/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart index a45878d8..325223fb 100644 --- a/lib/core/model/Prescriptions/prescription_req_model.dart +++ b/lib/core/model/Prescriptions/prescription_req_model.dart @@ -1,5 +1,5 @@ class PrescriptionReqModel { - String vidaAuthTokenID; + String? vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart index f51420ec..0f69ffe5 100644 --- a/lib/core/model/Prescriptions/prescriptions_order.dart +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -1,32 +1,32 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionsOrder { - int iD; + int? iD; dynamic patientID; - bool patientOutSA; - bool isOutPatient; - int projectID; - int nearestProjectID; - double longitude; - double latitude; + bool? patientOutSA; + bool? isOutPatient; + int? projectID; + int? nearestProjectID; + double? longitude; + double? latitude; dynamic appointmentNo; dynamic dischargeID; - int lineItemNo; - int status; + int? lineItemNo; + int? status; dynamic description; dynamic descriptionN; - DateTime createdOn; - int serviceID; - int createdBy; - DateTime editedOn; - int editedBy; - int channel; + DateTime? createdOn; + int? serviceID; + int? createdBy; + DateTime? editedOn; + int? editedBy; + int? channel; dynamic clientRequestID; - bool returnedToQueue; + bool? returnedToQueue; dynamic pickupDateTime; dynamic pickupLocationName; dynamic dropoffLocationName; - int realRRTHaveTransactions; + int? realRRTHaveTransactions; dynamic nearestProjectDescription; dynamic nearestProjectDescriptionN; dynamic projectDescription; diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart index 739bb838..425f8565 100644 --- a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -1,16 +1,16 @@ class RequestGetListPharmacyForPrescriptions { - int latitude; - int longitude; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int itemID; + int? latitude; + int? longitude; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? itemID; RequestGetListPharmacyForPrescriptions( {this.latitude, diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart index c8323740..ee0226a8 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -1,23 +1,23 @@ class RequestPrescriptionReport { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int appointmentNo; - String setupID; - int episodeID; - int clinicID; - int projectID; - int dischargeNo; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? appointmentNo; + String? setupID; + int? episodeID; + int? clinicID; + int? projectID; + int? dischargeNo; RequestPrescriptionReport( {this.versionID, diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart index 4905fc2a..81cdeae3 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -1,23 +1,23 @@ class RequestPrescriptionReportEnh { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int appointmentNo; - String setupID; - int dischargeNo; - int episodeID; - int clinicID; - int projectID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? appointmentNo; + String? setupID; + int? dischargeNo; + int? episodeID; + int? clinicID; + int? projectID; RequestPrescriptionReportEnh( {this.versionID, diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index 1ab5a990..2eda5240 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,45 +1,45 @@ class AdmissionRequest { - int patientMRN; - int admitToClinic; - bool isPregnant; - int pregnancyWeeks; - int pregnancyType; - int noOfBabies; - int mrpDoctorID; - String admissionDate; - int expectedDays; - int admissionType; - int admissionLocationID; - int roomCategoryID; - int wardID; - bool isSickLeaveRequired; - String sickLeaveComments; - bool isTransport; - String transportComments; - bool isPhysioAppointmentNeeded; - String physioAppointmentComments; - bool isOPDFollowupAppointmentNeeded; - String opdFollowUpComments; - bool isDietType; - int dietType; - String dietRemarks; - bool isPhysicalActivityModification; - String physicalActivityModificationComments; - int orStatus; - String mainLineOfTreatment; - int estimatedCost; - String elementsForImprovement; - bool isPackagePatient; - String complications; - String otherDepartmentInterventions; - String otherProcedures; - String pastMedicalHistory; - String pastSurgicalHistory; - List admissionRequestDiagnoses; - List admissionRequestProcedures; - int appointmentNo; - int episodeID; - int admissionRequestNo; + int? patientMRN; + int? admitToClinic; + bool? isPregnant; + int? pregnancyWeeks; + int? pregnancyType; + int? noOfBabies; + int? mrpDoctorID; + String? admissionDate; + int? expectedDays; + int? admissionType; + int? admissionLocationID; + int? roomCategoryID; + int? wardID; + bool? isSickLeaveRequired; + String? sickLeaveComments; + bool? isTransport; + String? transportComments; + bool? isPhysioAppointmentNeeded; + String? physioAppointmentComments; + bool? isOPDFollowupAppointmentNeeded; + String? opdFollowUpComments; + bool? isDietType; + int? dietType; + String? dietRemarks; + bool? isPhysicalActivityModification; + String? physicalActivityModificationComments; + int? orStatus; + String? mainLineOfTreatment; + int? estimatedCost; + String? elementsForImprovement; + bool? isPackagePatient; + String? complications; + String? otherDepartmentInterventions; + String? otherProcedures; + String? pastMedicalHistory; + String? pastSurgicalHistory; + List? admissionRequestDiagnoses; + List? admissionRequestProcedures; + int? appointmentNo; + int? episodeID; + int? admissionRequestNo; AdmissionRequest( {this.patientMRN, @@ -123,17 +123,17 @@ class AdmissionRequest { pastMedicalHistory = json['pastMedicalHistory']; pastSurgicalHistory = json['pastSurgicalHistory']; if (json['admissionRequestDiagnoses'] != null) { - admissionRequestDiagnoses = new List(); + admissionRequestDiagnoses = []; json['admissionRequestDiagnoses'].forEach((v) { - admissionRequestDiagnoses.add(v); + admissionRequestDiagnoses!.add(v); // admissionRequestDiagnoses // .add(new AdmissionRequestDiagnoses.fromJson(v)); }); } if (json['admissionRequestProcedures'] != null) { - admissionRequestProcedures = new List(); + admissionRequestProcedures = []; json['admissionRequestProcedures'].forEach((v) { - admissionRequestProcedures.add(v); + admissionRequestProcedures!.add(v); // admissionRequestProcedures // .add(new AdmissionRequestProcedures.fromJson(v)); }); @@ -190,7 +190,7 @@ class AdmissionRequest { } if (this.admissionRequestProcedures != null) { data['admissionRequestProcedures'] = - this.admissionRequestProcedures.map((v) => v.toJson()).toList(); + this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; diff --git a/lib/core/model/admissionRequest/clinic-model.dart b/lib/core/model/admissionRequest/clinic-model.dart index 05d34645..2d7d1fe3 100644 --- a/lib/core/model/admissionRequest/clinic-model.dart +++ b/lib/core/model/admissionRequest/clinic-model.dart @@ -1,9 +1,9 @@ class Clinic { - int clinicGroupID; - String clinicGroupName; - int clinicID; - String clinicNameArabic; - String clinicNameEnglish; + int? clinicGroupID; + String? clinicGroupName; + int? clinicID; + String? clinicNameArabic; + String? clinicNameEnglish; Clinic( {this.clinicGroupID, diff --git a/lib/core/model/admissionRequest/ward-model.dart b/lib/core/model/admissionRequest/ward-model.dart index 606758d3..abca4900 100644 --- a/lib/core/model/admissionRequest/ward-model.dart +++ b/lib/core/model/admissionRequest/ward-model.dart @@ -1,9 +1,9 @@ class WardModel{ - String description; - String descriptionN; - int floorID; - bool isActive; + String? description; + String? descriptionN; + int? floorID; + bool? isActive; WardModel( {this.description, this.descriptionN, this.floorID, this.isActive}); diff --git a/lib/core/model/auth/activation_Code_req_model.dart b/lib/core/model/auth/activation_Code_req_model.dart index 1a9510e8..7a7112d9 100644 --- a/lib/core/model/auth/activation_Code_req_model.dart +++ b/lib/core/model/auth/activation_Code_req_model.dart @@ -1,14 +1,14 @@ class ActivationCodeModel { - String mobileNumber; - String zipCode; - int channel; - int languageID; - double versionID; - int memberID; - String password; - int facilityId; - String generalid; - String otpSendType; + String? mobileNumber; + String? zipCode; + int? channel; + int? languageID; + double? versionID; + int? memberID; + String? password; + int? facilityId; + String? generalid; + String? otpSendType; ActivationCodeModel( {this.mobileNumber, this.zipCode, diff --git a/lib/core/model/auth/activation_code_for_verification_screen_model.dart b/lib/core/model/auth/activation_code_for_verification_screen_model.dart index 28cc58db..c564b933 100644 --- a/lib/core/model/auth/activation_code_for_verification_screen_model.dart +++ b/lib/core/model/auth/activation_code_for_verification_screen_model.dart @@ -1,17 +1,17 @@ class ActivationCodeForVerificationScreenModel { - int oTPSendType; - String mobileNumber; - String zipCode; - int channel; - int languageID; - double versionID; - int memberID; - int facilityId; - String generalid; - int isMobileFingerPrint; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String iMEI; + int? oTPSendType; + String? mobileNumber; + String? zipCode; + int? channel; + int? languageID; + double? versionID; + int? memberID; + int? facilityId; + String? generalid; + int? isMobileFingerPrint; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + String? iMEI; ActivationCodeForVerificationScreenModel( {this.oTPSendType, this.mobileNumber, diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index c5ff29e6..b5647280 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { - String authenticationTokenID; - List listDoctorsClinic; - List listDoctorProfile; - MemberInformation memberInformation; + String? authenticationTokenID; + List? listDoctorsClinic; + List? listDoctorProfile; + MemberInformation? memberInformation; CheckActivationCodeForDoctorAppResponseModel( {this.authenticationTokenID, @@ -15,16 +15,16 @@ class CheckActivationCodeForDoctorAppResponseModel { Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { - listDoctorsClinic = new List(); + listDoctorsClinic = []; json['List_DoctorsClinic'].forEach((v) { - listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v)); + listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v)); }); } if (json['List_DoctorProfile'] != null) { - listDoctorProfile = new List(); + listDoctorProfile = []; json['List_DoctorProfile'].forEach((v) { - listDoctorProfile.add(new DoctorProfileModel.fromJson(v)); + listDoctorProfile!.add(new DoctorProfileModel.fromJson(v)); }); } @@ -38,15 +38,15 @@ class CheckActivationCodeForDoctorAppResponseModel { data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { data['List_DoctorsClinic'] = - this.listDoctorsClinic.map((v) => v.toJson()).toList(); + this.listDoctorsClinic!.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { data['List_DoctorProfile'] = - this.listDoctorProfile.map((v) => v.toJson()).toList(); + this.listDoctorProfile!.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { - data['memberInformation'] = this.memberInformation.toJson(); + data['memberInformation'] = this.memberInformation!.toJson(); } return data; } @@ -54,11 +54,11 @@ class CheckActivationCodeForDoctorAppResponseModel { class ListDoctorsClinic { Null setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; + int? projectID; + int? doctorID; + int? clinicID; + bool? isActive; + String? clinicName; ListDoctorsClinic({this.setupID, this.projectID, @@ -89,15 +89,15 @@ class ListDoctorsClinic { } class MemberInformation { - List clinics; - int doctorId; - String email; - int employeeId; - int memberId; + List? clinics; + int? doctorId; + String? email; + int? employeeId; + int? memberId; Null memberName; Null memberNameArabic; - String preferredLanguage; - List roles; + String? preferredLanguage; + List? roles; MemberInformation({this.clinics, this.doctorId, @@ -111,9 +111,9 @@ class MemberInformation { MemberInformation.fromJson(Map json) { if (json['clinics'] != null) { - clinics = new List(); + clinics = []; json['clinics'].forEach((v) { - clinics.add(new Clinics.fromJson(v)); + clinics!.add(new Clinics.fromJson(v)); }); } doctorId = json['doctorId']; @@ -124,9 +124,9 @@ class MemberInformation { memberNameArabic = json['memberNameArabic']; preferredLanguage = json['preferredLanguage']; if (json['roles'] != null) { - roles = new List(); + roles = []; json['roles'].forEach((v) { - roles.add(new Roles.fromJson(v)); + roles!.add(new Roles.fromJson(v)); }); } } @@ -134,7 +134,7 @@ class MemberInformation { Map toJson() { final Map data = new Map(); if (this.clinics != null) { - data['clinics'] = this.clinics.map((v) => v.toJson()).toList(); + data['clinics'] = this.clinics!.map((v) => v.toJson()).toList(); } data['doctorId'] = this.doctorId; data['email'] = this.email; @@ -144,16 +144,16 @@ class MemberInformation { data['memberNameArabic'] = this.memberNameArabic; data['preferredLanguage'] = this.preferredLanguage; if (this.roles != null) { - data['roles'] = this.roles.map((v) => v.toJson()).toList(); + data['roles'] = this.roles!.map((v) => v.toJson()).toList(); } return data; } } class Clinics { - bool defaultClinic; - int id; - String name; + bool? defaultClinic; + int? id; + String? name; Clinics({this.defaultClinic, this.id, this.name}); @@ -173,8 +173,8 @@ class Clinics { } class Roles { - String name; - int roleId; + String? name; + int? roleId; Roles({this.name, this.roleId}); diff --git a/lib/core/model/auth/check_activation_code_request_model.dart b/lib/core/model/auth/check_activation_code_request_model.dart index 9bb3d4f6..150c4100 100644 --- a/lib/core/model/auth/check_activation_code_request_model.dart +++ b/lib/core/model/auth/check_activation_code_request_model.dart @@ -1,18 +1,18 @@ class CheckActivationCodeRequestModel { - String mobileNumber; - String zipCode; - int doctorID; - String iPAdress; - int channel; - int languageID; - int projectID; - double versionID; - String generalid; - String logInTokenID; - String activationCode; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int oTPSendType; + String? mobileNumber; + String? zipCode; + int? doctorID; + String? iPAdress; + int? channel; + int? languageID; + int? projectID; + double? versionID; + String? generalid; + String? logInTokenID; + String? activationCode; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + int? oTPSendType; CheckActivationCodeRequestModel( {this.mobileNumber, this.zipCode, diff --git a/lib/core/model/auth/imei_details.dart b/lib/core/model/auth/imei_details.dart index eb37e736..095d5bc9 100644 --- a/lib/core/model/auth/imei_details.dart +++ b/lib/core/model/auth/imei_details.dart @@ -1,33 +1,33 @@ class GetIMEIDetailsModel { - int iD; - String iMEI; - int logInTypeID; - bool outSA; - String mobile; + int? iD; + String? iMEI; + int? logInTypeID; + bool? outSA; + String? mobile; dynamic identificationNo; - int doctorID; - String doctorName; - String doctorNameN; - int clinicID; - String clinicDescription; + int? doctorID; + String? doctorName; + String? doctorNameN; + int? clinicID; + String? clinicDescription; dynamic clinicDescriptionN; - int projectID; - String projectName; - String genderDescription; + int? projectID; + String? projectName; + String? genderDescription; dynamic genderDescriptionN; - String titleDescription; + String? titleDescription; dynamic titleDescriptionN; dynamic zipCode; - String createdOn; + String? createdOn; dynamic createdBy; - String editedOn; + String? editedOn; dynamic editedBy; - bool biometricEnabled; + bool? biometricEnabled; dynamic preferredLanguage; - bool isActive; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String password; + bool? isActive; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + String? password; GetIMEIDetailsModel( {this.iD, this.iMEI, diff --git a/lib/core/model/auth/insert_imei_model.dart b/lib/core/model/auth/insert_imei_model.dart index 25e22b7a..a4aeab7b 100644 --- a/lib/core/model/auth/insert_imei_model.dart +++ b/lib/core/model/auth/insert_imei_model.dart @@ -1,36 +1,36 @@ class InsertIMEIDetailsModel { - String iMEI; - int logInTypeID; + String? iMEI; + int? logInTypeID; dynamic outSA; - String mobile; + String? mobile; dynamic identificationNo; - int doctorID; - String doctorName; - String doctorNameN; - int clinicID; - String clinicDescription; + int? doctorID; + String? doctorName; + String? doctorNameN; + int? clinicID; + String? clinicDescription; Null clinicDescriptionN; - String projectName; - String genderDescription; + String? projectName; + String? genderDescription; Null genderDescriptionN; - String titleDescription; + String? titleDescription; Null titleDescriptionN; - bool bioMetricEnabled; + bool? bioMetricEnabled; Null preferredLanguage; - bool isActive; - int editedBy; - int projectID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - int patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; + bool? isActive; + int? editedBy; + int? projectID; + String? tokenID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + bool? isLoginForDoctorApp; + int? patientOutSA; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; dynamic password; InsertIMEIDetailsModel( {this.iMEI, diff --git a/lib/core/model/auth/new_login_information_response_model.dart b/lib/core/model/auth/new_login_information_response_model.dart index 117060e4..3922d0ba 100644 --- a/lib/core/model/auth/new_login_information_response_model.dart +++ b/lib/core/model/auth/new_login_information_response_model.dart @@ -1,13 +1,13 @@ class NewLoginInformationModel { - int doctorID; - List listMemberInformation; - String logInTokenID; - String mobileNumber; + int? doctorID; + List? listMemberInformation; + String? logInTokenID; + String? mobileNumber; Null sELECTDeviceIMEIbyIMEIList; - int userID; - String zipCode; - bool isActiveCode; - bool isSMSSent; + int? userID; + String? zipCode; + bool? isActiveCode; + bool? isSMSSent; NewLoginInformationModel( {this.doctorID, @@ -23,9 +23,9 @@ class NewLoginInformationModel { NewLoginInformationModel.fromJson(Map json) { doctorID = json['DoctorID']; if (json['List_MemberInformation'] != null) { - listMemberInformation = new List(); + listMemberInformation = []; json['List_MemberInformation'].forEach((v) { - listMemberInformation.add(new ListMemberInformation.fromJson(v)); + listMemberInformation!.add(new ListMemberInformation.fromJson(v)); }); } logInTokenID = json['LogInTokenID']; @@ -42,7 +42,7 @@ class NewLoginInformationModel { data['DoctorID'] = this.doctorID; if (this.listMemberInformation != null) { data['List_MemberInformation'] = - this.listMemberInformation.map((v) => v.toJson()).toList(); + this.listMemberInformation!.map((v) => v.toJson()).toList(); } data['LogInTokenID'] = this.logInTokenID; data['MobileNumber'] = this.mobileNumber; @@ -57,16 +57,16 @@ class NewLoginInformationModel { class ListMemberInformation { Null setupID; - int memberID; - String memberName; + int? memberID; + String? memberName; Null memberNameN; - String preferredLang; - String pIN; - String saltHash; - int referenceID; - int employeeID; - int roleID; - int projectid; + String? preferredLang; + String? pIN; + String? saltHash; + int? referenceID; + int? employeeID; + int? roleID; + int? projectid; ListMemberInformation( {this.setupID, diff --git a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart index ceaf4c65..db971954 100644 --- a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart @@ -1,8 +1,8 @@ class SendActivationCodeForDoctorAppResponseModel { - String logInTokenID; - String verificationCode; - String vidaAuthTokenID; - String vidaRefreshTokenID; + String? logInTokenID; + String? verificationCode; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; SendActivationCodeForDoctorAppResponseModel( {this.logInTokenID, diff --git a/lib/core/model/calculate_box_request_model.dart b/lib/core/model/calculate_box_request_model.dart index 80281854..24e75bb7 100644 --- a/lib/core/model/calculate_box_request_model.dart +++ b/lib/core/model/calculate_box_request_model.dart @@ -1,9 +1,9 @@ class CalculateBoxQuantityRequestModel { - int itemCode; - double strength; - int frequency; - int duration; - String vidaAuthTokenID; + int? itemCode; + double? strength; + int? frequency; + int? duration; + String? vidaAuthTokenID; CalculateBoxQuantityRequestModel( {this.itemCode, diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 8a5f1bc1..99868c4c 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -1,13 +1,13 @@ class GetHospitalsRequestModel { - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - String memberID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + String? memberID; GetHospitalsRequestModel( {this.languageID, diff --git a/lib/core/model/hospitals/get_hospitals_response_model.dart b/lib/core/model/hospitals/get_hospitals_response_model.dart index edbc3fe5..9a4262ef 100644 --- a/lib/core/model/hospitals/get_hospitals_response_model.dart +++ b/lib/core/model/hospitals/get_hospitals_response_model.dart @@ -1,7 +1,7 @@ class GetHospitalsResponseModel { - String facilityGroupId; - int facilityId; - String facilityName; + String? facilityGroupId; + int? facilityId; + String? facilityName; GetHospitalsResponseModel( {this.facilityGroupId, this.facilityId, this.facilityName}); diff --git a/lib/core/model/hospitals_model.dart b/lib/core/model/hospitals_model.dart index b09807d6..c5d4ae14 100644 --- a/lib/core/model/hospitals_model.dart +++ b/lib/core/model/hospitals_model.dart @@ -1,20 +1,20 @@ class HospitalsModel { - String desciption; + String? desciption; dynamic desciptionN; - int iD; - String legalName; - String legalNameN; - String name; + int? iD; + String? legalName; + String? legalNameN; + String? name; dynamic nameN; - String phoneNumber; - String setupID; - int distanceInKilometers; - bool isActive; - String latitude; - String longitude; - int mainProjectID; + String? phoneNumber; + String? setupID; + int? distanceInKilometers; + bool? isActive; + String? latitude; + String? longitude; + int? mainProjectID; dynamic projectOutSA; - bool usingInDoctorApp; + bool? usingInDoctorApp; HospitalsModel({this.desciption, this.desciptionN, diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index a3717c42..995bd176 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -1,11 +1,11 @@ class ApporvalDetails { - int approvalNo; + int? approvalNo; - String procedureName; + String? procedureName; //String procedureNameN; - String status; + String? status; - String isInvoicedDesc; + String? isInvoicedDesc; ApporvalDetails( {this.approvalNo, this.procedureName, this.status, this.isInvoicedDesc}); @@ -35,35 +35,35 @@ class ApporvalDetails { } class InsuranceApprovalModel { - List apporvalDetails; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int eXuldAPPNO; - int projectID; - String doctorName; - String clinicName; - String patientDescription; - int approvalNo; - String approvalStatusDescption; - int unUsedCount; - String doctorImage; - String projectName; + List? apporvalDetails; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? eXuldAPPNO; + int? projectID; + String? doctorName; + String? clinicName; + String? patientDescription; + int? approvalNo; + String? approvalStatusDescption; + int? unUsedCount; + String? doctorImage; + String? projectName; //String companyName; - String expiryDate; - String rceiptOn; - int appointmentNo; + String? expiryDate; + String? rceiptOn; + int? appointmentNo; InsuranceApprovalModel( {this.versionID, @@ -126,9 +126,9 @@ class InsuranceApprovalModel { doctorImage = json['DoctorImageURL']; clinicName = json['ClinicName']; if (json['ApporvalDetails'] != null) { - apporvalDetails = new List(); + apporvalDetails = []; json['ApporvalDetails'].forEach((v) { - apporvalDetails.add(new ApporvalDetails.fromJson(v)); + apporvalDetails!.add(new ApporvalDetails.fromJson(v)); }); } appointmentNo = json['AppointmentNo']; diff --git a/lib/core/model/insurance/insurance_approval_in_patient_model.dart b/lib/core/model/insurance/insurance_approval_in_patient_model.dart index f185a8bf..805958e7 100644 --- a/lib/core/model/insurance/insurance_approval_in_patient_model.dart +++ b/lib/core/model/insurance/insurance_approval_in_patient_model.dart @@ -1,36 +1,36 @@ class InsuranceApprovalInPatientModel { - String setupID; - int projectID; - int approvalNo; - int status; - String approvalDate; - int patientType; - int patientID; - int companyID; - bool subCategoryID; - int doctorID; - int clinicID; - int approvalType; - int inpatientApprovalSubType; + String? setupID; + int? projectID; + int? approvalNo; + int? status; + String? approvalDate; + int? patientType; + int? patientID; + int? companyID; + bool? subCategoryID; + int? doctorID; + int? clinicID; + int? approvalType; + int? inpatientApprovalSubType; dynamic isApprovalOnGross; - String companyApprovalNo; + String? companyApprovalNo; dynamic progNoteOrderNo; - String submitOn; - String receiptOn; - String expiryDate; - int admissionNo; - int admissionRequestNo; - String approvalStatusDescption; + String? submitOn; + String? receiptOn; + String? expiryDate; + int? admissionNo; + int? admissionRequestNo; + String? approvalStatusDescption; dynamic approvalStatusDescptionN; dynamic remarks; - List apporvalDetails; - String clinicName; + List? apporvalDetails; + String? clinicName; dynamic companyName; - String doctorName; - String projectName; - int totaUnUsedCount; - int unUsedCount; - String doctorImage; + String? doctorName; + String? projectName; + int? totaUnUsedCount; + int? unUsedCount; + String? doctorImage; InsuranceApprovalInPatientModel( {this.setupID, @@ -93,9 +93,9 @@ class InsuranceApprovalInPatientModel { approvalStatusDescptionN = json['ApprovalStatusDescptionN']; remarks = json['Remarks']; if (json['ApporvalDetails'] != null) { - apporvalDetails = new List(); + apporvalDetails = []; json['ApporvalDetails'].forEach((v) { - apporvalDetails.add(new ApporvalDetails.fromJson(v)); + apporvalDetails!.add(new ApporvalDetails.fromJson(v)); }); } clinicName = json['ClinicName']; @@ -135,7 +135,7 @@ class InsuranceApprovalInPatientModel { data['Remarks'] = this.remarks; if (this.apporvalDetails != null) { data['ApporvalDetails'] = - this.apporvalDetails.map((v) => v.toJson()).toList(); + this.apporvalDetails!.map((v) => v.toJson()).toList(); } data['ClinicName'] = this.clinicName; data['CompanyName'] = this.companyName; @@ -150,7 +150,7 @@ class InsuranceApprovalInPatientModel { class ApporvalDetails { Null setupID; Null projectID; - int approvalNo; + int? approvalNo; Null lineItemNo; Null orderType; Null procedureID; @@ -167,16 +167,16 @@ class ApporvalDetails { Null patientShare; Null companyShare; Null deductableAmount; - String disapprovedRemarks; + String? disapprovedRemarks; Null progNoteOrderNo; Null progNoteLineItemNo; Null invoiceTransactionType; Null invoiceNo; - String procedureName; - String procedureNameN; - String status; + String? procedureName; + String? procedureNameN; + String? status; Null isInvoiced; - String isInvoicedDesc; + String? isInvoicedDesc; ApporvalDetails( {this.setupID, diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart index ecb4ae65..d282c6b4 100644 --- a/lib/core/model/labs/LabOrderResult.dart +++ b/lib/core/model/labs/LabOrderResult.dart @@ -1,23 +1,23 @@ class LabOrderResult { - String description; + String? description; dynamic femaleInterpretativeData; - int gender; - int lineItemNo; + int? gender; + int? lineItemNo; dynamic maleInterpretativeData; dynamic notes; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; + String? packageID; + int? patientID; + String? projectID; + String? referanceRange; + String? resultValue; + String? sampleCollectedOn; + String? sampleReceivedOn; + String? setupID; dynamic superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; - String verifiedOnDateTime; + String? testCode; + String? uOM; + String? verifiedOn; + String? verifiedOnDateTime; LabOrderResult( {this.description, diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 1c09696b..e1588ba9 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,22 +1,22 @@ class LabResult { - String description; + String? description; dynamic femaleInterpretativeData; - int gender; - int lineItemNo; + int? gender; + int? lineItemNo; dynamic maleInterpretativeData; - String notes; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; + String? notes; + String? packageID; + int? patientID; + String? projectID; + String? referanceRange; + String? resultValue; + String? sampleCollectedOn; + String? sampleReceivedOn; + String? setupID; dynamic superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; + String? testCode; + String? uOM; + String? verifiedOn; dynamic verifiedOnDateTime; LabResult( @@ -89,10 +89,10 @@ class LabResult { class LabResultList { - String filterName = ""; - List patientLabResultList = List(); + String? filterName = ""; + List patientLabResultList = []; - LabResultList({this.filterName, LabResult lab}) { + LabResultList({this.filterName, LabResult? lab}) { patientLabResultList.add(lab); } } diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index af60f86f..8f175616 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientLabOrders { - int actualDoctorRate; - String clinicDescription; - String clinicDescriptionEnglish; + int? actualDoctorRate; + String? clinicDescription; + String? clinicDescriptionEnglish; Null clinicDescriptionN; - int clinicID; - int doctorID; - String doctorImageURL; - String doctorName; - String doctorNameEnglish; + int? clinicID; + int? doctorID; + String? doctorImageURL; + String? doctorName; + String? doctorNameEnglish; Null doctorNameN; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - String invoiceNo; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isRead; - String nationalityFlagURL; - int noOfPatientsRate; - DateTime orderDate; - String orderNo; - String patientID; - String projectID; - String projectName; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + String? invoiceNo; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isRead; + String? nationalityFlagURL; + int? noOfPatientsRate; + DateTime? orderDate; + String? orderNo; + String? patientID; + String? projectID; + String? projectName; Null projectNameN; - String qR; - String setupID; - List speciality; - bool isLiveCareAppointment; + String? qR; + String? setupID; + List? speciality; + bool? isLiveCareAppointment; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -148,11 +148,11 @@ class PatientLabOrders { } class PatientLabOrdersList { - String filterName = ""; - List patientLabOrdersList = List(); + String? filterName = ""; + List patientLabOrdersList = []; PatientLabOrdersList( - {this.filterName, PatientLabOrders patientDoctorAppointment}) { + {this.filterName, PatientLabOrders? patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart index 2fbcb832..89a3218e 100644 --- a/lib/core/model/labs/patient_lab_special_result.dart +++ b/lib/core/model/labs/patient_lab_special_result.dart @@ -1,8 +1,8 @@ class PatientLabSpecialResult { - String invoiceNo; - String moduleID; - String resultData; - String resultDataHTML; + String? invoiceNo; + String? moduleID; + String? resultData; + String? resultDataHTML; Null resultDataTxt; PatientLabSpecialResult( diff --git a/lib/core/model/labs/request_patient_lab_orders.dart b/lib/core/model/labs/request_patient_lab_orders.dart index ce9263ef..9f9dd4d3 100644 --- a/lib/core/model/labs/request_patient_lab_orders.dart +++ b/lib/core/model/labs/request_patient_lab_orders.dart @@ -1,17 +1,17 @@ class RequestPatientLabOrders { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; RequestPatientLabOrders( {this.versionID, diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index b48cf0e1..a8183bfb 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,22 +1,22 @@ class RequestPatientLabSpecialResult { - String invoiceNo; - String orderNo; - String setupID; - String projectID; - int clinicID; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + String? invoiceNo; + String? orderNo; + String? setupID; + String? projectID; + int? clinicID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; RequestPatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 118da906..699ddafb 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -1,29 +1,29 @@ class RequestSendLabReportEmail { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - String to; - String dateofBirth; - String patientIditificationNum; - String patientMobileNumber; - String patientName; - String setupID; - String projectName; - String clinicName; - String doctorName; - String projectID; - String invoiceNo; - String orderDate; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + String? to; + String? dateofBirth; + String? patientIditificationNum; + String? patientMobileNumber; + String? patientName; + String? setupID; + String? projectName; + String? clinicName; + String? doctorName; + String? projectID; + String? invoiceNo; + String? orderDate; RequestSendLabReportEmail( {this.versionID, diff --git a/lib/core/model/medical_report/medical_file_model.dart b/lib/core/model/medical_report/medical_file_model.dart index deebb2af..0964d0de 100644 --- a/lib/core/model/medical_report/medical_file_model.dart +++ b/lib/core/model/medical_report/medical_file_model.dart @@ -1,14 +1,14 @@ class MedicalFileModel { - List entityList; + List? entityList; dynamic statusMessage; MedicalFileModel({this.entityList, this.statusMessage}); MedicalFileModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } statusMessage = json['statusMessage']; @@ -17,7 +17,7 @@ class MedicalFileModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['statusMessage'] = this.statusMessage; return data; @@ -25,15 +25,15 @@ class MedicalFileModel { } class EntityList { - List timelines; + List? timelines; EntityList({this.timelines}); EntityList.fromJson(Map json) { if (json['Timelines'] != null) { - timelines = new List(); + timelines = []; json['Timelines'].forEach((v) { - timelines.add(new Timelines.fromJson(v)); + timelines!.add(new Timelines.fromJson(v)); }); } } @@ -41,25 +41,25 @@ class EntityList { Map toJson() { final Map data = new Map(); if (this.timelines != null) { - data['Timelines'] = this.timelines.map((v) => v.toJson()).toList(); + data['Timelines'] = this.timelines!.map((v) => v.toJson()).toList(); } return data; } } class Timelines { - int clinicId; - String clinicName; - String date; - int doctorId; - String doctorImage; - String doctorName; - int encounterNumber; - String encounterType; - int projectID; - String projectName; - String setupID; - List timeLineEvents; + int? clinicId; + String? clinicName; + String? date; + int? doctorId; + String? doctorImage; + String? doctorName; + int? encounterNumber; + String? encounterType; + int? projectID; + String? projectName; + String? setupID; + List? timeLineEvents; Timelines( {this.clinicId, @@ -88,9 +88,9 @@ class Timelines { projectName = json['ProjectName']; setupID = json['SetupID']; if (json['TimeLineEvents'] != null) { - timeLineEvents = new List(); + timeLineEvents = []; json['TimeLineEvents'].forEach((v) { - timeLineEvents.add(new TimeLineEvents.fromJson(v)); + timeLineEvents!.add(new TimeLineEvents.fromJson(v)); }); } } @@ -110,25 +110,25 @@ class Timelines { data['SetupID'] = this.setupID; if (this.timeLineEvents != null) { data['TimeLineEvents'] = - this.timeLineEvents.map((v) => v.toJson()).toList(); + this.timeLineEvents!.map((v) => v.toJson()).toList(); } return data; } } class TimeLineEvents { - List admissions; - String colorClass; - List consulations; + List? admissions; + String? colorClass; + List? consulations; TimeLineEvents({this.admissions, this.colorClass, this.consulations}); TimeLineEvents.fromJson(Map json) { colorClass = json['ColorClass']; if (json['Consulations'] != null) { - consulations = new List(); + consulations = []; json['Consulations'].forEach((v) { - consulations.add(new Consulations.fromJson(v)); + consulations!.add(new Consulations.fromJson(v)); }); } } @@ -138,38 +138,38 @@ class TimeLineEvents { data['ColorClass'] = this.colorClass; if (this.consulations != null) { - data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); + data['Consulations'] = this.consulations!.map((v) => v.toJson()).toList(); } return data; } } class Consulations { - int admissionNo; - String appointmentDate; - int appointmentNo; - String appointmentType; - String clinicID; - String clinicName; - int doctorID; - String doctorName; - String endTime; - String episodeDate; - int episodeID; - int patientID; - int projectID; - String projectName; - String remarks; - String setupID; - String startTime; - String visitFor; - String visitType; - String dispalyName; - List lstAssessments; - List lstPhysicalExam; - List lstProcedure; - List lstMedicalHistory; - List lstCheifComplaint; + int? admissionNo; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + String? clinicID; + String? clinicName; + int? doctorID; + String? doctorName; + String? endTime; + String? episodeDate; + int? episodeID; + int? patientID; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? startTime; + String? visitFor; + String? visitType; + String? dispalyName; + List? lstAssessments; + List? lstPhysicalExam; + List? lstProcedure; + List? lstMedicalHistory; + List? lstCheifComplaint; Consulations( {this.admissionNo, @@ -220,33 +220,33 @@ class Consulations { visitType = json['VisitType']; dispalyName = json['dispalyName']; if (json['lstAssessments'] != null) { - lstAssessments = new List(); + lstAssessments = []; json['lstAssessments'].forEach((v) { - lstAssessments.add(new LstAssessments.fromJson(v)); + lstAssessments!.add(new LstAssessments.fromJson(v)); }); } if (json['lstCheifComplaint'] != null) { - lstCheifComplaint = new List(); + lstCheifComplaint = []; json['lstCheifComplaint'].forEach((v) { - lstCheifComplaint.add(new LstCheifComplaint.fromJson(v)); + lstCheifComplaint!.add(new LstCheifComplaint.fromJson(v)); }); } if (json['lstPhysicalExam'] != null) { - lstPhysicalExam = new List(); + lstPhysicalExam = []; json['lstPhysicalExam'].forEach((v) { - lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); + lstPhysicalExam!.add(new LstPhysicalExam.fromJson(v)); }); } if (json['lstProcedure'] != null) { - lstProcedure = new List(); + lstProcedure = []; json['lstProcedure'].forEach((v) { - lstProcedure.add(new LstProcedure.fromJson(v)); + lstProcedure!.add(new LstProcedure.fromJson(v)); }); } if (json['lstMedicalHistory'] != null) { - lstMedicalHistory = new List(); + lstMedicalHistory = []; json['lstMedicalHistory'].forEach((v) { - lstMedicalHistory.add(new LstMedicalHistory.fromJson(v)); + lstMedicalHistory!.add(new LstMedicalHistory.fromJson(v)); }); } } @@ -275,40 +275,40 @@ class Consulations { data['dispalyName'] = this.dispalyName; if (this.lstAssessments != null) { data['lstAssessments'] = - this.lstAssessments.map((v) => v.toJson()).toList(); + this.lstAssessments!.map((v) => v.toJson()).toList(); } if (this.lstCheifComplaint != null) { data['lstCheifComplaint'] = - this.lstCheifComplaint.map((v) => v.toJson()).toList(); + this.lstCheifComplaint!.map((v) => v.toJson()).toList(); } if (this.lstPhysicalExam != null) { data['lstPhysicalExam'] = - this.lstPhysicalExam.map((v) => v.toJson()).toList(); + this.lstPhysicalExam!.map((v) => v.toJson()).toList(); } if (this.lstProcedure != null) { - data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); + data['lstProcedure'] = this.lstProcedure!.map((v) => v.toJson()).toList(); } if (this.lstMedicalHistory != null) { data['lstMedicalHistory'] = - this.lstMedicalHistory.map((v) => v.toJson()).toList(); + this.lstMedicalHistory!.map((v) => v.toJson()).toList(); } return data; } } class LstCheifComplaint { - int appointmentNo; - String cCDate; - String chiefComplaint; - String currentMedication; - int episodeID; - String hOPI; - int patientID; - String patientType; - int projectID; - String projectName; - String setupID; - String dispalyName; + int? appointmentNo; + String? cCDate; + String? chiefComplaint; + String? currentMedication; + int? episodeID; + String? hOPI; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? setupID; + String? dispalyName; LstCheifComplaint( {this.appointmentNo, @@ -358,19 +358,19 @@ class LstCheifComplaint { } class LstAssessments { - int appointmentNo; - String condition; - String description; - int episodeID; - String iCD10; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String type; - String dispalyName; + int? appointmentNo; + String? condition; + String? description; + int? episodeID; + String? iCD10; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? type; + String? dispalyName; LstAssessments( {this.appointmentNo, @@ -423,19 +423,19 @@ class LstAssessments { } class LstPhysicalExam { - String abnormal; - int appointmentNo; - int episodeID; - String examDesc; - String examID; - String examType; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String dispalyName; + String? abnormal; + int? appointmentNo; + int? episodeID; + String? examDesc; + String? examID; + String? examType; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? dispalyName; LstPhysicalExam( {this.abnormal, @@ -488,17 +488,17 @@ class LstPhysicalExam { } class LstProcedure { - int appointmentNo; - int episodeID; - String orderDate; - int patientID; - String patientType; - String procName; - String procedureId; - int projectID; - String projectName; - String setupID; - String dispalyName; + int? appointmentNo; + int? episodeID; + String? orderDate; + int? patientID; + String? patientType; + String? procName; + String? procedureId; + int? projectID; + String? projectName; + String? setupID; + String? dispalyName; LstProcedure( {this.appointmentNo, @@ -545,17 +545,17 @@ class LstProcedure { } class LstMedicalHistory { - int appointmentNo; - String checked; - int episodeID; - String history; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String dispalyName; + int? appointmentNo; + String? checked; + int? episodeID; + String? history; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? dispalyName; LstMedicalHistory( {this.appointmentNo, diff --git a/lib/core/model/medical_report/medical_file_request_model.dart b/lib/core/model/medical_report/medical_file_request_model.dart index 8703141a..1fa6650b 100644 --- a/lib/core/model/medical_report/medical_file_request_model.dart +++ b/lib/core/model/medical_report/medical_file_request_model.dart @@ -1,7 +1,7 @@ class MedicalFileRequestModel { - int patientMRN; - String vidaAuthTokenID; - String iPAdress; + int? patientMRN; + String? vidaAuthTokenID; + String? iPAdress; MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID,this.iPAdress}); diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart index ce076705..355ad511 100644 --- a/lib/core/model/note/CreateNoteModel.dart +++ b/lib/core/model/note/CreateNoteModel.dart @@ -1,23 +1,23 @@ class CreateNoteModel { - int visitType; - int admissionNo; - int projectID; - int patientTypeID; - int patientID; - int clinicID; - String notes; - int createdBy; - int editedBy; - String nursingRemarks; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? visitType; + int? admissionNo; + int? projectID; + int? patientTypeID; + int? patientID; + int? clinicID; + String? notes; + int? createdBy; + int? editedBy; + String? nursingRemarks; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; CreateNoteModel( {this.visitType, diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart index 797f9b6d..f929acee 100644 --- a/lib/core/model/note/note_model.dart +++ b/lib/core/model/note/note_model.dart @@ -1,24 +1,24 @@ class NoteModel { - String setupID; - int projectID; - int patientID; - int patientType; - String admissionNo; - int lineItemNo; - int visitType; - String notes; - String assessmentDate; - String visitTime; - int status; - String nursingRemarks; - String createdOn; - String editedOn; - int createdBy; - int admissionClinicID; - String admissionClinicName; + String? setupID; + int? projectID; + int? patientID; + int? patientType; + String? admissionNo; + int? lineItemNo; + int? visitType; + String? notes; + String? assessmentDate; + String? visitTime; + int? status; + String? nursingRemarks; + String? createdOn; + String? editedOn; + int? createdBy; + int? admissionClinicID; + String? admissionClinicName; Null doctorClinicName; - String doctorName; - String visitTypeDesc; + String? doctorName; + String? visitTypeDesc; NoteModel( {this.setupID, diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart index 20fd4b86..5c59cc77 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -1,21 +1,21 @@ class UpdateNoteReqModel { - int projectID; - int createdBy; - int admissionNo; - int lineItemNo; - String notes; - bool verifiedNote; - bool cancelledNote; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? createdBy; + int? admissionNo; + int? lineItemNo; + String? notes; + bool? verifiedNote; + bool? cancelledNote; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; UpdateNoteReqModel( {this.projectID, diff --git a/lib/core/model/patient_muse/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart index 401fd1a7..a813fd03 100644 --- a/lib/core/model/patient_muse/PatientMuseResultsModel.dart +++ b/lib/core/model/patient_muse/PatientMuseResultsModel.dart @@ -1,19 +1,19 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientMuseResultsModel { - int rowID; - String setupID; - int projectID; - String orderNo; - int lineItemNo; - int patientType; - int patientID; - String procedureID; + int? rowID; + String? setupID; + int? projectID; + String? orderNo; + int? lineItemNo; + int? patientType; + int? patientID; + String? procedureID; dynamic reportData; - String imageURL; - String createdBy; - String createdOn; - DateTime createdOnDateTime; + String? imageURL; + String? createdBy; + String? createdOn; + DateTime? createdOnDateTime; PatientMuseResultsModel( {this.rowID, diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 437c5885..023ecdcd 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -1,16 +1,16 @@ class PatientSearchRequestModel { - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? searchType; + String? mobileNo; + String? identificationNo; PatientSearchRequestModel( {this.doctorID =0, diff --git a/lib/core/model/procedure/ControlsModel.dart b/lib/core/model/procedure/ControlsModel.dart index b3e8ae9c..c4dbcfd5 100644 --- a/lib/core/model/procedure/ControlsModel.dart +++ b/lib/core/model/procedure/ControlsModel.dart @@ -1,6 +1,6 @@ class Controls { - String code; - String controlValue; + String? code; + String? controlValue; Controls({this.code, this.controlValue}); diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index 9e6f847f..47d0d83c 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -1,6 +1,6 @@ class CategoriseProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; CategoriseProcedureModel( @@ -8,9 +8,9 @@ class CategoriseProcedureModel { CategoriseProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -20,7 +20,7 @@ class CategoriseProcedureModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,20 +29,20 @@ class CategoriseProcedureModel { } class EntityList { - bool allowedClinic; - String category; - String categoryID; - String genderValidation; - String group; - String orderedValidation; + bool? allowedClinic; + String? category; + String? categoryID; + String? genderValidation; + String? group; + String? orderedValidation; dynamic price; - String procedureId; - String procedureName; - String specialPermission; - String subGroup; - String template; - String remarks; - String type; + String? procedureId; + String? procedureName; + String? specialPermission; + String? subGroup; + String? template; + String? remarks; + String? type; EntityList( {this.allowedClinic, diff --git a/lib/core/model/procedure/get_ordered_procedure_model.dart b/lib/core/model/procedure/get_ordered_procedure_model.dart index b7185711..234cabab 100644 --- a/lib/core/model/procedure/get_ordered_procedure_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_model.dart @@ -1,6 +1,6 @@ class GetOrderedProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; GetOrderedProcedureModel( @@ -8,9 +8,9 @@ class GetOrderedProcedureModel { GetOrderedProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -20,7 +20,7 @@ class GetOrderedProcedureModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,30 +29,30 @@ class GetOrderedProcedureModel { } class EntityList { - String achiCode; - String appointmentDate; - int appointmentNo; - int categoryID; - String clinicDescription; - String cptCode; - int createdBy; - String createdOn; - String doctorName; - bool isApprovalCreated; - bool isApprovalRequired; - bool isCovered; - bool isInvoiced; - bool isReferralInvoiced; - bool isUncoveredByDoctor; - int lineItemNo; - String orderDate; - int orderNo; - int orderType; - String procedureId; - String procedureName; - String remarks; - String status; - String template; + String? achiCode; + String? appointmentDate; + int? appointmentNo; + int? categoryID; + String? clinicDescription; + String? cptCode; + int? createdBy; + String? createdOn; + String? doctorName; + bool? isApprovalCreated; + bool? isApprovalRequired; + bool? isCovered; + bool? isInvoiced; + bool? isReferralInvoiced; + bool? isUncoveredByDoctor; + int? lineItemNo; + String? orderDate; + int? orderNo; + int? orderType; + String? procedureId; + String? procedureName; + String? remarks; + String? status; + String? template; EntityList( {this.achiCode, diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart index dfbd444c..64f1cb2b 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -1,6 +1,6 @@ class GetOrderedProcedureRequestModel { - String vidaAuthTokenID; - int patientMRN; + String? vidaAuthTokenID; + int? patientMRN; GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN}); diff --git a/lib/core/model/procedure/get_procedure_model.dart b/lib/core/model/procedure/get_procedure_model.dart index 5c83b49b..31f4c522 100644 --- a/lib/core/model/procedure/get_procedure_model.dart +++ b/lib/core/model/procedure/get_procedure_model.dart @@ -1,15 +1,15 @@ class GetProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; GetProcedureModel({this.entityList, this.rowcount, this.statusMessage}); GetProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class GetProcedureModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -28,18 +28,18 @@ class GetProcedureModel { } class EntityList { - bool allowedClinic; - String category; - String categoryID; - String genderValidation; - String group; - String orderedValidation; + bool? allowedClinic; + String? category; + String? categoryID; + String? genderValidation; + String? group; + String? orderedValidation; dynamic price; - String procedureId; - String procedureName; - String specialPermission; - String subGroup; - String template; + String? procedureId; + String? procedureName; + String? specialPermission; + String? subGroup; + String? template; EntityList( {this.allowedClinic, diff --git a/lib/core/model/procedure/get_procedure_req_model.dart b/lib/core/model/procedure/get_procedure_req_model.dart index 6202a520..309e657c 100644 --- a/lib/core/model/procedure/get_procedure_req_model.dart +++ b/lib/core/model/procedure/get_procedure_req_model.dart @@ -1,11 +1,11 @@ class GetProcedureReqModel { - int clinicId; - int patientMRN; - int pageSize; - int pageIndex; - List search; + int? clinicId; + int? patientMRN; + int? pageSize; + int? pageIndex; + List? search; dynamic category; - String vidaAuthTokenID; + String? vidaAuthTokenID; GetProcedureReqModel( {this.clinicId, diff --git a/lib/core/model/procedure/post_procedure_req_model.dart b/lib/core/model/procedure/post_procedure_req_model.dart index b12563f8..836955d9 100644 --- a/lib/core/model/procedure/post_procedure_req_model.dart +++ b/lib/core/model/procedure/post_procedure_req_model.dart @@ -1,11 +1,11 @@ import 'ControlsModel.dart'; class PostProcedureReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - List procedures; - String vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeID; + List? procedures; + String? vidaAuthTokenID; PostProcedureReqModel( {this.patientMRN, @@ -19,9 +19,9 @@ class PostProcedureReqModel { appointmentNo = json['AppointmentNo']; episodeID = json['EpisodeID']; if (json['Procedures'] != null) { - procedures = new List(); + procedures = []; json['Procedures'].forEach((v) { - procedures.add(new Procedures.fromJson(v)); + procedures!.add(new Procedures.fromJson(v)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; @@ -33,7 +33,7 @@ class PostProcedureReqModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeID; if (this.procedures != null) { - data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); + data['Procedures'] = this.procedures!.map((v) => v.toJson()).toList(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -41,9 +41,9 @@ class PostProcedureReqModel { } class Procedures { - String procedure; - String category; - List controls; + String? procedure; + String? category; + List? controls; Procedures({this.procedure, this.category, this.controls}); @@ -51,9 +51,9 @@ class Procedures { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = new List(); + controls = []; json['Controls'].forEach((v) { - controls.add(new Controls.fromJson(v)); + controls!.add(new Controls.fromJson(v)); }); } } @@ -63,7 +63,7 @@ class Procedures { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/procedure/procedure_category_list_model.dart b/lib/core/model/procedure/procedure_category_list_model.dart index 849e84e5..a72e7062 100644 --- a/lib/core/model/procedure/procedure_category_list_model.dart +++ b/lib/core/model/procedure/procedure_category_list_model.dart @@ -1,6 +1,6 @@ class ProcedureCategoryListModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; ProcedureCategoryListModel( @@ -8,9 +8,9 @@ class ProcedureCategoryListModel { ProcedureCategoryListModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -20,7 +20,7 @@ class ProcedureCategoryListModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,8 +29,8 @@ class ProcedureCategoryListModel { } class EntityList { - int categoryId; - String categoryName; + int? categoryId; + String? categoryName; EntityList({this.categoryId, this.categoryName}); diff --git a/lib/core/model/procedure/procedure_valadate_model.dart b/lib/core/model/procedure/procedure_valadate_model.dart index 3a3e23cf..02512d78 100644 --- a/lib/core/model/procedure/procedure_valadate_model.dart +++ b/lib/core/model/procedure/procedure_valadate_model.dart @@ -1,6 +1,6 @@ class ProcedureValadteModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; dynamic success; @@ -9,9 +9,9 @@ class ProcedureValadteModel { ProcedureValadteModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -22,7 +22,7 @@ class ProcedureValadteModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -32,8 +32,8 @@ class ProcedureValadteModel { } class EntityList { - String procedureId; - List warringMessages; + String? procedureId; + List? warringMessages; EntityList({this.procedureId, this.warringMessages}); diff --git a/lib/core/model/procedure/procedure_valadate_request_model.dart b/lib/core/model/procedure/procedure_valadate_request_model.dart index 0b872b93..4418806e 100644 --- a/lib/core/model/procedure/procedure_valadate_request_model.dart +++ b/lib/core/model/procedure/procedure_valadate_request_model.dart @@ -1,9 +1,9 @@ class ProcedureValadteRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; - int episodeID; - List procedure; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeID; + List? procedure; ProcedureValadteRequestModel( {this.vidaAuthTokenID, diff --git a/lib/core/model/procedure/update_procedure_request_model.dart b/lib/core/model/procedure/update_procedure_request_model.dart index aee39879..a6b92d16 100644 --- a/lib/core/model/procedure/update_procedure_request_model.dart +++ b/lib/core/model/procedure/update_procedure_request_model.dart @@ -1,13 +1,13 @@ import 'ControlsModel.dart'; class UpdateProcedureRequestModel { - int orderNo; - int patientMRN; - int appointmentNo; - int episodeID; - int lineItemNo; - ProcedureDetail procedureDetail; - String vidaAuthTokenID; + int? orderNo; + int? patientMRN; + int? appointmentNo; + int? episodeID; + int? lineItemNo; + ProcedureDetail? procedureDetail; + String? vidaAuthTokenID; UpdateProcedureRequestModel( {this.orderNo, @@ -38,7 +38,7 @@ class UpdateProcedureRequestModel { data['EpisodeID'] = this.episodeID; data['LineItemNo'] = this.lineItemNo; if (this.procedureDetail != null) { - data['procedureDetail'] = this.procedureDetail.toJson(); + data['procedureDetail'] = this.procedureDetail!.toJson(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -46,9 +46,9 @@ class UpdateProcedureRequestModel { } class ProcedureDetail { - String procedure; - String category; - List controls; + String? procedure; + String? category; + List? controls; ProcedureDetail({this.procedure, this.category, this.controls}); @@ -56,9 +56,9 @@ class ProcedureDetail { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = new List(); + controls = []; json['Controls'].forEach((v) { - controls.add(new Controls.fromJson(v)); + controls!.add(new Controls.fromJson(v)); }); } } @@ -68,7 +68,7 @@ class ProcedureDetail { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index e09f269a..43b6d2b9 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -8,17 +8,17 @@ class FinalRadiology { dynamic invoiceNo; dynamic doctorID; dynamic clinicID; - DateTime orderDate; - DateTime reportDate; + DateTime? orderDate; + DateTime? reportDate; dynamic reportData; dynamic imageURL; dynamic procedureID; dynamic appodynamicmentNo; dynamic dIAPacsURL; - bool isRead; + bool? isRead; dynamic readOn; var admissionNo; - bool isInOutPatient; + bool? isInOutPatient; dynamic actualDoctorRate; dynamic clinicDescription; dynamic dIAPACSURL; @@ -28,8 +28,8 @@ class FinalRadiology { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool isActiveDoctorProfile; - bool isExecludeDoctor; + bool? isActiveDoctorProfile; + bool? isExecludeDoctor; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; dynamic nationalityFlagURL; @@ -39,10 +39,10 @@ class FinalRadiology { dynamic qR; dynamic reportDataHTML; dynamic reportDataTextdynamic; - List speciality; - bool isCVI; - bool isRadMedicalReport; - bool isLiveCareAppodynamicment; + List? speciality; + bool? isCVI; + bool? isRadMedicalReport; + bool? isLiveCareAppodynamicment; FinalRadiology( {this.setupID, @@ -186,9 +186,9 @@ class FinalRadiology { class FinalRadiologyList { dynamic filterName = ""; - List finalRadiologyList = List(); + List finalRadiologyList = []; - FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + FinalRadiologyList({this.filterName, FinalRadiology? finalRadiology}) { finalRadiologyList.add(finalRadiology); } } diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart index 9e3458d5..7f39ee25 100644 --- a/lib/core/model/radiology/request_patient_rad_orders_details.dart +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -1,24 +1,24 @@ class RequestPatientRadOrdersDetails { - int projectID; - int orderNo; - int invoiceNo; - String setupID; - String procedureID; - bool isMedicalReport; - bool isCVI; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + int? projectID; + int? orderNo; + int? invoiceNo; + String? setupID; + String? procedureID; + bool? isMedicalReport; + bool? isCVI; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; RequestPatientRadOrdersDetails( {this.projectID, diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index 6d68653d..7c178fb3 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -1,30 +1,30 @@ class RequestSendRadReportEmail { - int channel; - String clinicName; - String dateofBirth; - int deviceTypeID; - String doctorName; - String generalid; - int invoiceNo; - String iPAdress; - bool isDentalAllowedBackend; - int languageID; - String orderDate; - int patientID; - String patientIditificationNum; - String patientMobileNumber; - String patientName; - int patientOutSA; - int patientType; - int patientTypeID; - int projectID; - String projectName; - String radResult; - String sessionID; - String setupID; - String to; - String tokenID; - double versionID; + int? channel; + String? clinicName; + String? dateofBirth; + int? deviceTypeID; + String? doctorName; + String? generalid; + int? invoiceNo; + String? iPAdress; + bool? isDentalAllowedBackend; + int? languageID; + String? orderDate; + int? patientID; + String? patientIditificationNum; + String? patientMobileNumber; + String? patientName; + int? patientOutSA; + int? patientType; + int? patientTypeID; + int? projectID; + String? projectName; + String? radResult; + String? sessionID; + String? setupID; + String? to; + String? tokenID; + double? versionID; RequestSendRadReportEmail( {this.channel, diff --git a/lib/core/model/referral/DischargeReferralPatient.dart b/lib/core/model/referral/DischargeReferralPatient.dart index dff63bfc..0d711720 100644 --- a/lib/core/model/referral/DischargeReferralPatient.dart +++ b/lib/core/model/referral/DischargeReferralPatient.dart @@ -2,56 +2,56 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class DischargeReferralPatient { dynamic rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; dynamic doctorNameN; - String firstName; - String middleName; - String lastName; + String? firstName; + String? middleName; + String? lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; dynamic nursingStationID; dynamic description; - String nationalityName; + String? nationalityName; dynamic nationalityNameN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - DateTime referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - String dischargeDate; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + DateTime? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + String? dischargeDate; dynamic clinicID; - String age; - String clinicDescription; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + String? age; + String? clinicDescription; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; DischargeReferralPatient( {this.rowID, diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 797109dd..a871c3a9 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -2,65 +2,65 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { dynamic rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; dynamic doctorNameN; - String firstName; - String middleName; - String lastName; + String? firstName; + String? middleName; + String? lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; dynamic nursingStationID; dynamic description; - String nationalityName; + String? nationalityName; dynamic nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - DateTime referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - int episodeID; - int appointmentNo; - String appointmentDate; - int appointmentType; - int patientMRN; - String createdOn; - int clinicID; - String nationalityID; - String age; - String doctorImageURL; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nationalityFlagURL; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + DateTime? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + int? episodeID; + int? appointmentNo; + String? appointmentDate; + int? appointmentType; + int? patientMRN; + String? createdOn; + int? clinicID; + String? nationalityID; + String? age; + String? doctorImageURL; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nationalityFlagURL; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; MyReferralPatientModel( {this.rowID, @@ -253,6 +253,6 @@ class MyReferralPatientModel { } get patientName { - return this.firstName+" "+this.lastName; + return this.firstName!+" "+this.lastName!; } } diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index b3ad1f03..e88b0e9b 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -1,28 +1,28 @@ class ReferralRequest { - String roomID; - String referralClinic; - String referralDoctor; - int createdBy; - int editedBy; - int patientID; - int patientTypeID; - int referringClinic; - int referringDoctor; - int projectID; - int admissionNo; - String referringDoctorRemarks; - String priority; - String frequency; - String extension; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + String? roomID; + String? referralClinic; + String? referralDoctor; + int? createdBy; + int? editedBy; + int? patientID; + int? patientTypeID; + int? referringClinic; + int? referringDoctor; + int? projectID; + int? admissionNo; + String? referringDoctorRemarks; + String? priority; + String? frequency; + String? extension; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; ReferralRequest( {this.roomID, diff --git a/lib/core/model/search_drug/get_medication_response_model.dart b/lib/core/model/search_drug/get_medication_response_model.dart index a42a8b47..2c584dc7 100644 --- a/lib/core/model/search_drug/get_medication_response_model.dart +++ b/lib/core/model/search_drug/get_medication_response_model.dart @@ -1,13 +1,13 @@ class GetMedicationResponseModel { - String description; - String genericName; - int itemId; - String keywords; + String? description; + String? genericName; + int? itemId; + String? keywords; dynamic price; dynamic quantity; dynamic mediSpanGPICode; - bool isNarcotic; - String uom; + bool? isNarcotic; + String? uom; GetMedicationResponseModel( {this.description, this.genericName, diff --git a/lib/core/model/search_drug/item_by_medicine_model.dart b/lib/core/model/search_drug/item_by_medicine_model.dart index 0a93a4f1..8651c841 100644 --- a/lib/core/model/search_drug/item_by_medicine_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_model.dart @@ -1,27 +1,27 @@ class ItemByMedicineModel { - List frequencies; - List routes; - List strengths; + List? frequencies; + List? routes; + List? strengths; ItemByMedicineModel({this.frequencies, this.routes, this.strengths}); ItemByMedicineModel.fromJson(Map json) { if (json['frequencies'] != null) { - frequencies = new List(); + frequencies = []; json['frequencies'].forEach((v) { - frequencies.add(new Frequencies.fromJson(v)); + frequencies!.add(new Frequencies.fromJson(v)); }); } if (json['routes'] != null) { - routes = new List(); + routes = []; json['routes'].forEach((v) { - routes.add(new Routes.fromJson(v)); + routes!.add(new Routes.fromJson(v)); }); } if (json['strengths'] != null) { - strengths = new List(); + strengths = []; json['strengths'].forEach((v) { - strengths.add(new Strengths.fromJson(v)); + strengths!.add(new Strengths.fromJson(v)); }); } } @@ -29,22 +29,22 @@ class ItemByMedicineModel { Map toJson() { final Map data = new Map(); if (this.frequencies != null) { - data['frequencies'] = this.frequencies.map((v) => v.toJson()).toList(); + data['frequencies'] = this.frequencies!.map((v) => v.toJson()).toList(); } if (this.routes != null) { - data['routes'] = this.routes.map((v) => v.toJson()).toList(); + data['routes'] = this.routes!.map((v) => v.toJson()).toList(); } if (this.strengths != null) { - data['strengths'] = this.strengths.map((v) => v.toJson()).toList(); + data['strengths'] = this.strengths!.map((v) => v.toJson()).toList(); } return data; } } class Frequencies { - String description; - bool isDefault; - int parameterCode; + String? description; + bool? isDefault; + int? parameterCode; Frequencies({this.description, this.isDefault, this.parameterCode}); @@ -64,9 +64,9 @@ class Frequencies { } class Strengths { - String description; - bool isDefault; - int parameterCode; + String? description; + bool? isDefault; + int? parameterCode; Strengths({this.description, this.isDefault, this.parameterCode}); @@ -86,9 +86,9 @@ class Strengths { } class Routes { - String description; - bool isDefault; - int parameterCode; + String? description; + bool? isDefault; + int? parameterCode; Routes({this.description, this.isDefault, this.parameterCode}); diff --git a/lib/core/model/search_drug/item_by_medicine_request_model.dart b/lib/core/model/search_drug/item_by_medicine_request_model.dart index 7460044b..2845edf4 100644 --- a/lib/core/model/search_drug/item_by_medicine_request_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_request_model.dart @@ -1,6 +1,6 @@ class ItemByMedicineRequestModel { - String vidaAuthTokenID; - int medicineCode; + String? vidaAuthTokenID; + int? medicineCode; ItemByMedicineRequestModel({this.vidaAuthTokenID, this.medicineCode}); diff --git a/lib/core/model/search_drug/search_drug_model.dart b/lib/core/model/search_drug/search_drug_model.dart index 396526c1..257181b8 100644 --- a/lib/core/model/search_drug/search_drug_model.dart +++ b/lib/core/model/search_drug/search_drug_model.dart @@ -1,15 +1,15 @@ class SearchDrugModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; SearchDrugModel({this.entityList, this.rowcount, this.statusMessage}); SearchDrugModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class SearchDrugModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/search_drug/search_drug_request_model.dart b/lib/core/model/search_drug/search_drug_request_model.dart index b64e7d18..991ddd9a 100644 --- a/lib/core/model/search_drug/search_drug_request_model.dart +++ b/lib/core/model/search_drug/search_drug_request_model.dart @@ -1,5 +1,5 @@ class SearchDrugRequestModel { - List search; + List? search; // String vidaAuthTokenID; SearchDrugRequestModel({this.search}); diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index 3c78f1ff..58de5649 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -1,41 +1,41 @@ import 'package:doctor_app_flutter/widgets/shared/StarRating.dart'; class SickLeavePatientModel { - String setupID; - int projectID; - int patientID; - int patientType; - int clinicID; - int doctorID; - int requestNo; - String requestDate; - int sickLeaveDays; - int appointmentNo; - int admissionNo; - int actualDoctorRate; - String appointmentDate; - String clinicName; - String doctorImageURL; - String doctorName; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isLiveCareAppointment; - int noOfPatientsRate; + String? setupID; + int? projectID; + int? patientID; + int? patientType; + int? clinicID; + int? doctorID; + int? requestNo; + String? requestDate; + int? sickLeaveDays; + int? appointmentNo; + int? admissionNo; + int? actualDoctorRate; + String? appointmentDate; + String? clinicName; + String? doctorImageURL; + String? doctorName; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isLiveCareAppointment; + int? noOfPatientsRate; dynamic patientName; - String projectName; - String qR; + String? projectName; + String? qR; // List speciality; - String strRequestDate; - String startDate; - String endDate; + String? strRequestDate; + String? startDate; + String? endDate; SickLeavePatientModel( {this.setupID, diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index ec588316..6be893e2 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -1,16 +1,16 @@ class SickLeavePatientRequestModel { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - int deviceTypeID; - int patientType; - int patientTypeID; - String tokenID; - int patientID; - String sessionID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + int? deviceTypeID; + int? patientType; + int? patientTypeID; + String? tokenID; + int? patientID; + String? sessionID; SickLeavePatientRequestModel( {this.versionID, diff --git a/lib/core/provider/robot_provider.dart b/lib/core/provider/robot_provider.dart index a01b1318..56afd443 100644 --- a/lib/core/provider/robot_provider.dart +++ b/lib/core/provider/robot_provider.dart @@ -3,7 +3,7 @@ import 'dart:async'; class RobotProvider { static final RobotProvider _singleton = RobotProvider._internal(); var value; - StreamController controller = StreamController.broadcast(); + StreamController controller = StreamController.broadcast(); getData() { // return data; diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index f033d4f7..cbe21cfd 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -49,7 +49,7 @@ class AuthenticationService extends BaseService { }, body: {"IMEI": imei, "TokenID": "@dm!n"}); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -66,7 +66,7 @@ class AuthenticationService extends BaseService { }, body: userInfo.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -84,7 +84,7 @@ class AuthenticationService extends BaseService { }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -102,7 +102,7 @@ class AuthenticationService extends BaseService { }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -119,7 +119,7 @@ class AuthenticationService extends BaseService { }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -138,7 +138,7 @@ class AuthenticationService extends BaseService { }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -157,7 +157,7 @@ class AuthenticationService extends BaseService { }, body: profileReqModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } } diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 09ee7c49..f67aab54 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -6,21 +6,21 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { - String error; + String? error; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel doctorProfile; + DoctorProfileModel? doctorProfile; List patientArrivalList = []; //TODO add the user login model when we need it - Future getDoctorProfile({bool isGetProfile = false}) async { + Future getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); + doctorProfile = DoctorProfileModel.fromJson(profile as Map); if (doctorProfile != null) { return doctorProfile; } @@ -29,7 +29,7 @@ class BaseService { if (doctorProfile == null) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); + doctorProfile = DoctorProfileModel.fromJson(profile as Map); if (doctorProfile != null) { return doctorProfile; } @@ -40,7 +40,7 @@ class BaseService { } } - Future getPatientArrivalList(String date,{String fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ + Future getPatientArrivalList(String date,{String? fromDate, int? patientMrn = -1, int appointmentNo = -1}) async{ hasError = false; Map body = Map(); body['From'] = fromDate == null ? date : fromDate; diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index f8a7579d..e0e85e24 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { -List hospitals =List(); +List hospitals = []; Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index 2b353016..e271276d 100644 --- a/lib/core/service/patient/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class DischargedPatientService extends BaseService { - List myDischargedPatients = List(); + List myDischargedPatients = []; - List myDischargeReferralPatients = List(); + List myDischargeReferralPatients = []; Future getDischargedPatient() async { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -45,7 +45,7 @@ class DischargedPatientService extends BaseService { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 536e68a7..b784b46f 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -4,13 +4,13 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; class MyReferralInPatientService extends BaseService { - List myReferralPatients = List(); + List myReferralPatients = []; Future getMyReferralPatientService() async { hasError = false; Map body = Map(); await getDoctorProfile(); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -54,7 +54,7 @@ class MyReferralInPatientService extends BaseService { _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID; _requestAddReferredDoctorRemarks.patientID = referral.patientID; _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; await baseAppClient.post( diff --git a/lib/core/service/patient/PatientMuseService.dart b/lib/core/service/patient/PatientMuseService.dart index c34de9e0..d93995de 100644 --- a/lib/core/service/patient/PatientMuseService.dart +++ b/lib/core/service/patient/PatientMuseService.dart @@ -3,9 +3,9 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsMod import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PatientMuseService extends BaseService { - List patientMuseResultsModelList = List(); + List patientMuseResultsModelList = []; - getECGPatient({int patientType, int patientOutSA, int patientID}) async { + getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { Map body = Map(); body['PatientType'] = patientType == 7 ? 1 : patientType; body['PatientOutSA'] = patientOutSA; diff --git a/lib/core/service/patient/ReferralService.dart b/lib/core/service/patient/ReferralService.dart index 69e2a810..25469dc2 100644 --- a/lib/core/service/patient/ReferralService.dart +++ b/lib/core/service/patient/ReferralService.dart @@ -4,16 +4,16 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ReferralService extends BaseService { Future referralPatient( - {int admissionNo, - String roomID, - int referralClinic, - int referralDoctor, - int patientID, - int patientTypeID, - int priority, - int frequency, - String referringDoctorRemarks, - String extension}) async { + {int? admissionNo, + String? roomID, + int? referralClinic, + int? referralDoctor, + int? patientID, + int? patientTypeID, + int? priority, + int? frequency, + String? referringDoctorRemarks, + String? extension}) async { await getDoctorProfile(); ReferralRequest referralRequest = ReferralRequest(); referralRequest.admissionNo = admissionNo; @@ -25,11 +25,11 @@ class ReferralService extends BaseService { referralRequest.priority = priority.toString(); referralRequest.frequency = frequency.toString(); referralRequest.referringDoctorRemarks = referringDoctorRemarks; - referralRequest.referringClinic = doctorProfile.clinicID; - referralRequest.referringDoctor = doctorProfile.doctorID; + referralRequest.referringClinic = doctorProfile!.clinicID; + referralRequest.referringDoctor = doctorProfile!.doctorID; referralRequest.extension = extension; - referralRequest.editedBy = doctorProfile.doctorID; - referralRequest.createdBy = doctorProfile.doctorID; + referralRequest.editedBy = doctorProfile!.doctorID; + referralRequest.createdBy = doctorProfile!.doctorID; referralRequest.patientOutSA = false; await baseAppClient.post( diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index c83c74c9..69337111 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -12,15 +12,15 @@ import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_mo import '../base/lookup-service.dart'; class PatientReferralService extends LookupService { - List projectsList = []; - List clinicsList = []; - List doctorsList = List(); + List? projectsList = []; + List? clinicsList = []; + List doctorsList = []; List listMyReferredPatientModel = []; List pendingReferralList = []; List patientReferralList = []; - String setupID = "0"; + String? setupID = "0"; - var frequencyList = []; + List? frequencyList = []; Future getProjectsList() async { hasError = false; @@ -65,7 +65,7 @@ class PatientReferralService extends LookupService { }, body: body); } - Future getProjectInfo(int projectId) async { + Future getProjectInfo(int? projectId) async { Map body = Map(); body['ProjectID'] = projectId; @@ -82,7 +82,7 @@ class PatientReferralService extends LookupService { ); } - Future getClinicsList(int projectId) async { + Future getClinicsList(int? projectId) async { hasError = false; ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); @@ -104,7 +104,7 @@ class PatientReferralService extends LookupService { } Future getDoctorsList( - PatiantInformtion patient, int clinicId, int branchId) async { + PatiantInformtion patient, int? clinicId, int? branchId) async { hasError = false; DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); @@ -120,7 +120,7 @@ class PatientReferralService extends LookupService { response['DoctorList'].forEach((v) { doctorsList.add(ClinicDoctor.fromJson(v)); }); - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: _doctorsByClinicIdRequest.toJson(), patient: patient); @@ -130,7 +130,7 @@ class PatientReferralService extends LookupService { hasError = false; RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_PATIENT, @@ -159,7 +159,7 @@ class PatientReferralService extends LookupService { Future getPendingReferralList() async { hasError = false; - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel doctorProfile = await (getDoctorProfile() as FutureOr); Map body = Map(); // body['ClinicID'] = 0; body['DoctorID'] = doctorProfile.doctorID; @@ -214,7 +214,7 @@ class PatientReferralService extends LookupService { Future responseReferral( PendingReferral pendingReferral, bool isAccepted) async { hasError = false; - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel doctorProfile = await (getDoctorProfile() as FutureOr); Map body = Map(); body['PatientMRN'] = pendingReferral.patientID; @@ -240,7 +240,7 @@ class PatientReferralService extends LookupService { } Future makeReferral(PatiantInformtion patient, String isoStringDate, - int projectID, int clinicID, int doctorID, String remarks) async { + int? projectID, int? clinicID, int? doctorID, String remarks) async { hasError = false; Map body = Map(); diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index e0bc94a3..1841568a 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -4,8 +4,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { - List inPatientList = List(); - List myInPatientList = List(); + List inPatientList = []; + List myInPatientList = []; Future getInPatientList( PatientSearchRequestModel requestModel, bool isMyInpatient) async { @@ -13,7 +13,7 @@ class PatientInPatientService extends BaseService { await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID; } else { requestModel.doctorID = 0; } @@ -27,7 +27,7 @@ class PatientInPatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if(patient.doctorId == doctorProfile.doctorID){ + if(patient.doctorId == doctorProfile!.doctorID){ myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index e15cc8d1..a2da6f9b 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -56,26 +56,26 @@ class PatientService extends BaseService { List get patientProgressNoteList => _patientProgressNoteList; // TODO: replace var with model - var _insuranceApporvalsList = []; + List? _insuranceApporvalsList = []; get insuranceApporvalsList => _insuranceApporvalsList; // TODO: replace var with model - var _doctorsList = []; + List? _doctorsList = []; - var _arrivedList = []; + List? _arrivedList = []; get arrivedList => _arrivedList; get doctorsList => _doctorsList; // TODO: replace var with model - var _clinicsList = []; + List? _clinicsList = []; get clinicsList => _clinicsList; // TODO: replace var with model - var _referalFrequancyList = []; + List? _referalFrequancyList = []; get referalFrequancyList => _referalFrequancyList; @@ -85,7 +85,7 @@ class PatientService extends BaseService { STPReferralFrequencyRequest(); ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); - ReferToDoctorRequest _referToDoctorRequest; + late ReferToDoctorRequest _referToDoctorRequest; Future getPatientList(patient, patientType, {isView}) async { hasError = false; @@ -375,25 +375,26 @@ class PatientService extends BaseService { // TODO send the total model insted of each parameter Future referToDoctor( - {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + {String? selectedDoctorID, + String? selectedClinicID, + int? admissionNo, + String? extension, + String? priority, + String? frequency, + String? referringDoctorRemarks, + int? patientID, + int? patientTypeID, + String? roomID, + int? projectID}) async { hasError = false; // TODO Change it to use it when we implement authentication user Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - int doctorID = doctorProfile.doctorID; - int clinicId = doctorProfile.clinicID; + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile as Map); + int? doctorID = doctorProfile.doctorID; + int? clinicId = doctorProfile.clinicID; _referToDoctorRequest = ReferToDoctorRequest( projectID: projectID, + tokenID: '', admissionNo: admissionNo, roomID: roomID, referralClinic: selectedClinicID.toString(), diff --git a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart index c97f8426..55a7030d 100644 --- a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart +++ b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; class AdmissionRequestService extends LookupService { List clinicList = []; - List doctorsList = []; + List? doctorsList = []; List specialityList = []; List floorList = []; List wardList = []; @@ -29,7 +29,7 @@ class AdmissionRequestService extends LookupService { }); } - Future getDoctorsList(int clinicId) async { + Future getDoctorsList(int? clinicId) async { hasError = false; Map body = Map(); @@ -159,7 +159,7 @@ class AdmissionRequestService extends LookupService { ); } - Future getDietTypesList(int patientMrn) async { + Future getDietTypesList(int? patientMrn) async { hasError = false; Map body = Map(); @@ -185,7 +185,7 @@ class AdmissionRequestService extends LookupService { ); } - Future getICDCodes(int patientMrn) async { + Future getICDCodes(int? patientMrn) async { hasError = false; Map body = Map(); diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 2bb9dac7..10bb4f28 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -16,14 +16,14 @@ class InsuranceCardService extends BaseService { _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel(); - List _insuranceApproval = List(); + List _insuranceApproval = []; List get insuranceApproval => _insuranceApproval; - List _insuranceApprovalInPatient = List(); + List _insuranceApprovalInPatient = []; List get insuranceApprovalInPatient => _insuranceApprovalInPatient; - Future getInsuranceApprovalInPatient({int mrn}) async { + Future getInsuranceApprovalInPatient({int? mrn}) async { _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel( patientID: mrn, @@ -45,8 +45,8 @@ class InsuranceCardService extends BaseService { }, body: _insuranceApprovalInPatientRequestModel.toJson()); } - Future getInsuranceApproval(PatiantInformtion patient, - {int appointmentNo, int projectId}) async { + Future getInsuranceApproval(PatiantInformtion? patient, + {int? appointmentNo, int? projectId}) async { hasError = false; // _cardList.clear(); // if (appointmentNo != null) { @@ -67,7 +67,7 @@ class InsuranceCardService extends BaseService { response['HIS_Approval_List'].forEach((item) { _insuranceApproval.add(InsuranceApprovalModel.fromJson(item)); }); - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: _insuranceApprovalModel.toJson()); diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 4eee522a..9239c070 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -10,16 +10,16 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; class LabsService extends BaseService { - List patientLabOrdersList = List(); + List patientLabOrdersList = []; Future getPatientLabOrdersList( - PatiantInformtion patient, bool isInpatient) async { + PatiantInformtion? patient, bool isInpatient) async { hasError = false; Map body = Map(); String url = ""; if (isInpatient) { await getDoctorProfile(); - body['ProjectID'] = doctorProfile.projectID; + body['ProjectID'] = doctorProfile!.projectID; url = GET_PATIENT_LAB_OREDERS; } else { body['isDentalAllowedBackend'] = false; @@ -40,7 +40,7 @@ class LabsService extends BaseService { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); }); } - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: body); @@ -49,17 +49,17 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); - List patientLabSpecialResult = List(); - List labResultList = List(); - List labOrdersResultsList = List(); + List patientLabSpecialResult = []; + List labResultList = []; + List labOrdersResultsList = []; Future getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, - bool isInpatient = false}) async { + {String? projectID, + int? clinicID, + String? invoiceNo, + String? orderNo, + PatiantInformtion? patient, + bool? isInpatient = false}) async { hasError = false; Map body = Map(); @@ -76,16 +76,16 @@ class LabsService extends BaseService { response['ListPLSR'].forEach((hospital) { patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); }); - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: body); } Future getPatientLabResult( - {PatientLabOrders patientLabOrder, - PatiantInformtion patient, - bool isInpatient}) async { + {required PatientLabOrders patientLabOrder, + PatiantInformtion? patient, + required bool isInpatient}) async { hasError = false; String url = ""; @@ -117,16 +117,16 @@ class LabsService extends BaseService { labResultList.add(LabResult.fromJson(lab)); }); } - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: body); } Future getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + {PatientLabOrders? patientLabOrder, + String? procedure, + PatiantInformtion? patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -144,7 +144,7 @@ class LabsService extends BaseService { response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); }); - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: body); @@ -153,7 +153,7 @@ class LabsService extends BaseService { RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { + Future sendLabReportEmail({PatientLabOrders? patientLabOrder}) async { // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; diff --git a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index 42cdafc6..3f8bdf82 100644 --- a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/medical_report/medical_file_reques import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { - List _medicalFileList = List(); + List _medicalFileList = []; List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( @@ -13,7 +13,7 @@ class MedicalFileService extends BaseService { "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", ); - Future getMedicalFile({int mrn}) async { + Future getMedicalFile({int? mrn}) async { _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); _fileRequestModel.iPAdress = "9.9.9.9"; hasError = false; diff --git a/lib/core/service/patient_medical_file/prescription/medicine_service.dart b/lib/core/service/patient_medical_file/prescription/medicine_service.dart index a734354d..1124fc76 100644 --- a/lib/core/service/patient_medical_file/prescription/medicine_service.dart +++ b/lib/core/service/patient_medical_file/prescription/medicine_service.dart @@ -5,8 +5,8 @@ import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_mod import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart'; class MedicineService extends BaseService { - var _pharmacyItemsList = []; - var _pharmaciesList = []; + List? _pharmacyItemsList = []; + List? _pharmaciesList = []; get pharmacyItemsList => _pharmacyItemsList; get pharmaciesList => _pharmaciesList; String searchText=''; @@ -22,7 +22,7 @@ class MedicineService extends BaseService { await baseAppClient.post( PHARMACY_ITEMS_URL, onSuccess: (dynamic response, int statusCode) { - _pharmacyItemsList.clear(); + _pharmacyItemsList!.clear(); _pharmacyItemsList = response['ListPharmcy_Region_enh']; }, onFailure: (String error, int statusCode) { @@ -33,12 +33,12 @@ class MedicineService extends BaseService { ); } - Future getPharmaciesList(int itemId) async { + Future getPharmaciesList(int? itemId) async { _listRequestModel.itemID = itemId; await baseAppClient.post( PHARMACY_LIST_URL, onSuccess: (dynamic response, int statusCode) { - _pharmaciesList.clear(); + _pharmaciesList!.clear(); _pharmaciesList = response['PharmList']; }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index ffbcae9b..12e5d9df 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -16,18 +16,18 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionService extends LookupService { - List _prescriptionList = List(); + List _prescriptionList = []; List get prescriptionList => _prescriptionList; - List _drugsList = List(); + List _drugsList = []; List get drugsList => _drugsList; - List doctorsList = []; + List? doctorsList = []; List allMedicationList = []; List specialityList = []; - List drugToDrug = []; - List get drugToDrugList => drugToDrug; - List itemMedicineList = []; - List itemMedicineListRoute = []; - List itemMedicineListUnit = []; + List? drugToDrug = []; + List? get drugToDrugList => drugToDrug; + List? itemMedicineList = []; + List? itemMedicineListRoute = []; + List? itemMedicineListUnit = []; dynamic boxQuantity; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); @@ -44,7 +44,7 @@ class PrescriptionService extends LookupService { PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); - Future getItem({int itemID}) async { + Future getItem({int? itemID}) async { _itemByMedicineRequestModel = ItemByMedicineRequestModel(medicineCode: itemID); @@ -78,7 +78,7 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { _prescriptionReqModel = PrescriptionReqModel( patientMRN: mrn, ); @@ -94,7 +94,7 @@ class PrescriptionService extends LookupService { }, body: _prescriptionReqModel.toJson()); } - Future getDrugs({String drugName}) async { + Future getDrugs({String? drugName}) async { _drugRequestModel = SearchDrugRequestModel(search: [drugName]); hasError = false; @@ -109,7 +109,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future getMedicationList({String drug = ''}) async { + Future getMedicationList({String? drug = ''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; await baseAppClient.post(SEARCH_DRUG, @@ -159,7 +159,7 @@ class PrescriptionService extends LookupService { } Future getDrugToDrug( - VitalSignData vital, + VitalSignData? vital, List lstAssessments, List allergy, PatiantInformtion patient, @@ -243,7 +243,7 @@ class PrescriptionService extends LookupService { } Future calculateBoxQuantity( - {int freq, int duration, int itemCode, double strength}) async { + {int? freq, int? duration, int? itemCode, double? strength}) async { _boxQuantityRequestModel = CalculateBoxQuantityRequestModel( frequency: freq, duration: duration, diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index eb860141..22e325cf 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -15,14 +15,14 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class PrescriptionsService extends BaseService { - List prescriptionsList = List(); - List prescriptionsOrderList = List(); - List prescriptionInPatientList = List(); + List prescriptionsList = []; + List prescriptionsOrderList = []; + List prescriptionInPatientList = []; InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(); - Future getPrescriptionInPatient({int mrn, String adn}) async { + Future getPrescriptionInPatient({int? mrn, String? adn}) async { _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( patientMRN: mrn, admissionNo: adn, @@ -43,7 +43,7 @@ class PrescriptionsService extends BaseService { }, body: _inPatientPrescriptionRequestModel.toJson()); } - Future getPrescriptions(PatiantInformtion patient) async { + Future getPrescriptions(PatiantInformtion? patient) async { hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; @@ -53,7 +53,7 @@ class PrescriptionsService extends BaseService { response['PatientPrescriptionList'].forEach((prescriptions) { prescriptionsList.add(Prescriptions.fromJson(prescriptions)); }); - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: body); @@ -62,11 +62,11 @@ class PrescriptionsService extends BaseService { RequestPrescriptionReport _requestPrescriptionReport = RequestPrescriptionReport( appointmentNo: 0, isDentalAllowedBackend: false); - List prescriptionReportList = List(); + List prescriptionReportList = []; Future getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + {required Prescriptions prescriptions, + required PatiantInformtion? patient}) async { hasError = false; _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; _requestPrescriptionReport.projectID = prescriptions.projectID; @@ -76,13 +76,13 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; await baseAppClient.postPatient( - prescriptions.isInOutPatient + prescriptions.isInOutPatient! ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportList.clear(); prescriptionReportEnhList.clear(); - if (prescriptions.isInOutPatient) { + if (prescriptions.isInOutPatient!) { response['ListPRM'].forEach((prescriptions) { prescriptionReportList .add(PrescriptionReport.fromJson(prescriptions)); @@ -95,7 +95,7 @@ class PrescriptionsService extends BaseService { .add(PrescriptionReport.fromJson(prescriptions)); }); } - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: _requestPrescriptionReport.toJson()); @@ -108,10 +108,10 @@ class PrescriptionsService extends BaseService { longitude: 0, isDentalAllowedBackend: false, ); - List pharmacyPrescriptionsList = List(); + List pharmacyPrescriptionsList = []; Future getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + {int? itemId, required PatiantInformtion patient}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, @@ -121,7 +121,7 @@ class PrescriptionsService extends BaseService { pharmacyPrescriptionsList .add(PharmacyPrescriptions.fromJson(prescriptions)); }); - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: requestGetListPharmacyForPrescriptions.toJson()); @@ -132,15 +132,15 @@ class PrescriptionsService extends BaseService { isDentalAllowedBackend: false, ); - List prescriptionReportEnhList = List(); + List prescriptionReportEnhList = []; Future getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + {PrescriptionsOrder? prescriptionsOrder, + required PatiantInformtion patient}) async { ///This logic copy from the old app from class [order-history.component.ts] in line 45 - bool isInPatient = false; + bool? isInPatient = false; prescriptionsList.forEach((element) { - if (prescriptionsOrder.appointmentNo == "0") { + if (prescriptionsOrder!.appointmentNo == "0") { if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.clinicID = element.clinicID; @@ -169,11 +169,11 @@ class PrescriptionsService extends BaseService { hasError = false; await baseAppClient.postPatient( - isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + isInPatient! ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportEnhList.clear(); - if (isInPatient) { + if (isInPatient!) { response['ListPRM'].forEach((prescriptions) { prescriptionReportEnhList .add(PrescriptionReportEnh.fromJson(prescriptions)); @@ -186,7 +186,7 @@ class PrescriptionsService extends BaseService { prescriptionReportEnhList.add(reportEnh); }); } - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: _requestPrescriptionReportEnh.toJson()); diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index b403edf0..dfa92d33 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -10,14 +10,14 @@ import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ProcedureService extends BaseService { - List _procedureList = List(); + List _procedureList = []; List get procedureList => _procedureList; - List _valadteProcedureList = List(); + List _valadteProcedureList = []; List get valadteProcedureList => _valadteProcedureList; - List _categoriesList = List(); + List _categoriesList = []; List get categoriesList => _categoriesList; - List procedureslist = List(); - List categoryList = []; + List procedureslist = []; + List? categoryList = []; GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(); @@ -46,7 +46,7 @@ class ProcedureService extends BaseService { //search: ["DENTAL"], ); - Future getProcedure({int mrn}) async { + Future getProcedure({int? mrn}) async { _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(patientMRN: mrn); hasError = false; @@ -74,7 +74,7 @@ class ProcedureService extends BaseService { }, body: Map()); } - Future getProcedureCategory({String categoryName, String categoryID}) async { + Future getProcedureCategory({String? categoryName, String? categoryID}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( search: ["$categoryName"], patientMRN: 0, diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 7cf17753..5db22245 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -6,14 +6,14 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class RadiologyService extends BaseService { - List finalRadiologyList = List(); - String url = ''; + List finalRadiologyList = []; + String? url = ''; Future getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + {int? invoiceNo, + int? lineItem, + int? projectId, + required PatiantInformtion? patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; @@ -23,19 +23,19 @@ class RadiologyService extends BaseService { await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { url = response['Data']; - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: body); } - Future getPatientRadOrders(PatiantInformtion patient, + Future getPatientRadOrders(PatiantInformtion? patient, {isInPatient = false}) async { String url = GET_PATIENT_ORDERS; final Map body = new Map(); if (isInPatient) { url = GET_IN_PATIENT_ORDERS; - body['ProjectID'] = patient.projectId; + body['ProjectID'] = patient!.projectId; } hasError = false; @@ -49,7 +49,7 @@ class RadiologyService extends BaseService { response[label].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); - }, onFailure: (String error, int statusCode) { + }, onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: body); diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 8113c9a7..5aaa3b7a 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -9,17 +9,17 @@ import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.d import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; class SickLeaveService extends BaseService { - Map get sickLeavestatisitics => _statistics; - Map _statistics = {}; + Map? get sickLeavestatisitics => _statistics; + Map? _statistics = {}; List get getOffTimeList => offTime; List offTime = []; - List get getReasons => reasonse; - List reasonse = []; + List? get getReasons => reasonse; + List? reasonse = []; List get getAllSickLeave => _getAllsickLeave; - List _getAllsickLeave = List(); + List _getAllsickLeave = []; - List get coveringDoctorsList => _coveringDoctors; - List _coveringDoctors = []; + List? get coveringDoctorsList => _coveringDoctors; + List? _coveringDoctors = []; List get getAllRescheduleLeave => _getReScheduleLeave; @@ -30,7 +30,7 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; - List getAllSickLeavePatient = List(); + List getAllSickLeavePatient = []; SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); @@ -97,6 +97,7 @@ class SickLeaveService extends BaseService { hasError = false; getAllSickLeavePatient = []; await baseAppClient.postPatient( + GET_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { // Future.value(response); @@ -105,11 +106,12 @@ class SickLeaveService extends BaseService { getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, - onFailure: (String error, int statusCode) { + onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: {'PatientMRN': patientMRN, "Status": 0}, + patient:null ); } @@ -128,11 +130,12 @@ class SickLeaveService extends BaseService { getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, - onFailure: (String error, int statusCode) { + onFailure: (String? error, int statusCode) { hasError = true; super.error = error; }, body: _sickLeavePatientRequestModel.toJson(), + patient:null ); } @@ -147,8 +150,8 @@ class SickLeaveService extends BaseService { _getReScheduleLeave.add(GetRescheduleLeavesResponse.fromJson(v)); }); _getReScheduleLeave.sort((a, b) { - var adate = a.dateTimeFrom; //before -> var adate = a.date; - var bdate = b.dateTimeFrom; //var bdate = b.date; + var adate = a.dateTimeFrom!; //before -> var adate = a.date; + var bdate = b.dateTimeFrom!; //var bdate = b.date; return -adate.compareTo(bdate); }); }, diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index b2e0d603..d32ce675 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -32,7 +32,7 @@ class SOAPService extends LookupService { List patientProgressNoteList = []; List patientAssessmentList = []; - int episodeID; + int? episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index db2deb13..deca1938 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -12,7 +12,7 @@ class UcafService extends LookupService { List patientVitalSignsHistory = []; List patientAssessmentList = []; List orderProcedureList = []; - PrescriptionModel prescriptionList; + PrescriptionModel? prescriptionList; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; diff --git a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart index 1c07aa48..c331019a 100644 --- a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart +++ b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class VitalSignsService extends BaseService { - VitalSignData patientVitalSigns; + VitalSignData? patientVitalSigns; List patientVitalSignsHistory = []; Future getPatientVitalSign(PatiantInformtion patient) async { @@ -35,7 +35,7 @@ class VitalSignsService extends BaseService { } Future getPatientVitalSignsHistory( - PatiantInformtion patient, String fromDate, String toDate) async { + PatiantInformtion patient, String? fromDate, String? toDate) async { patientVitalSigns = null; hasError = false; Map body = Map(); @@ -71,7 +71,7 @@ class VitalSignsService extends BaseService { ); } - Future getOutPatientVitalSignHistory(PatiantInformtion patient, String fromDate, String toDate) async { + Future getOutPatientVitalSignHistory(PatiantInformtion patient, String? fromDate, String? toDate) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; @@ -94,7 +94,7 @@ class VitalSignsService extends BaseService { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); });} }, - onFailure: (String error, int statusCode) { + onFailure: (String? error, int statusCode) { hasError = true; super.error = error.toString(); }, diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 9df347e2..0a5aeaff 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -6,11 +6,11 @@ import '../../locator.dart'; import 'base_view_model.dart'; class DischargedPatientViewModel extends BaseViewModel { - DischargedPatientService _dischargedPatientService = + DischargedPatientService? _dischargedPatientService = locator(); List get myDischargedPatient => - _dischargedPatientService.myDischargedPatients; + _dischargedPatientService!.myDischargedPatients; List filterData = []; @@ -19,9 +19,9 @@ class DischargedPatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < myDischargedPatient.length; i++) { - String firstName = myDischargedPatient[i].firstName.toUpperCase(); - String lastName = myDischargedPatient[i].lastName.toUpperCase(); - String mobile = myDischargedPatient[i].mobileNumber.toUpperCase(); + String firstName = myDischargedPatient[i].firstName!.toUpperCase(); + String lastName = myDischargedPatient[i].lastName!.toUpperCase(); + String mobile = myDischargedPatient[i].mobileNumber!.toUpperCase(); String patientID = myDischargedPatient[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || @@ -40,9 +40,9 @@ class DischargedPatientViewModel extends BaseViewModel { Future getDischargedPatient() async { setState(ViewState.Busy); - await _dischargedPatientService.getDischargedPatient(); - if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + await _dischargedPatientService!.getDischargedPatient(); + if (_dischargedPatientService!.hasError) { + error = _dischargedPatientService!.error; setState(ViewState.Error); } else { filterData = myDischargedPatient; @@ -52,9 +52,9 @@ class DischargedPatientViewModel extends BaseViewModel { Future gtMyDischargeReferralPatient() async { setState(ViewState.Busy); - await _dischargedPatientService.gtMyDischargeReferralPatient(); - if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + await _dischargedPatientService!.gtMyDischargeReferralPatient(); + if (_dischargedPatientService!.hasError) { + error = _dischargedPatientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index 46f48d35..cd054352 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -8,36 +8,36 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../locator.dart'; class InsuranceViewModel extends BaseViewModel { - InsuranceCardService _insuranceCardService = locator(); + InsuranceCardService? _insuranceCardService = locator(); List get insuranceApproval => - _insuranceCardService.insuranceApproval; + _insuranceCardService!.insuranceApproval; List get insuranceApprovalInPatient => - _insuranceCardService.insuranceApprovalInPatient; + _insuranceCardService!.insuranceApprovalInPatient; - Future getInsuranceApproval(PatiantInformtion patient, - {int appointmentNo, int projectId}) async { + Future getInsuranceApproval(PatiantInformtion? patient, + {int? appointmentNo, int? projectId}) async { error = ""; setState(ViewState.Busy); if (appointmentNo != null) - await _insuranceCardService.getInsuranceApproval(patient, + await _insuranceCardService!.getInsuranceApproval(patient, appointmentNo: appointmentNo, projectId: projectId); else - await _insuranceCardService.getInsuranceApproval(patient); - if (_insuranceCardService.hasError) { + await _insuranceCardService!.getInsuranceApproval(patient); + if (_insuranceCardService!.hasError) { error = "No Insurance Approval Found"; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getInsuranceInPatient({int mrn}) async { + Future getInsuranceInPatient({int? mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _insuranceCardService.getInsuranceApprovalInPatient(mrn: mrn); - if (_insuranceCardService.hasError) { - error = _insuranceCardService.error; + await _insuranceCardService!.getInsuranceApprovalInPatient(mrn: mrn); + if (_insuranceCardService!.hasError) { + error = _insuranceCardService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 312d6ebb..ff88457e 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -6,19 +6,19 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import '../../locator.dart'; class PatientMuseViewModel extends BaseViewModel { - PatientMuseService _patientMuseService = locator(); + PatientMuseService? _patientMuseService = locator(); List get patientMuseResultsModelList => - _patientMuseService.patientMuseResultsModelList; + _patientMuseService!.patientMuseResultsModelList; - getECGPatient({int patientType, int patientOutSA, int patientID}) async { + getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { setState(ViewState.Busy); - await _patientMuseService.getECGPatient( + await _patientMuseService!.getECGPatient( patientID: patientID, patientOutSA: patientOutSA, patientType: patientType); - if (_patientMuseService.hasError) { - error = _patientMuseService.error; + if (_patientMuseService!.hasError) { + error = _patientMuseService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index a0cd68d9..d1ce81b3 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -11,39 +11,39 @@ import '../../locator.dart'; import 'base_view_model.dart'; class PatientSearchViewModel extends BaseViewModel { - OutPatientService _outPatientService = locator(); + OutPatientService? _outPatientService = locator(); - List get patientList => _outPatientService.patientList; + List get patientList => _outPatientService!.patientList; List filterData = []; - DateTime selectedFromDate; - DateTime selectedToDate; + DateTime? selectedFromDate; + DateTime? selectedToDate; searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { filterData = []; - for (var i = 0; i < _outPatientService.patientList.length; i++) { + for (var i = 0; i < _outPatientService!.patientList.length; i++) { String firstName = - _outPatientService.patientList[i].firstName.toUpperCase(); + _outPatientService!.patientList[i].firstName!.toUpperCase(); String lastName = - _outPatientService.patientList[i].lastName.toUpperCase(); + _outPatientService!.patientList[i].lastName!.toUpperCase(); String mobile = - _outPatientService.patientList[i].mobileNumber.toUpperCase(); + _outPatientService!.patientList[i].mobileNumber!.toUpperCase(); String patientID = - _outPatientService.patientList[i].patientId.toString(); + _outPatientService!.patientList[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) || mobile.contains(str) || patientID.contains(str)) { - filterData.add(_outPatientService.patientList[i]); + filterData.add(_outPatientService!.patientList[i]); } } notifyListeners(); } else { - filterData = _outPatientService.patientList; + filterData = _outPatientService!.patientList; notifyListeners(); } } @@ -56,17 +56,17 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.Busy); } await getDoctorProfile(isGetProfile: true); - patientSearchRequestModel.doctorID = doctorProfile.doctorID; - await _outPatientService.getOutPatient(patientSearchRequestModel); - if (_outPatientService.hasError) { - error = _outPatientService.error; + patientSearchRequestModel.doctorID = doctorProfile!.doctorID; + await _outPatientService!.getOutPatient(patientSearchRequestModel); + if (_outPatientService!.hasError) { + error = _outPatientService!.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { setState(ViewState.Error); } } else { - filterData = _outPatientService.patientList; + filterData = _outPatientService!.patientList; setState(ViewState.Idle); } } @@ -74,23 +74,23 @@ class PatientSearchViewModel extends BaseViewModel { getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { setState(ViewState.Busy); - await _outPatientService + await _outPatientService! .getPatientFileInformation(patientSearchRequestModel); - if (_outPatientService.hasError) { - error = _outPatientService.error; + if (_outPatientService!.hasError) { + error = _outPatientService!.error; setState(ViewState.Error); } else { - filterData = _outPatientService.patientList; + filterData = _outPatientService!.patientList; setState(ViewState.Idle); } } getPatientBasedOnDate( {item, - PatientSearchRequestModel patientSearchRequestModel, - PatientType selectedPatientType, - bool isSearchWithKeyInfo, - OutPatientFilterType outPatientFilterType}) async { + required PatientSearchRequestModel patientSearchRequestModel, + PatientType? selectedPatientType, + bool? isSearchWithKeyInfo, + OutPatientFilterType? outPatientFilterType}) async { String dateTo; String dateFrom; if (OutPatientFilterType.Previous == outPatientFilterType) { @@ -98,8 +98,8 @@ class PatientSearchViewModel extends BaseViewModel { DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); selectedToDate = DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); - dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); - dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); + dateTo = AppDateUtils.convertDateToFormat(selectedToDate!, 'yyyy-MM-dd'); + dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate!, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, @@ -129,18 +129,18 @@ class PatientSearchViewModel extends BaseViewModel { currentModel.from = dateFrom; currentModel.to = dateTo; await getOutPatient(currentModel, isLocalBusy: true); - filterData = _outPatientService.patientList; + filterData = _outPatientService!.patientList; } - PatientInPatientService _inPatientService = + PatientInPatientService? _inPatientService = locator(); - List get inPatientList => _inPatientService.inPatientList; + List get inPatientList => _inPatientService!.inPatientList; List get myIinPatientList => - _inPatientService.myInPatientList; + _inPatientService!.myInPatientList; - List filteredInPatientItems = List(); + List filteredInPatientItems = []; Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { @@ -148,9 +148,9 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.Busy); if (inPatientList.length == 0) - await _inPatientService.getInPatientList(requestModel, false); - if (_inPatientService.hasError) { - error = _inPatientService.error; + await _inPatientService!.getInPatientList(requestModel, false); + if (_inPatientService!.hasError) { + error = _inPatientService!.error; setState(ViewState.Error); } else { // setDefaultInPatientList(); @@ -167,8 +167,8 @@ class PatientSearchViewModel extends BaseViewModel { } void clearPatientList() { - _inPatientService.inPatientList = []; - _inPatientService.myInPatientList = []; + _inPatientService!.inPatientList = []; + _inPatientService!.myInPatientList = []; } void filterSearchResults(String query) { @@ -176,9 +176,9 @@ class PatientSearchViewModel extends BaseViewModel { if (strExist) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { - String firstName = inPatientList[i].firstName.toUpperCase(); - String lastName = inPatientList[i].lastName.toUpperCase(); - String mobile = inPatientList[i].mobileNumber.toUpperCase(); + String firstName = inPatientList[i].firstName!.toUpperCase(); + String lastName = inPatientList[i].lastName!.toUpperCase(); + String mobile = inPatientList[i].mobileNumber!.toUpperCase(); String patientID = inPatientList[i].patientId.toString(); if (firstName.contains(query.toUpperCase()) || diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 8b789cbc..0b1c978b 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -32,71 +32,71 @@ import '../../locator.dart'; import 'base_view_model.dart'; class SOAPViewModel extends BaseViewModel { - SOAPService _SOAPService = locator(); - PrescriptionService _prescriptionService = locator(); + SOAPService? _SOAPService = locator(); + PrescriptionService? _prescriptionService = locator(); - List get allergiesList => _SOAPService.allergiesList; + List get allergiesList => _SOAPService!.allergiesList; List get allergySeverityList => - _SOAPService.allergySeverityList; + _SOAPService!.allergySeverityList; - List get historyFamilyList => _SOAPService.historyFamilyList; + List get historyFamilyList => _SOAPService!.historyFamilyList; List get historyMedicalList => - _SOAPService.historyMedicalList; + _SOAPService!.historyMedicalList; - List get historySportList => _SOAPService.historySportList; + List get historySportList => _SOAPService!.historySportList; - List get historySocialList => _SOAPService.historySocialList; + List get historySocialList => _SOAPService!.historySocialList; List get historySurgicalList => - _SOAPService.historySurgicalList; + _SOAPService!.historySurgicalList; List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList, ...historySportList]; List get physicalExaminationList => - _SOAPService.physicalExaminationList; + _SOAPService!.physicalExaminationList; List get listOfDiagnosisType => - _SOAPService.listOfDiagnosisType; + _SOAPService!.listOfDiagnosisType; List get listOfDiagnosisCondition => - _SOAPService.listOfDiagnosisCondition; + _SOAPService!.listOfDiagnosisCondition; - List get listOfICD10 => _SOAPService.listOfICD10; + List get listOfICD10 => _SOAPService!.listOfICD10; List get patientChiefComplaintList => - _SOAPService.patientChiefComplaintList; + _SOAPService!.patientChiefComplaintList; List get patientAllergiesList => - _SOAPService.patientAllergiesList; + _SOAPService!.patientAllergiesList; List get patientHistoryList => - _SOAPService.patientHistoryList; + _SOAPService!.patientHistoryList; List get patientPhysicalExamList => - _SOAPService.patientPhysicalExamList; + _SOAPService!.patientPhysicalExamList; List get patientProgressNoteList => - _SOAPService.patientProgressNoteList; + _SOAPService!.patientProgressNoteList; List get patientAssessmentList => - _SOAPService.patientAssessmentList; - int get episodeID => _SOAPService.episodeID; + _SOAPService!.patientAssessmentList; + int? get episodeID => _SOAPService!.episodeID; - get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; - get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; - get medicationRouteList => _SOAPService.medicationRouteListWithModel; - get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; + get medicationStrengthList => _SOAPService!.medicationStrengthListWithModel; + get medicationDoseTimeList => _SOAPService!.medicationDoseTimeListWithModel; + get medicationRouteList => _SOAPService!.medicationRouteListWithModel; + get medicationFrequencyList => _SOAPService!.medicationFrequencyListWithModel; List get allMedicationList => - _prescriptionService.allMedicationList; + _prescriptionService!.allMedicationList; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); - await _SOAPService.getAllergies(getAllergiesRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.getAllergies(getAllergiesRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -108,9 +108,9 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); } else setState(ViewState.Busy); - await _SOAPService.getMasterLookup(masterKeys); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.getMasterLookup(masterKeys); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -118,9 +118,9 @@ class SOAPViewModel extends BaseViewModel { Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postEpisode(postEpisodeReqModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.postEpisode(postEpisodeReqModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -128,9 +128,9 @@ class SOAPViewModel extends BaseViewModel { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postAllergy(postAllergyRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.postAllergy(postAllergyRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -139,9 +139,9 @@ class SOAPViewModel extends BaseViewModel { Future postHistories( PostHistoriesRequestModel postHistoriesRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postHistories(postHistoriesRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.postHistories(postHistoriesRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -150,9 +150,9 @@ class SOAPViewModel extends BaseViewModel { Future postChiefComplaint( PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.postChiefComplaint(postChiefComplaintRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -161,9 +161,9 @@ class SOAPViewModel extends BaseViewModel { Future postPhysicalExam( PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.postPhysicalExam(postPhysicalExamRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -172,9 +172,9 @@ class SOAPViewModel extends BaseViewModel { Future postProgressNote( PostProgressNoteRequestModel postProgressNoteRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postProgressNote(postProgressNoteRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.postProgressNote(postProgressNoteRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -183,9 +183,9 @@ class SOAPViewModel extends BaseViewModel { Future postAssessment( PostAssessmentRequestModel postAssessmentRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postAssessment(postAssessmentRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.postAssessment(postAssessmentRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -193,9 +193,9 @@ class SOAPViewModel extends BaseViewModel { Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.patchAllergy(patchAllergyRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.patchAllergy(patchAllergyRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -204,9 +204,9 @@ class SOAPViewModel extends BaseViewModel { Future patchHistories( PostHistoriesRequestModel patchHistoriesRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.patchHistories(patchHistoriesRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.patchHistories(patchHistoriesRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -215,9 +215,9 @@ class SOAPViewModel extends BaseViewModel { Future patchChiefComplaint( PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.patchChiefComplaint(patchChiefComplaintRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -226,9 +226,9 @@ class SOAPViewModel extends BaseViewModel { Future patchPhysicalExam( PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.patchPhysicalExam(patchPhysicalExamRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -237,9 +237,9 @@ class SOAPViewModel extends BaseViewModel { Future patchProgressNote( PostProgressNoteRequestModel patchProgressNoteRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.patchProgressNote(patchProgressNoteRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -248,9 +248,9 @@ class SOAPViewModel extends BaseViewModel { Future patchAssessment( PatchAssessmentReqModel patchAssessmentRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.patchAssessment(patchAssessmentRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.patchAssessment(patchAssessmentRequestModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -262,9 +262,9 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); } else setState(ViewState.Busy); - await _SOAPService.getPatientAllergy(generalGetReqForSOAP); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.getPatientAllergy(generalGetReqForSOAP); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else @@ -280,9 +280,9 @@ class SOAPViewModel extends BaseViewModel { masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - if (selectedAllergy != null && element.isChecked) + if (selectedAllergy != null && element.isChecked!) allergiesString += - (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + + (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , '; }); return allergiesString; @@ -291,10 +291,10 @@ class SOAPViewModel extends BaseViewModel { Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { setState(ViewState.Busy); - await _SOAPService.getPatientHistories(getHistoryReqModel, + await _SOAPService!.getPatientHistories(getHistoryReqModel, isFirst: isFirst); - if (_SOAPService.hasError) { - error = _SOAPService.error; + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -303,9 +303,9 @@ class SOAPViewModel extends BaseViewModel { Future getPatientChiefComplaint( GetChiefComplaintReqModel getChiefComplaintReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.getPatientChiefComplaint(getChiefComplaintReqModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -314,9 +314,9 @@ class SOAPViewModel extends BaseViewModel { Future getPatientPhysicalExam( GetPhysicalExamReqModel getPhysicalExamReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.getPatientPhysicalExam(getPhysicalExamReqModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -325,9 +325,9 @@ class SOAPViewModel extends BaseViewModel { Future getPatientProgressNote( GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.getPatientProgressNote(getGetProgressNoteReqModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -336,9 +336,9 @@ class SOAPViewModel extends BaseViewModel { Future getPatientAssessment( GetAssessmentReqModel getAssessmentReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientAssessment(getAssessmentReqModel); - if (_SOAPService.hasError) { - error = _SOAPService.error; + await _SOAPService!.getPatientAssessment(getAssessmentReqModel); + if (_SOAPService!.hasError) { + error = _SOAPService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -346,9 +346,9 @@ class SOAPViewModel extends BaseViewModel { Future getMedicationList() async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getMedicationList(); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -356,7 +356,7 @@ class SOAPViewModel extends BaseViewModel { // ignore: missing_return MasterKeyModel getOneMasterKey( - {@required MasterKeysService masterKeys, dynamic id, int typeId}) { + {required MasterKeysService masterKeys, dynamic id, int? typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { @@ -463,7 +463,9 @@ class SOAPViewModel extends BaseViewModel { return result.first; } break; - break; + default: return MasterKeyModel(); + + } } } diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 223b303b..7250dc2b 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -39,35 +39,35 @@ import 'package:provider/provider.dart'; enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED } class AuthenticationViewModel extends BaseViewModel { - AuthenticationService _authService = locator(); - HospitalsService _hospitalsService = locator(); + AuthenticationService? _authService = locator(); + HospitalsService? _hospitalsService = locator(); - List get imeiDetails => _authService.dashboardItemsList; + List get imeiDetails => _authService!.dashboardItemsList; - List get hospitals => _hospitalsService.hospitals; + List get hospitals => _hospitalsService!.hospitals; - NewLoginInformationModel get loginInfo => _authService.loginInfo; + NewLoginInformationModel get loginInfo => _authService!.loginInfo; - List get doctorProfilesList => _authService.doctorProfilesList; + List get doctorProfilesList => _authService!.doctorProfilesList; SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => - _authService.activationCodeVerificationScreenRes; + _authService!.activationCodeVerificationScreenRes; SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => - _authService.activationCodeForDoctorAppRes; + _authService!.activationCodeForDoctorAppRes; CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => - _authService.checkActivationCodeForDoctorAppRes; + _authService!.checkActivationCodeForDoctorAppRes; - NewLoginInformationModel loggedUser; - GetIMEIDetailsModel user; + NewLoginInformationModel? loggedUser; + GetIMEIDetailsModel? user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); - List _availableBiometrics; + List? _availableBiometrics; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); bool isLogin = false; @@ -81,9 +81,9 @@ class AuthenticationViewModel extends BaseViewModel { /// select Device IMEI Future selectDeviceImei(imei) async { setState(ViewState.Busy); - await _authService.selectDeviceImei(imei); - if (_authService.hasError) { - error = _authService.error; + await _authService!.selectDeviceImei(imei); + if (_authService!.hasError) { + error = _authService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -120,9 +120,9 @@ class AuthenticationViewModel extends BaseViewModel { await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = await sharedPref.getString(PASSWORD); - await _authService.insertDeviceImei(insertIMEIDetailsModel); - if (_authService.hasError) { - error = _authService.error; + await _authService!.insertDeviceImei(insertIMEIDetailsModel); + if (_authService!.hasError) { + error = _authService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -132,16 +132,16 @@ class AuthenticationViewModel extends BaseViewModel { /// first step login Future login(UserModel userInfo) async { setState(ViewState.BusyLocal); - await _authService.login(userInfo); - if (_authService.hasError) { - error = _authService.error; + await _authService!.login(userInfo); + if (_authService!.hasError) { + error = _authService!.error; setState(ViewState.ErrorLocal); } else { - sharedPref.setInt(PROJECT_ID, userInfo.projectID); + sharedPref.setInt(PROJECT_ID, userInfo.projectID!); loggedUser = loginInfo; saveObjToString(LOGGED_IN_USER, loginInfo); sharedPref.remove(LAST_LOGIN_USER); - sharedPref.setString(TOKEN, loginInfo.logInTokenID); + sharedPref.setString(TOKEN, loginInfo.logInTokenID!); setState(ViewState.Idle); } } @@ -151,37 +151,37 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( - iMEI: user.iMEI, - facilityId: user.projectID, - memberID: user.doctorID, - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, + iMEI: user!.iMEI, + facilityId: user!.projectID, + memberID: user!.doctorID, + zipCode: user!.outSA == true ? '971' : '966', + mobileNumber: user!.mobile, oTPSendType: authMethodType.getTypeIdService(), isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); - await _authService.sendActivationCodeVerificationScreen(activationCodeModel); - if (_authService.hasError) { - error = _authService.error; + vidaAuthTokenID: user!.vidaAuthTokenID, + vidaRefreshTokenID: user!.vidaRefreshTokenID); + await _authService!.sendActivationCodeVerificationScreen(activationCodeModel); + if (_authService!.hasError) { + error = _authService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password }) async { + Future sendActivationCodeForDoctorApp({AuthMethodTypes? authMethodType, String? password }) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser.listMemberInformation[0].memberID, - zipCode: loggedUser.zipCode, - mobileNumber: loggedUser.mobileNumber, + memberID: loggedUser!.listMemberInformation![0].memberID, + zipCode: loggedUser!.zipCode, + mobileNumber: loggedUser!.mobileNumber, otpSendType: authMethodType.getTypeIdService().toString(), password: password); - await _authService.sendActivationCodeForDoctorApp(activationCodeModel); - if (_authService.hasError) { - error = _authService.error; + await _authService!.sendActivationCodeForDoctorApp(activationCodeModel); + if (_authService!.hasError) { + error = _authService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -189,24 +189,24 @@ class AuthenticationViewModel extends BaseViewModel { /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({String activationCode}) async { + Future checkActivationCodeForDoctorApp({String? activationCode}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( zipCode: - loggedUser != null ? loggedUser.zipCode :user.zipCode, + loggedUser != null ? loggedUser!.zipCode :user!.zipCode, mobileNumber: - loggedUser != null ? loggedUser.mobileNumber : user.mobile, + loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) - : user.projectID, + : user!.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), activationCode: activationCode ?? '0000', oTPSendType: await sharedPref.getInt(OTP_TYPE), generalid: "Cs2020@2016\$2958"); - await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); - if (_authService.hasError) { - error = _authService.error; + await _authService!.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); + if (_authService!.hasError) { + error = _authService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -217,9 +217,9 @@ class AuthenticationViewModel extends BaseViewModel { Future getHospitalsList(memberID) async { GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; - await _hospitalsService.getHospitals(getHospitalsRequestModel); - if (_hospitalsService.hasError) { - error = _hospitalsService.error; + await _hospitalsService!.getHospitals(getHospitalsRequestModel); + if (_hospitalsService!.hasError) { + error = _hospitalsService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -231,24 +231,24 @@ class AuthenticationViewModel extends BaseViewModel { switch (type) { case 1: return TranslationBase - .of(context) + .of(context)! .verifySMS; break; case 3: return TranslationBase - .of(context) + .of(context)! .verifyFingerprint; break; case 4: return TranslationBase - .of(context) + .of(context)! .verifyFaceID; break; case 2: - return TranslationBase.of(context).verifyWhatsApp; + return TranslationBase.of(context)!.verifyWhatsApp; break; default: - return TranslationBase.of(context).verifySMS; + return TranslationBase.of(context)!.verifySMS; break; } } @@ -256,13 +256,13 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { print("VerificationCode : " + - sendActivationCodeForDoctorAppResponseModel.verificationCode); + sendActivationCodeForDoctorAppResponseModel.verificationCode!); sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); sharedPref.setString(LOGIN_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.logInTokenID); + sendActivationCodeForDoctorAppResponseModel.logInTokenID!); } saveObjToString(String key, value) async { @@ -302,9 +302,9 @@ class AuthenticationViewModel extends BaseViewModel { projectID: clinicInfo.projectID, tokenID: '', languageID: 2); - await _authService.getDoctorProfileBasedOnClinic(docInfo); - if (_authService.hasError) { - error = _authService.error; + await _authService!.getDoctorProfileBasedOnClinic(docInfo); + if (_authService!.hasError) { + error = _authService!.error; setState(ViewState.ErrorLocal); } else { localSetDoctorProfile(doctorProfilesList.first); @@ -316,18 +316,18 @@ class AuthenticationViewModel extends BaseViewModel { onCheckActivationCodeSuccess() async { sharedPref.setString( TOKEN, - checkActivationCodeForDoctorAppRes.authenticationTokenID); + checkActivationCodeForDoctorAppRes.authenticationTokenID!); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile + checkActivationCodeForDoctorAppRes.listDoctorProfile! .isNotEmpty) { localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); + checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); } else { sharedPref.setObj( CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic[0] + checkActivationCodeForDoctorAppRes.listDoctorsClinic![0] .toJson()); await getDoctorProfileBasedOnClinic(clinic); } @@ -338,8 +338,8 @@ class AuthenticationViewModel extends BaseViewModel { bool isAvailable = false; await _getAvailableBiometrics(); if (_availableBiometrics != null) { - for (var i = 0; i < _availableBiometrics.length; i++) { - if (biometricType == _availableBiometrics[i]) isAvailable = true; + for (var i = 0; i < _availableBiometrics!.length; i++) { + if (biometricType == _availableBiometrics![i]) isAvailable = true; } } return isAvailable; @@ -365,15 +365,15 @@ class AuthenticationViewModel extends BaseViewModel { if (DEVICE_TOKEN == "") { DEVICE_TOKEN = token; - await _authService.selectDeviceImei(DEVICE_TOKEN); - if (_authService.hasError) { - error = _authService.error; + await _authService!.selectDeviceImei(DEVICE_TOKEN); + if (_authService!.hasError) { + error = _authService!.error; setState(ViewState.ErrorLocal); } else { - if (_authService.dashboardItemsList.length > 0) { - user =_authService.dashboardItemsList[0]; + if (_authService!.dashboardItemsList.length > 0) { + user =_authService!.dashboardItemsList[0]; sharedPref.setObj( - LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + LAST_LOGIN_USER, _authService!.dashboardItemsList[0]); this.unverified = true; } setState(ViewState.Idle); diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index fe4dbd22..1576228b 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -6,14 +6,14 @@ import 'package:flutter/material.dart'; class BaseViewModel extends ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel doctorProfile; + DoctorProfileModel? doctorProfile; ViewState _state = ViewState.Idle; bool isInternetConnection = true; ViewState get state => _state; - String error = ""; + String? error = ""; //TODO add the user login model when we need it @@ -22,12 +22,12 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } - Future getDoctorProfile({bool isGetProfile = false}) async { + Future getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); + doctorProfile = DoctorProfileModel.fromJson(profile as Map); if (doctorProfile != null) { return doctorProfile; } @@ -36,7 +36,7 @@ class BaseViewModel extends ChangeNotifier { if (doctorProfile == null) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); + doctorProfile = DoctorProfileModel.fromJson(profile as Map); if (doctorProfile != null) { return doctorProfile; } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index f37a8feb..af5d6713 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -14,12 +14,12 @@ import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); - DashboardService _dashboardService = locator(); + DashboardService? _dashboardService = locator(); List get dashboardItemsList => - _dashboardService.dashboardItemsList; + _dashboardService!.dashboardItemsList; - Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async{ + Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel? authProvider) async{ setState(ViewState.Busy); await projectsProvider.getDoctorClinicsList(); @@ -35,32 +35,32 @@ class DashboardViewModel extends BaseViewModel { _firebaseMessaging.getToken().then((String token) async { if (token != '') { DEVICE_TOKEN = token; - authProvider.insertDeviceImei(); + authProvider!.insertDeviceImei(); } }); } Future getDashboard() async { setState(ViewState.Busy); - await _dashboardService.getDashboard(); - if (_dashboardService.hasError) { - error = _dashboardService.error; + await _dashboardService!.getDashboard(); + if (_dashboardService!.hasError) { + error = _dashboardService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic(int? clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ProfileReqModel docInfo = new ProfileReqModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID, clinicID: clinicId, license: true, - projectID: doctorProfile.projectID, + projectID: doctorProfile!.projectID, tokenID: '', languageID: 2); - ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: doctorProfile.clinicID, projectID: doctorProfile.projectID,); + ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile!.doctorID,clinicID: doctorProfile!.clinicID, projectID: doctorProfile!.projectID,); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if(authProvider.state == ViewState.ErrorLocal) { error = authProvider.error; @@ -69,7 +69,7 @@ class DashboardViewModel extends BaseViewModel { getPatientCount(DashboardModel inPatientCount) { int value = 0; - inPatientCount.summaryoptions.forEach((result) => {value += result.value}); + inPatientCount.summaryoptions!.forEach((result) => {value += result.value!}); return value.toString(); } diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 18f1a9f5..6d9f7007 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -6,16 +6,16 @@ import '../../locator.dart'; import 'base_view_model.dart'; class DoctorReplayViewModel extends BaseViewModel { - DoctorReplyService _doctorReplyService = locator(); + DoctorReplyService? _doctorReplyService = locator(); List get listDoctorWorkingHoursTable => - _doctorReplyService.listDoctorWorkingHoursTable; + _doctorReplyService!.listDoctorWorkingHoursTable; Future getDoctorReply() async { setState(ViewState.Busy); - await _doctorReplyService.getDoctorReply(); - if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + await _doctorReplyService!.getDoctorReply(); + if (_doctorReplyService!.hasError) { + error = _doctorReplyService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -24,9 +24,9 @@ class DoctorReplayViewModel extends BaseViewModel { Future replay( String referredDoctorRemarks, ListGtMyPatientsQuestions model) async { setState(ViewState.BusyLocal); - await _doctorReplyService.replay(referredDoctorRemarks, model); - if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + await _doctorReplyService!.replay(referredDoctorRemarks, model); + if (_doctorReplyService!.hasError) { + error = _doctorReplyService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/hospitals_view_model.dart b/lib/core/viewModel/hospitals_view_model.dart index c0ce1bc4..27353800 100644 --- a/lib/core/viewModel/hospitals_view_model.dart +++ b/lib/core/viewModel/hospitals_view_model.dart @@ -10,16 +10,16 @@ import 'base_view_model.dart'; class HospitalViewModel extends BaseViewModel { - HospitalsService _hospitalsService = locator(); + HospitalsService? _hospitalsService = locator(); // List get imeiDetails => _authService.dashboardItemsList; // get loginInfo => _authService.loginInfo; Future getHospitalsList(memberID) async { GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; setState(ViewState.Busy); - await _hospitalsService.getHospitals(getHospitalsRequestModel); - if (_hospitalsService.hasError) { - error = _hospitalsService.error; + await _hospitalsService!.getHospitals(getHospitalsRequestModel); + if (_hospitalsService!.hasError) { + error = _hospitalsService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 90e9b327..c6506342 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -13,13 +13,13 @@ import 'base_view_model.dart'; class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; - LabsService _labsService = locator(); + LabsService? _labsService = locator(); List get labOrdersResultsList => - _labsService.labOrdersResultsList; + _labsService!.labOrdersResultsList; - List _patientLabOrdersListClinic = List(); - List _patientLabOrdersListHospital = List(); + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; List get patientLabOrdersList => filterType == FilterType.Clinic @@ -28,12 +28,12 @@ class LabsViewModel extends BaseViewModel { void getLabs(PatiantInformtion patient) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersList(patient, true); - if (_labsService.hasError) { - error = _labsService.error; + await _labsService!.getPatientLabOrdersList(patient, true); + if (_labsService!.hasError) { + error = _labsService!.error; setState(ViewState.Error); } else { - _labsService.patientLabOrdersList.forEach((element) { + _labsService!.patientLabOrdersList.forEach((element) { List patientLabOrdersClinic = _patientLabOrdersListClinic .where((elementClinic) => @@ -82,33 +82,33 @@ class LabsViewModel extends BaseViewModel { } List get patientLabSpecialResult => - _labsService.patientLabSpecialResult; + _labsService!.patientLabSpecialResult; - List get labResultList => _labsService.labResultList; + List get labResultList => _labsService!.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; } getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, - bool isInpatient}) async { + {String? projectID, + int? clinicID, + String? invoiceNo, + String? orderNo, + PatiantInformtion? patient, + bool? isInpatient}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult( + await _labsService!.getLaboratoryResult( invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient, isInpatient: isInpatient); - if (_labsService.hasError) { - error = _labsService.error; + if (_labsService!.hasError) { + error = _labsService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -116,19 +116,19 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResult( - {PatientLabOrders patientLabOrder, - PatiantInformtion patient, - bool isInpatient}) async { + {required PatientLabOrders patientLabOrder, + PatiantInformtion? patient, + required bool isInpatient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult( + await _labsService!.getPatientLabResult( patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); - if (_labsService.hasError) { - error = _labsService.error; + if (_labsService!.hasError) { + error = _labsService!.error; setState(ViewState.Error); } else { - _labsService.labResultList.forEach((element) { + _labsService!.labResultList.forEach((element) { List patientLabOrdersClinic = labResultLists .where( (elementClinic) => elementClinic.filterName == element.testCode) @@ -148,35 +148,35 @@ class LabsViewModel extends BaseViewModel { } getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + {PatientLabOrders? patientLabOrder, + String? procedure, + PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults( + await _labsService!.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); - if (_labsService.hasError) { - error = _labsService.error; + if (_labsService!.hasError) { + error = _labsService!.error; setState(ViewState.Error); } else { bool isShouldClear = false; - if (_labsService.labOrdersResultsList.length == 1) { + if (_labsService!.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || - element.resultValue.contains('*') || - element.resultValue.isEmpty) isShouldClear = true; + if (element.resultValue!.contains('/') || + element.resultValue!.contains('*') || + element.resultValue!.isEmpty) isShouldClear = true; }); } - if (isShouldClear) _labsService.labOrdersResultsList.clear(); + if (isShouldClear) _labsService!.labOrdersResultsList.clear(); setState(ViewState.Idle); } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); - if (_labsService.hasError) { - error = _labsService.error; + sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { + await _labsService!.sendLabReportEmail(patientLabOrder: patientLabOrder); + if (_labsService!.hasError) { + error = _labsService!.error; } else DrAppToastMsg.showSuccesToast(mes); } diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index 555e19cf..78dd5cbb 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -1,16 +1,16 @@ class GetRescheduleLeavesResponse { - int clinicId; + int? clinicId; var coveringDoctorId; - String date; - String dateTimeFrom; - String dateTimeTo; - int doctorId; - int reasonId; - int requisitionNo; - int requisitionType; - int status; - String createdOn; - String statusDescription; + String? date; + String? dateTimeFrom; + String? dateTimeTo; + int? doctorId; + int? reasonId; + int? requisitionNo; + int? requisitionType; + int? status; + String? createdOn; + String? statusDescription; GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index f6ef42e7..62b79d20 100644 --- a/lib/core/viewModel/livecare_view_model.dart +++ b/lib/core/viewModel/livecare_view_model.dart @@ -16,7 +16,7 @@ class LiveCareViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); List liveCarePendingList = []; - StartCallRes inCallResponse; + StartCallRes? inCallResponse; var transferToAdmin = {}; var endCallResponse = {}; bool isFinished = true; diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 08e8ce90..a9f60c28 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -6,18 +6,18 @@ import 'package:doctor_app_flutter/locator.dart'; class MedicalFileViewModel extends BaseViewModel { bool hasError = false; - MedicalFileService _medicalFileService = locator(); + MedicalFileService? _medicalFileService = locator(); List get medicalFileList => - _medicalFileService.medicalFileList; + _medicalFileService!.medicalFileList; - Future getMedicalFile({int mrn}) async { + Future getMedicalFile({int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _medicalFileService.getMedicalFile(mrn: mrn); - if (_medicalFileService.hasError) { - error = _medicalFileService.error; + await _medicalFileService!.getMedicalFile(mrn: mrn); + if (_medicalFileService!.hasError) { + error = _medicalFileService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index d49b8cc3..d7b4df4d 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -11,56 +11,56 @@ import '../../locator.dart'; import 'base_view_model.dart'; class MedicineViewModel extends BaseViewModel { - MedicineService _medicineService = locator(); - PrescriptionService _prescriptionService = locator(); + MedicineService? _medicineService = locator(); + PrescriptionService? _prescriptionService = locator(); - get pharmacyItemsList => _medicineService.pharmacyItemsList; - get searchText => _medicineService.searchText; - get pharmaciesList => _medicineService.pharmaciesList; + get pharmacyItemsList => _medicineService!.pharmacyItemsList; + get searchText => _medicineService!.searchText; + get pharmaciesList => _medicineService!.pharmaciesList; - get medicationStrengthList => _prescriptionService.medicationStrengthList; + get medicationStrengthList => _prescriptionService!.medicationStrengthList; - get medicationDurationList => _prescriptionService.medicationDurationList; + get medicationDurationList => _prescriptionService!.medicationDurationList; - get medicationRouteList => _prescriptionService.medicationRouteList; + get medicationRouteList => _prescriptionService!.medicationRouteList; - get medicationFrequencyList => _prescriptionService.medicationFrequencyList; - get boxQuintity => _prescriptionService.boxQuantity; + get medicationFrequencyList => _prescriptionService!.medicationFrequencyList; + get boxQuintity => _prescriptionService!.boxQuantity; get medicationIndicationsList => - _prescriptionService.medicationIndicationsList; + _prescriptionService!.medicationIndicationsList; - get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList; + get medicationDoseTimeList => _prescriptionService!.medicationDoseTimeList; List get patientAssessmentList => - _prescriptionService.patientAssessmentList; + _prescriptionService!.patientAssessmentList; List get allMedicationList => - _prescriptionService.allMedicationList; - List get itemMedicineList => _prescriptionService.itemMedicineList; - List get itemMedicineListRoute => - _prescriptionService.itemMedicineListRoute; - List get itemMedicineListUnit => - _prescriptionService.itemMedicineListUnit; - - Future getItem({int itemID}) async { + _prescriptionService!.allMedicationList; + List? get itemMedicineList => _prescriptionService!.itemMedicineList; + List? get itemMedicineListRoute => + _prescriptionService!.itemMedicineListRoute; + List? get itemMedicineListUnit => + _prescriptionService!.itemMedicineListUnit; + + Future getItem({int? itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _prescriptionService.getItem(itemID: itemID); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getItem(itemID: itemID); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _prescriptionService.getPrescription(mrn: mrn); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getPrescription(mrn: mrn); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -68,19 +68,19 @@ class MedicineViewModel extends BaseViewModel { Future getMedicineItem(String itemName) async { setState(ViewState.Busy); - await _medicineService.getMedicineItem(itemName); - if (_medicineService.hasError) { - error = _medicineService.error; + await _medicineService!.getMedicineItem(itemName); + if (_medicineService!.hasError) { + error = _medicineService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMedicationList({String drug}) async { + Future getMedicationList({String? drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getMedicationList(drug: drug); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -89,9 +89,9 @@ class MedicineViewModel extends BaseViewModel { Future getPatientAssessment( GetAssessmentReqModel getAssessmentReqModel) async { setState(ViewState.Busy); - await _prescriptionService.getPatientAssessment(getAssessmentReqModel); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getPatientAssessment(getAssessmentReqModel); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -99,10 +99,10 @@ class MedicineViewModel extends BaseViewModel { Future getMedicationStrength() async { setState(ViewState.Busy); - await _prescriptionService + await _prescriptionService! .getMasterLookup(MasterKeysService.MedicationStrength); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -110,10 +110,10 @@ class MedicineViewModel extends BaseViewModel { Future getMedicationRoute() async { setState(ViewState.Busy); - await _prescriptionService + await _prescriptionService! .getMasterLookup(MasterKeysService.MedicationRoute); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -121,10 +121,10 @@ class MedicineViewModel extends BaseViewModel { Future getMedicationIndications() async { setState(ViewState.Busy); - await _prescriptionService + await _prescriptionService! .getMasterLookup(MasterKeysService.MedicationIndications); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -132,10 +132,10 @@ class MedicineViewModel extends BaseViewModel { Future getMedicationDoseTime() async { setState(ViewState.Busy); - await _prescriptionService + await _prescriptionService! .getMasterLookup(MasterKeysService.MedicationDoseTime); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -143,10 +143,10 @@ class MedicineViewModel extends BaseViewModel { Future getMedicationFrequency() async { setState(ViewState.Busy); - await _prescriptionService + await _prescriptionService! .getMasterLookup(MasterKeysService.MedicationFrequency); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -154,38 +154,38 @@ class MedicineViewModel extends BaseViewModel { Future getMedicationDuration() async { setState(ViewState.Busy); - await _prescriptionService + await _prescriptionService! .getMasterLookup(MasterKeysService.MedicationDuration); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } Future getBoxQuantity( - {int itemCode, int duration, double strength, int freq}) async { + {int? itemCode, int? duration, double? strength, int? freq}) async { setState(ViewState.Busy); - await _prescriptionService.calculateBoxQuantity( + await _prescriptionService!.calculateBoxQuantity( strength: strength, itemCode: itemCode, duration: duration, freq: freq); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPharmaciesList(int itemId) async { + Future getPharmaciesList(int? itemId) async { setState(ViewState.Busy); - await _medicineService.getPharmaciesList(itemId); - if (_medicineService.hasError) { - error = _medicineService.error; + await _medicineService!.getPharmaciesList(itemId); + if (_medicineService!.hasError) { + error = _medicineService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - dynamic getLookupById(List list, String id) { + dynamic getLookupById(List list, String? id) { for (int i = 0; i < list.length; i++) { if (list[i]['id'].toString() == id) { return list[i]; @@ -194,7 +194,7 @@ class MedicineViewModel extends BaseViewModel { return null; } - dynamic getLookupByIdFilter(List list, String id) { + dynamic getLookupByIdFilter(List list, String? id) { for (int i = 0; i < list.length; i++) { if (list[i]['parameterCode'].toString() == id) { return list[i]; diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 0868b601..c3b3f573 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -7,63 +7,63 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import '../../locator.dart'; class AdmissionRequestViewModel extends BaseViewModel { - AdmissionRequestService _admissionRequestService = + AdmissionRequestService? _admissionRequestService = locator(); - List get clinicList => _admissionRequestService.clinicList; + List get clinicList => _admissionRequestService!.clinicList; - List get doctorsList => _admissionRequestService.doctorsList; + List? get doctorsList => _admissionRequestService!.doctorsList; - List get speciality => _admissionRequestService.specialityList; + List get speciality => _admissionRequestService!.specialityList; - List get floorList => _admissionRequestService.floorList; + List get floorList => _admissionRequestService!.floorList; - List get wardList => _admissionRequestService.wardList; + List get wardList => _admissionRequestService!.wardList; List get roomCategoryList => - _admissionRequestService.roomCategoryList; + _admissionRequestService!.roomCategoryList; List get admissionTypeList => - _admissionRequestService.listOfAdmissionType; + _admissionRequestService!.listOfAdmissionType; List get diagnosisTypesList => - _admissionRequestService.diagnosisTypesList; + _admissionRequestService!.diagnosisTypesList; List get allergiesList => - _admissionRequestService.allergiesLookupList; + _admissionRequestService!.allergiesLookupList; - List get dietTypesList => _admissionRequestService.dietTypesList; + List get dietTypesList => _admissionRequestService!.dietTypesList; - List get icdCodes => _admissionRequestService.icdCodes; + List get icdCodes => _admissionRequestService!.icdCodes; List get listOfDiagnosisSelectionTypes => - _admissionRequestService.listOfDiagnosisSelectionTypes; + _admissionRequestService!.listOfDiagnosisSelectionTypes; - AdmissionRequest admissionRequestData; + AdmissionRequest? admissionRequestData; Future getSpecialityList() async { await getMasterLookup(MasterKeysService.Speciality); - if (!_admissionRequestService.hasError) { - _admissionRequestService.setSpecialityList(); + if (!_admissionRequestService!.hasError) { + _admissionRequestService!.setSpecialityList(); await getClinicDoctors(1); } } Future getClinics() async { setState(ViewState.BusyLocal); - await _admissionRequestService.getClinics(); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getClinics(); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getClinicDoctors(int clinicId) async { + Future getClinicDoctors(int? clinicId) async { setState(ViewState.BusyLocal); - await _admissionRequestService.getDoctorsList(clinicId); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getDoctorsList(clinicId); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -71,9 +71,9 @@ class AdmissionRequestViewModel extends BaseViewModel { Future getFloors() async { setState(ViewState.BusyLocal); - await _admissionRequestService.getFloors(); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getFloors(); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -81,9 +81,9 @@ class AdmissionRequestViewModel extends BaseViewModel { Future getWards() async { setState(ViewState.BusyLocal); - await _admissionRequestService.getWardList(); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getWardList(); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -91,9 +91,9 @@ class AdmissionRequestViewModel extends BaseViewModel { Future getRoomCategories() async { setState(ViewState.BusyLocal); - await _admissionRequestService.getRoomCategories(); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getRoomCategories(); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -101,9 +101,9 @@ class AdmissionRequestViewModel extends BaseViewModel { Future getDiagnosis() async { setState(ViewState.BusyLocal); - await _admissionRequestService.getDiagnosisTypesList(); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getDiagnosisTypesList(); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -111,26 +111,26 @@ class AdmissionRequestViewModel extends BaseViewModel { Future getAllergies() async { await getMasterLookup(MasterKeysService.Allergies); - if (!_admissionRequestService.hasError) { - _admissionRequestService.setAllergies(); + if (!_admissionRequestService!.hasError) { + _admissionRequestService!.setAllergies(); } } - Future getDietTypes(int patientMrn) async { + Future getDietTypes(int? patientMrn) async { setState(ViewState.BusyLocal); - await _admissionRequestService.getDietTypesList(patientMrn); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getDietTypesList(patientMrn); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getICDCodes(int patientMrn) async { + Future getICDCodes(int? patientMrn) async { setState(ViewState.BusyLocal); - await _admissionRequestService.getICDCodes(patientMrn); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getICDCodes(patientMrn); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -138,9 +138,9 @@ class AdmissionRequestViewModel extends BaseViewModel { Future makeAdmissionRequest() async { setState(ViewState.Busy); - await _admissionRequestService.makeAdmissionRequest(admissionRequestData); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.makeAdmissionRequest(admissionRequestData!); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -148,9 +148,9 @@ class AdmissionRequestViewModel extends BaseViewModel { Future getMasterLookup(MasterKeysService keysService) async { setState(ViewState.BusyLocal); - await _admissionRequestService.getMasterLookup(keysService); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + await _admissionRequestService!.getMasterLookup(keysService); + if (_admissionRequestService!.hasError) { + error = _admissionRequestService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index a414c200..6bf897a5 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -18,51 +18,51 @@ import 'package:flutter/cupertino.dart'; import '../../locator.dart'; class PatientReferralViewModel extends BaseViewModel { - PatientReferralService _referralPatientService = + PatientReferralService? _referralPatientService = locator(); - ReferralService _referralService = locator(); + ReferralService? _referralService = locator(); - MyReferralInPatientService _myReferralService = + MyReferralInPatientService? _myReferralService = locator(); - DischargedPatientService _dischargedPatientService = + DischargedPatientService? _dischargedPatientService = locator(); List get myDischargeReferralPatient => - _dischargedPatientService.myDischargeReferralPatients; + _dischargedPatientService!.myDischargeReferralPatients; - List get branchesList => _referralPatientService.projectsList; + List? get branchesList => _referralPatientService!.projectsList; - List get clinicsList => _referralPatientService.clinicsList; + List? get clinicsList => _referralPatientService!.clinicsList; - List get referralFrequencyList => - _referralPatientService.frequencyList; + List? get referralFrequencyList => + _referralPatientService!.frequencyList; List doctorsList = []; List get clinicDoctorsList => - _referralPatientService.doctorsList; + _referralPatientService!.doctorsList; List get myReferralPatients => - _myReferralService.myReferralPatients; + _myReferralService!.myReferralPatients; List get listMyReferredPatientModel => - _referralPatientService.listMyReferredPatientModel; + _referralPatientService!.listMyReferredPatientModel; List get pendingReferral => - _referralPatientService.pendingReferralList; + _referralPatientService!.pendingReferralList; List get patientReferral => - _referralPatientService.patientReferralList; + _referralPatientService!.patientReferralList; List get patientArrivalList => - _referralPatientService.patientArrivalList; + _referralPatientService!.patientArrivalList; Future getPatientReferral(PatiantInformtion patient) async { setState(ViewState.Busy); - await _referralPatientService.getPatientReferral(patient); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getPatientReferral(patient); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else { if (patientReferral.length == 0) { @@ -75,9 +75,9 @@ class PatientReferralViewModel extends BaseViewModel { Future getMasterLookup(MasterKeysService masterKeys) async { setState(ViewState.Busy); - await _referralPatientService.getMasterLookup(masterKeys); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getMasterLookup(masterKeys); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else await getBranches(); @@ -85,32 +85,32 @@ class PatientReferralViewModel extends BaseViewModel { Future getBranches() async { setState(ViewState.BusyLocal); - await _referralPatientService.getReferralFacilities(); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getReferralFacilities(); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - Future getClinics(int projectId) async { + Future getClinics(int? projectId) async { setState(ViewState.BusyLocal); - await _referralPatientService.getClinicsList(projectId); - await _referralPatientService.getProjectInfo(projectId); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getClinicsList(projectId); + await _referralPatientService!.getProjectInfo(projectId); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } Future getClinicDoctors( - PatiantInformtion patient, int clinicId, int branchId) async { + PatiantInformtion patient, int? clinicId, int? branchId) async { setState(ViewState.BusyLocal); - await _referralPatientService.getDoctorsList(patient, clinicId, branchId); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getDoctorsList(patient, clinicId, branchId); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.ErrorLocal); } else { doctorsList.clear(); @@ -122,7 +122,7 @@ class PatientReferralViewModel extends BaseViewModel { } Future getDoctorBranch() async { - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { dynamic _selectedBranch = { "facilityId": doctorProfile.projectID, @@ -135,9 +135,9 @@ class PatientReferralViewModel extends BaseViewModel { Future getMyReferredPatient() async { setState(ViewState.Busy); - await _referralPatientService.getMyReferredPatient(); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getMyReferredPatient(); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -149,9 +149,9 @@ class PatientReferralViewModel extends BaseViewModel { Future getPendingReferralPatients() async { setState(ViewState.Busy); - await _referralPatientService.getPendingReferralList(); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getPendingReferralList(); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -159,9 +159,9 @@ class PatientReferralViewModel extends BaseViewModel { Future getMyReferralPatientService() async { setState(ViewState.Busy); - await _myReferralService.getMyReferralPatientService(); - if (_myReferralService.hasError) { - error = _myReferralService.error; + await _myReferralService!.getMyReferralPatientService(); + if (_myReferralService!.hasError) { + error = _myReferralService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -170,9 +170,9 @@ class PatientReferralViewModel extends BaseViewModel { Future replay( String referredDoctorRemarks, MyReferralPatientModel referral) async { setState(ViewState.Busy); - await _myReferralService.replay(referredDoctorRemarks, referral); - if (_myReferralService.hasError) { - error = _myReferralService.error; + await _myReferralService!.replay(referredDoctorRemarks, referral); + if (_myReferralService!.hasError) { + error = _myReferralService!.error; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); @@ -181,21 +181,21 @@ class PatientReferralViewModel extends BaseViewModel { Future responseReferral( PendingReferral pendingReferral, bool isAccepted) async { setState(ViewState.Busy); - await _referralPatientService.responseReferral(pendingReferral, isAccepted); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.responseReferral(pendingReferral, isAccepted); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } Future makeReferral(PatiantInformtion patient, String isoStringDate, - int projectID, int clinicID, int doctorID, String remarks) async { + int? projectID, int? clinicID, int? doctorID, String remarks) async { setState(ViewState.Busy); - await _referralPatientService.makeReferral( + await _referralPatientService!.makeReferral( patient, isoStringDate, projectID, clinicID, doctorID, remarks); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -203,17 +203,17 @@ class PatientReferralViewModel extends BaseViewModel { } Future makeInPatientReferral( - {PatiantInformtion patient, - int projectID, - int clinicID, - int doctorID, - int frequencyCode, - int priority, - String referralDate, - String remarks, - String ext}) async { + {required PatiantInformtion patient, + int? projectID, + int? clinicID, + int? doctorID, + int? frequencyCode, + int? priority, + String? referralDate, + String? remarks, + String? ext}) async { setState(ViewState.Busy); - await _referralService.referralPatient( + await _referralService!.referralPatient( patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, @@ -225,8 +225,8 @@ class PatientReferralViewModel extends BaseViewModel { frequency: frequencyCode, extension: ext, ); - if (_referralService.hasError) { - error = _referralService.error; + if (_referralService!.hasError) { + error = _referralService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -234,13 +234,13 @@ class PatientReferralViewModel extends BaseViewModel { } Future getPatientDetails( - String fromDate, String toDate, int patientMrn, int appointmentNo) async { + String fromDate, String toDate, int? patientMrn, int? appointmentNo) async { setState(ViewState.Busy); - await _referralPatientService.getPatientArrivalList(toDate, + await _referralPatientService!.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -249,9 +249,9 @@ class PatientReferralViewModel extends BaseViewModel { Future getReferralFrequencyList() async { setState(ViewState.Busy); - await _referralPatientService.getReferralFrequencyList(); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getReferralFrequencyList(); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -260,9 +260,9 @@ class PatientReferralViewModel extends BaseViewModel { Future verifyReferralDoctorRemarks( MyReferredPatientModel referredPatient) async { setState(ViewState.Busy); - await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.verifyReferralDoctorRemarks(referredPatient); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.ErrorLocal); } else { getMyReferredPatient(); @@ -272,26 +272,26 @@ class PatientReferralViewModel extends BaseViewModel { Future gtMyDischargeReferralPatient() async { setState(ViewState.Busy); - await _dischargedPatientService.gtMyDischargeReferralPatient(); - if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + await _dischargedPatientService!.gtMyDischargeReferralPatient(); + if (_dischargedPatientService!.hasError) { + error = _dischargedPatientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - String getReferralStatusNameByCode(int statusCode, BuildContext context) { + String? getReferralStatusNameByCode(int? statusCode, BuildContext context) { switch (statusCode) { case 1: - return TranslationBase.of(context).pending /*referralStatusHold*/; + return TranslationBase.of(context)!.pending /*referralStatusHold*/; case 2: - return TranslationBase.of(context).accepted /*referralStatusActive*/; + return TranslationBase.of(context)!.accepted /*referralStatusActive*/; case 4: - return TranslationBase.of(context).rejected /*referralStatusCancelled*/; + return TranslationBase.of(context)!.rejected /*referralStatusCancelled*/; case 46: - return TranslationBase.of(context).accepted /*referralStatusCompleted*/; + return TranslationBase.of(context)!.accepted /*referralStatusCompleted*/; case 63: - return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; + return TranslationBase.of(context)!.rejected /*referralStatusNotSeen*/; default: return "-"; } diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index b6887061..0ecf6b5c 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -16,27 +16,27 @@ import 'package:flutter/material.dart'; import '../../locator.dart'; class UcafViewModel extends BaseViewModel { - UcafService _ucafService = locator(); + UcafService? _ucafService = locator(); List get patientChiefComplaintList => - _ucafService.patientChiefComplaintList; + _ucafService!.patientChiefComplaintList; List get patientVitalSignsHistory => - _ucafService.patientVitalSignsHistory; + _ucafService!.patientVitalSignsHistory; List get patientAssessmentList => - _ucafService.patientAssessmentList; + _ucafService!.patientAssessmentList; - List get diagnosisTypes => _ucafService.listOfDiagnosisType; + List get diagnosisTypes => _ucafService!.listOfDiagnosisType; List get diagnosisConditions => - _ucafService.listOfDiagnosisCondition; + _ucafService!.listOfDiagnosisCondition; - PrescriptionModel get prescriptionList => _ucafService.prescriptionList; + PrescriptionModel? get prescriptionList => _ucafService!.prescriptionList; - List get orderProcedures => _ucafService.orderProcedureList; + List get orderProcedures => _ucafService!.orderProcedureList; - String selectedLanguage; + String? selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -46,9 +46,9 @@ class UcafViewModel extends BaseViewModel { String bloodPressure = "0 / 0"; resetDataInFirst() { - _ucafService.patientAssessmentList = []; - _ucafService.orderProcedureList = []; - _ucafService.prescriptionList = null; + _ucafService!.patientAssessmentList = []; + _ucafService!.orderProcedureList = []; + _ucafService!.prescriptionList = null; } Future getLanguage() async { @@ -58,8 +58,8 @@ class UcafViewModel extends BaseViewModel { Future getUCAFData(PatiantInformtion patient) async { setState(ViewState.Busy); - String from; - String to; + String? from; + String? to; if (from == null || from == "0") { from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } @@ -68,11 +68,11 @@ class UcafViewModel extends BaseViewModel { } // await _ucafService.getPatientVitalSignsHistory(patient, from, to); - await _ucafService.getInPatientVitalSignHistory(patient, false); - await _ucafService.getPatientChiefComplaint(patient); + await _ucafService!.getInPatientVitalSignHistory(patient, false); + await _ucafService!.getPatientChiefComplaint(patient); - if (_ucafService.hasError) { - error = _ucafService.error; + if (_ucafService!.hasError) { + error = _ucafService!.error; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { @@ -110,24 +110,24 @@ class UcafViewModel extends BaseViewModel { } } - Future getPatientAssessment(PatiantInformtion patient) async { + Future getPatientAssessment(PatiantInformtion? patient) async { if (patientAssessmentList.isEmpty) { setState(ViewState.Busy); - await _ucafService.getPatientAssessment(patient); - if (_ucafService.hasError) { - error = _ucafService.error; + await _ucafService!.getPatientAssessment(patient!); + if (_ucafService!.hasError) { + error = _ucafService!.error; setState(ViewState.Error); } else { if (patientAssessmentList.isNotEmpty) { if (diagnosisConditions.length == 0) { - await _ucafService + await _ucafService! .getMasterLookup(MasterKeysService.DiagnosisCondition); } if (diagnosisTypes.length == 0) { - await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); + await _ucafService!.getMasterLookup(MasterKeysService.DiagnosisType); } - if (_ucafService.hasError) { - error = _ucafService.error; + if (_ucafService!.hasError) { + error = _ucafService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -137,12 +137,12 @@ class UcafViewModel extends BaseViewModel { } } - Future getOrderProcedures(PatiantInformtion patient) async { + Future getOrderProcedures(PatiantInformtion? patient) async { if (orderProcedures.isEmpty) { setState(ViewState.Busy); - await _ucafService.getOrderProcedures(patient); - if (_ucafService.hasError) { - error = _ucafService.error; + await _ucafService!.getOrderProcedures(patient!); + if (_ucafService!.hasError) { + error = _ucafService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -150,12 +150,12 @@ class UcafViewModel extends BaseViewModel { } } - Future getPrescription(PatiantInformtion patient) async { + Future getPrescription(PatiantInformtion? patient) async { if (prescriptionList == null) { setState(ViewState.Busy); - await _ucafService.getPrescription(patient); - if (_ucafService.hasError) { - error = _ucafService.error; + await _ucafService!.getPrescription(patient!); + if (_ucafService!.hasError) { + error = _ucafService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -163,8 +163,8 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel findMasterDataById( - {@required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel? findMasterDataById( + {required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { @@ -191,9 +191,9 @@ class UcafViewModel extends BaseViewModel { Future postUCAF(PatiantInformtion patient) async { setState(ViewState.Busy); - await _ucafService.postUCAF(patient); - if (_ucafService.hasError) { - error = _ucafService.error; + await _ucafService!.postUCAF(patient); + if (_ucafService!.hasError) { + error = _ucafService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); // but with empty list diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index bab2ff9f..358a7aa2 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -9,12 +9,12 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel { - VitalSignsService _vitalSignService = locator(); + VitalSignsService? _vitalSignService = locator(); - VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; + VitalSignData? get patientVitalSigns => _vitalSignService!.patientVitalSigns; List get patientVitalSignsHistory => - _vitalSignService.patientVitalSignsHistory; + _vitalSignService!.patientVitalSignsHistory; String heightCm = "0"; String weightKg = "0"; @@ -33,17 +33,17 @@ class VitalSignsViewModel extends BaseViewModel { Future getPatientVitalSign(PatiantInformtion patient) async { setState(ViewState.Busy); - await _vitalSignService.getPatientVitalSign(patient); - if (_vitalSignService.hasError) { - error = _vitalSignService.error; + await _vitalSignService!.getPatientVitalSign(patient); + if (_vitalSignService!.hasError) { + error = _vitalSignService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - Future getPatientVitalSignHistory(PatiantInformtion patient, String from, - String to, bool isInPatient) async { + Future getPatientVitalSignHistory(PatiantInformtion? patient, String? from, + String? to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -53,13 +53,13 @@ class VitalSignsViewModel extends BaseViewModel { } if (isInPatient) { - await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + await _vitalSignService!.getPatientVitalSignsHistory(patient!, from, to); } else { - await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to); + await _vitalSignService!.getOutPatientVitalSignHistory(patient!, from, to); } - if (_vitalSignService.hasError) { - error = _vitalSignService.error; + if (_vitalSignService!.hasError) { + error = _vitalSignService!.error; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { @@ -150,7 +150,7 @@ class VitalSignsViewModel extends BaseViewModel { } } - String getTempratureMethod(int temperatureCelciusMethod) { + String getTempratureMethod(int? temperatureCelciusMethod) { // temperatureCelciusMethod ( vital sign response field )- master 2005 if (temperatureCelciusMethod == 1) { return "Oral"; @@ -162,6 +162,8 @@ class VitalSignsViewModel extends BaseViewModel { return "Tympanic"; } else if (temperatureCelciusMethod == 5) { return "Temporal"; + }else { + return ''; } } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index de40afde..99c31dca 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -15,42 +15,42 @@ import '../../locator.dart'; import 'base_view_model.dart'; class PatientViewModel extends BaseViewModel { - PatientService _patientService = locator(); + PatientService? _patientService = locator(); List get patientVitalSignList => - _patientService.patientVitalSignList; + _patientService!.patientVitalSignList; List get patientVitalSignOrderdSubList => - _patientService.patientVitalSignOrderdSubList; + _patientService!.patientVitalSignOrderdSubList; List get patientLabResultOrdersList => - _patientService.patientLabResultOrdersList; + _patientService!.patientLabResultOrdersList; List get patientPrescriptionsList => - _patientService.patientPrescriptionsList; + _patientService!.patientPrescriptionsList; List get prescriptionReportForInPatientList => - _patientService.prescriptionReportForInPatientList; + _patientService!.prescriptionReportForInPatientList; List get prescriptionReport => - _patientService.prescriptionReport; + _patientService!.prescriptionReport; List get patientRadiologyList => - _patientService.patientRadiologyList; + _patientService!.patientRadiologyList; - List get labResultList => _patientService.labResultList; + List get labResultList => _patientService!.labResultList; - get insuranceApporvalsList => _patientService.insuranceApporvalsList; + get insuranceApporvalsList => _patientService!.insuranceApporvalsList; List get patientProgressNoteList => - _patientService.patientProgressNoteList; + _patientService!.patientProgressNoteList; - List get clinicsList => _patientService.clinicsList; + List? get clinicsList => _patientService!.clinicsList; - List get doctorsList => _patientService.doctorsList; + List? get doctorsList => _patientService!.doctorsList; - List get referralFrequencyList => - _patientService.referalFrequancyList; + List? get referralFrequencyList => + _patientService!.referalFrequancyList; Future getPatientList(patient, patientType, {bool isBusyLocal = false, isView}) async { @@ -60,11 +60,11 @@ class PatientViewModel extends BaseViewModel { } else { setState(ViewState.Busy); } - localRes = await _patientService.getPatientList(patient, patientType, + localRes = await _patientService!.getPatientList(patient, patientType, isView: isView); - if (_patientService.hasError) { - error = _patientService.error; + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -74,9 +74,9 @@ class PatientViewModel extends BaseViewModel { Future getLabResultOrders(patient) async { setState(ViewState.Busy); - await _patientService.getLabResultOrders(patient); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getLabResultOrders(patient); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -84,9 +84,9 @@ class PatientViewModel extends BaseViewModel { Future getOutPatientPrescriptions(patient) async { setState(ViewState.Busy); - await _patientService.getOutPatientPrescriptions(patient); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getOutPatientPrescriptions(patient); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -94,9 +94,9 @@ class PatientViewModel extends BaseViewModel { Future getInPatientPrescriptions(patient) async { setState(ViewState.Busy); - await _patientService.getInPatientPrescriptions(patient); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getInPatientPrescriptions(patient); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -104,9 +104,9 @@ class PatientViewModel extends BaseViewModel { Future getPrescriptionReport(patient) async { setState(ViewState.Busy); - await _patientService.getPrescriptionReport(patient); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getPrescriptionReport(patient); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -114,9 +114,9 @@ class PatientViewModel extends BaseViewModel { Future getPatientRadiology(patient) async { setState(ViewState.Busy); - await _patientService.getPatientRadiology(patient); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getPatientRadiology(patient); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -124,9 +124,9 @@ class PatientViewModel extends BaseViewModel { Future getLabResult(LabOrdersResModel labOrdersResModel) async { setState(ViewState.Busy); - await _patientService.getLabResult(labOrdersResModel); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getLabResult(labOrdersResModel); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -134,9 +134,9 @@ class PatientViewModel extends BaseViewModel { Future getPatientInsuranceApprovals(patient) async { setState(ViewState.Busy); - await _patientService.getPatientInsuranceApprovals(patient); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getPatientInsuranceApprovals(patient); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -149,9 +149,9 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); } - await _patientService.getPatientProgressNote(patient); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getPatientProgressNote(patient); + if (_patientService!.hasError) { + error = _patientService!.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -163,9 +163,9 @@ class PatientViewModel extends BaseViewModel { Future updatePatientProgressNote(UpdateNoteReqModel req) async { setState(ViewState.BusyLocal); - await _patientService.updatePatientProgressNote(req); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.updatePatientProgressNote(req); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -173,9 +173,9 @@ class PatientViewModel extends BaseViewModel { Future createPatientProgressNote(CreateNoteModel req) async { setState(ViewState.BusyLocal); - await _patientService.createPatientProgressNote(req); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.createPatientProgressNote(req); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -183,9 +183,9 @@ class PatientViewModel extends BaseViewModel { Future getClinicsList() async { setState(ViewState.Busy); - await _patientService.getClinicsList(); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getClinicsList(); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else { { @@ -197,9 +197,9 @@ class PatientViewModel extends BaseViewModel { Future getDoctorsList(int clinicId) async { setState(ViewState.BusyLocal); - await _patientService.getDoctorsList(clinicId); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getDoctorsList(clinicId); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.ErrorLocal); } else { { @@ -209,15 +209,15 @@ class PatientViewModel extends BaseViewModel { } } - List getDoctorNameList() { - var doctorNamelist = _patientService.doctorsList + List? getDoctorNameList() { + var doctorNamelist = _patientService!.doctorsList .map((value) => value['DoctorName'].toString()) .toList(); return doctorNamelist; } - List getClinicNameList() { - var clinicsNameslist = _patientService.clinicsList + List? getClinicNameList() { + var clinicsNameslist = _patientService!.clinicsList .map((value) => value['ClinicDescription'].toString()) .toList(); return clinicsNameslist; @@ -225,35 +225,35 @@ class PatientViewModel extends BaseViewModel { Future getReferralFrequancyList() async { setState(ViewState.Busy); - await _patientService.getReferralFrequancyList(); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getReferralFrequancyList(); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - List getReferralNamesList() { - var referralNamesList = _patientService.referalFrequancyList + List? getReferralNamesList() { + var referralNamesList = _patientService!.referalFrequancyList .map((value) => value['Description'].toString()) .toList(); return referralNamesList; } Future referToDoctor( - {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + {String? selectedDoctorID, + String? selectedClinicID, + int? admissionNo, + String? extension, + String? priority, + String? frequency, + String? referringDoctorRemarks, + int? patientID, + int? patientTypeID, + String? roomID, + int? projectID}) async { setState(ViewState.BusyLocal); - await _patientService.referToDoctor( + await _patientService!.referToDoctor( selectedClinicID: selectedClinicID, selectedDoctorID: selectedDoctorID, admissionNo: admissionNo, @@ -265,8 +265,8 @@ class PatientViewModel extends BaseViewModel { patientTypeID: patientTypeID, roomID: roomID, projectID: projectID); - if (_patientService.hasError) { - error = _patientService.error; + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -274,9 +274,9 @@ class PatientViewModel extends BaseViewModel { Future getArrivedList() async { setState(ViewState.Busy); - await _patientService.getArrivedList(); - if (_patientService.hasError) { - error = _patientService.error; + await _patientService!.getArrivedList(); + if (_patientService!.hasError) { + error = _patientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 902268da..8096af34 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -25,32 +25,32 @@ import 'package:flutter/cupertino.dart'; class PrescriptionViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; bool hasError = false; - PrescriptionService _prescriptionService = locator(); + PrescriptionService? _prescriptionService = locator(); List get allMedicationList => - _prescriptionService.allMedicationList; + _prescriptionService!.allMedicationList; List get prescriptionList => - _prescriptionService.prescriptionList; - List get drugsList => _prescriptionService.doctorsList; + _prescriptionService!.prescriptionList; + List? get drugsList => _prescriptionService!.doctorsList; //List get allMedicationList => _prescriptionService.allMedicationList; - List get drugToDrug => _prescriptionService.drugToDrugList; + List? get drugToDrug => _prescriptionService!.drugToDrugList; - List get itemMedicineList => _prescriptionService.itemMedicineList; - PrescriptionsService _prescriptionsService = locator(); + List? get itemMedicineList => _prescriptionService!.itemMedicineList; + PrescriptionsService? _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List _prescriptionsOrderListClinic = []; + List _prescriptionsOrderListHospital = []; List get prescriptionReportList => - _prescriptionsService.prescriptionReportList; + _prescriptionsService!.prescriptionReportList; List get prescriptionsList => - _prescriptionsService.prescriptionsList; + _prescriptionsService!.prescriptionsList; List get pharmacyPrescriptionsList => - _prescriptionsService.pharmacyPrescriptionsList; + _prescriptionsService!.pharmacyPrescriptionsList; List get prescriptionReportEnhList => - _prescriptionsService.prescriptionReportEnhList; + _prescriptionsService!.prescriptionReportEnhList; List get prescriptionsOrderList => filterType == FilterType.Clinic @@ -58,14 +58,14 @@ class PrescriptionViewModel extends BaseViewModel { : _prescriptionsOrderListHospital; List get inPatientPrescription => - _prescriptionsService.prescriptionInPatientList; + _prescriptionsService!.prescriptionInPatientList; getPrescriptionsInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); error = ""; - await _prescriptionsService.getPrescriptionInPatient( + await _prescriptionsService!.getPrescriptionInPatient( mrn: patient.patientId, adn: patient.admissionNo); - if (_prescriptionsService.hasError) { + if (_prescriptionsService!.hasError) { error = "No Prescription Found"; setState(ViewState.Error); } else { @@ -76,38 +76,38 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getItem({int itemID}) async { + Future getItem({int? itemID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); - await _prescriptionService.getItem(itemID: itemID); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getItem(itemID: itemID); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _prescriptionService.getPrescription(mrn: mrn); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getPrescription(mrn: mrn); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } Future postPrescription( - PostPrescriptionReqModel postProcedureReqModel, int mrn) async { + PostPrescriptionReqModel postProcedureReqModel, int? mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _prescriptionService.postPrescription(postProcedureReqModel); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.postPrescription(postProcedureReqModel); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -115,24 +115,24 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getMedicationList({String drug}) async { + Future getMedicationList({String? drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getMedicationList(drug: drug); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); } Future updatePrescription( - PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { + PostPrescriptionReqModel updatePrescriptionReqModel, int? mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _prescriptionService.updatePrescription(updatePrescriptionReqModel); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.updatePrescription(updatePrescriptionReqModel); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -140,30 +140,30 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getDrugs({String drugName}) async { + Future getDrugs({String? drugName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); - await _prescriptionService.getDrugs(drugName: drugName); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + await _prescriptionService!.getDrugs(drugName: drugName); + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } Future getDrugToDrug( - VitalSignData vital, + VitalSignData? vital, List lstAssessments, List allergy, PatiantInformtion patient, List prescription) async { hasError = false; setState(ViewState.Busy); - await _prescriptionService.getDrugToDrug( + await _prescriptionService!.getDrugToDrug( vital, lstAssessments, allergy, patient, prescription); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; + if (_prescriptionService!.hasError) { + error = _prescriptionService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -175,13 +175,13 @@ class PrescriptionViewModel extends BaseViewModel { } getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + {required Prescriptions prescriptions, + required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport( + await _prescriptionsService!.getPrescriptionReport( prescriptions: prescriptions, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -189,12 +189,12 @@ class PrescriptionViewModel extends BaseViewModel { } getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + {int? itemId, required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions( + await _prescriptionsService!.getListPharmacyForPrescriptions( itemId: itemId, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -202,7 +202,7 @@ class PrescriptionViewModel extends BaseViewModel { } void _filterList() { - _prescriptionsService.prescriptionsList.forEach((element) { + _prescriptionsService!.prescriptionsList.forEach((element) { /// PrescriptionsList list sort clinic List prescriptionsByClinic = _prescriptionsOrderListClinic @@ -241,13 +241,13 @@ class PrescriptionViewModel extends BaseViewModel { } getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + {PrescriptionsOrder? prescriptionsOrder, + required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh( + await _prescriptionsService!.getPrescriptionReportEnh( prescriptionsOrder: prescriptionsOrder, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -255,20 +255,20 @@ class PrescriptionViewModel extends BaseViewModel { } _getPrescriptionsOrders() async { - await _prescriptionsService.getPrescriptionsOrders(); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + await _prescriptionsService!.getPrescriptionsOrders(); + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getPrescriptions(PatiantInformtion patient, {String patientType}) async { + getPrescriptions(PatiantInformtion? patient, {String? patientType}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptions(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + await _prescriptionsService!.getPrescriptions(patient); + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; if (patientType == "7") setState(ViewState.ErrorLocal); else diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index b5916bac..992c0427 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -14,21 +14,21 @@ import 'base_view_model.dart'; class PrescriptionsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; - PrescriptionsService _prescriptionsService = locator(); + PrescriptionsService? _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List _prescriptionsOrderListClinic = []; + List _prescriptionsOrderListHospital = []; List get prescriptionReportList => - _prescriptionsService.prescriptionReportList; + _prescriptionsService!.prescriptionReportList; List get prescriptionsList => - _prescriptionsService.prescriptionsList; + _prescriptionsService!.prescriptionsList; List get pharmacyPrescriptionsList => - _prescriptionsService.pharmacyPrescriptionsList; + _prescriptionsService!.pharmacyPrescriptionsList; List get prescriptionReportEnhList => - _prescriptionsService.prescriptionReportEnhList; + _prescriptionsService!.prescriptionReportEnhList; List get prescriptionsOrderList => filterType == FilterType.Clinic @@ -37,9 +37,9 @@ class PrescriptionsViewModel extends BaseViewModel { getPrescriptions(PatiantInformtion patient) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptions(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + await _prescriptionsService!.getPrescriptions(patient); + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.Error); } else { _filterList(); @@ -50,9 +50,9 @@ class PrescriptionsViewModel extends BaseViewModel { } _getPrescriptionsOrders() async { - await _prescriptionsService.getPrescriptionsOrders(); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + await _prescriptionsService!.getPrescriptionsOrders(); + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -60,7 +60,7 @@ class PrescriptionsViewModel extends BaseViewModel { } void _filterList() { - _prescriptionsService.prescriptionsList.forEach((element) { + _prescriptionsService!.prescriptionsList.forEach((element) { /// PrescriptionsList list sort clinic List prescriptionsByClinic = _prescriptionsOrderListClinic @@ -104,13 +104,13 @@ class PrescriptionsViewModel extends BaseViewModel { } getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + {required Prescriptions prescriptions, + required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport( + await _prescriptionsService!.getPrescriptionReport( prescriptions: prescriptions, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -118,12 +118,12 @@ class PrescriptionsViewModel extends BaseViewModel { } getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + {int? itemId, required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions( + await _prescriptionsService!.getListPharmacyForPrescriptions( itemId: itemId, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -131,13 +131,13 @@ class PrescriptionsViewModel extends BaseViewModel { } getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + {PrescriptionsOrder? prescriptionsOrder, + required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh( + await _prescriptionsService!.getPrescriptionReportEnh( prescriptionsOrder: prescriptionsOrder, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + if (_prescriptionsService!.hasError) { + error = _prescriptionsService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 32a40e7e..ba1b0aa4 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -23,42 +23,42 @@ import 'package:flutter/cupertino.dart'; class ProcedureViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; bool hasError = false; - ProcedureService _procedureService = locator(); + ProcedureService? _procedureService = locator(); List get procedureList => - _procedureService.procedureList; + _procedureService!.procedureList; List get valadteProcedureList => - _procedureService.valadteProcedureList; + _procedureService!.valadteProcedureList; List get categoriesList => - _procedureService.categoriesList; - List get categoryList => _procedureService.categoryList; - RadiologyService _radiologyService = locator(); - LabsService _labsService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + _procedureService!.categoriesList; + List? get categoryList => _procedureService!.categoryList; + RadiologyService? _radiologyService = locator(); + LabsService? _labsService = locator(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; List get radiologyList => - _radiologyService.finalRadiologyList; + _radiologyService!.finalRadiologyList; List get patientLabOrdersList => - _labsService.patientLabOrdersList; + _labsService!.patientLabOrdersList; List get labOrdersResultsList => - _labsService.labOrdersResultsList; + _labsService!.labOrdersResultsList; - List _patientLabOrdersListClinic = List(); - List _patientLabOrdersListHospital = List(); + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; - Future getProcedure({int mrn, String patientType}) async { + Future getProcedure({int? mrn, String? patientType}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedure(mrn: mrn); - if (_procedureService.hasError) { - error = _procedureService.error; + await _procedureService!.getProcedure(mrn: mrn); + if (_procedureService!.hasError) { + error = _procedureService!.error; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -67,14 +67,14 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName, String categoryID}) async { + Future getProcedureCategory({String? categoryName, String? categoryID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedureCategory( + await _procedureService!.getProcedureCategory( categoryName: categoryName, categoryID: categoryID); - if (_procedureService.hasError) { - error = _procedureService.error; + if (_procedureService!.hasError) { + error = _procedureService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -84,22 +84,22 @@ class ProcedureViewModel extends BaseViewModel { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getCategory(); - if (_procedureService.hasError) { - error = _procedureService.error; + await _procedureService!.getCategory(); + if (_procedureService!.hasError) { + error = _procedureService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } Future postProcedure( - PostProcedureReqModel postProcedureReqModel, int mrn) async { + PostProcedureReqModel postProcedureReqModel, int? mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.postProcedure(postProcedureReqModel); - if (_procedureService.hasError) { - error = _procedureService.error; + await _procedureService!.postProcedure(postProcedureReqModel); + if (_procedureService!.hasError) { + error = _procedureService!.error; setState(ViewState.ErrorLocal); } else { await getProcedure(mrn: mrn); @@ -112,9 +112,9 @@ class ProcedureViewModel extends BaseViewModel { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.valadteProcedure(procedureValadteRequestModel); - if (_procedureService.hasError) { - error = _procedureService.error; + await _procedureService!.valadteProcedure(procedureValadteRequestModel); + if (_procedureService!.hasError) { + error = _procedureService!.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -122,33 +122,33 @@ class ProcedureViewModel extends BaseViewModel { } Future updateProcedure( - {UpdateProcedureRequestModel updateProcedureRequestModel, - int mrn}) async { + {required UpdateProcedureRequestModel updateProcedureRequestModel, + int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.updateProcedure(updateProcedureRequestModel); - if (_procedureService.hasError) { - error = _procedureService.error; + await _procedureService!.updateProcedure(updateProcedureRequestModel); + if (_procedureService!.hasError) { + error = _procedureService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient, - {String patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion? patient, + {String? patientType, bool isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, + await _radiologyService!.getPatientRadOrders(patient, isInPatient: isInPatient); - if (_radiologyService.hasError) { - error = _radiologyService.error; + if (_radiologyService!.hasError) { + error = _radiologyService!.error; if (patientType == "7") setState(ViewState.ErrorLocal); else setState(ViewState.ErrorLocal); } else { - _radiologyService.finalRadiologyList.forEach((element) { + _radiologyService!.finalRadiologyList.forEach((element) { List finalRadiologyListClinic = _finalRadiologyListClinic .where((elementClinic) => @@ -189,21 +189,21 @@ class ProcedureViewModel extends BaseViewModel { } } - String get radImageURL => _radiologyService.url; + String? get radImageURL => _radiologyService!.url; getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + {int? invoiceNo, + int? lineItem, + int? projectId, + required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL( + await _radiologyService!.getRadImageURL( invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); - if (_radiologyService.hasError) { - error = _radiologyService.error; + if (_radiologyService!.hasError) { + error = _radiologyService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -215,21 +215,21 @@ class ProcedureViewModel extends BaseViewModel { } List get patientLabSpecialResult => - _labsService.patientLabSpecialResult; + _labsService!.patientLabSpecialResult; - List get labResultList => _labsService.labResultList; + List get labResultList => _labsService!.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; } - void getLabs(PatiantInformtion patient, {bool isInpatient = false}) async { + void getLabs(PatiantInformtion? patient, {bool isInpatient = false}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersList(patient, isInpatient); - if (_labsService.hasError) { - error = _labsService.error; + await _labsService!.getPatientLabOrdersList(patient, isInpatient); + if (_labsService!.hasError) { + error = _labsService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -237,20 +237,20 @@ class ProcedureViewModel extends BaseViewModel { } getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient}) async { + {String? projectID, + int? clinicID, + String? invoiceNo, + String? orderNo, + PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult( + await _labsService!.getLaboratoryResult( invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); - if (_labsService.hasError) { - error = _labsService.error; + if (_labsService!.hasError) { + error = _labsService!.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -258,15 +258,15 @@ class ProcedureViewModel extends BaseViewModel { } getPatientLabResult( - {PatientLabOrders patientLabOrder, PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder, patient: patient); - if (_labsService.hasError) { - error = _labsService.error; + await _labsService!.getPatientLabResult( + patientLabOrder: patientLabOrder, patient: patient, isInpatient: false); + if (_labsService!.hasError) { + error = _labsService!.error; setState(ViewState.Error); } else { - _labsService.labResultList.forEach((element) { + _labsService!.labResultList.forEach((element) { List patientLabOrdersClinic = labResultLists .where( (elementClinic) => elementClinic.filterName == element.testCode) @@ -277,7 +277,7 @@ class ProcedureViewModel extends BaseViewModel { labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] .patientLabResultList .where((e) => - e.sampleCollectedOn == element.sampleCollectedOn && + e!.sampleCollectedOn == element.sampleCollectedOn && e.resultValue == element.resultValue) .toList(); if (value.isEmpty) @@ -294,35 +294,35 @@ class ProcedureViewModel extends BaseViewModel { } getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + {PatientLabOrders? patientLabOrder, + String? procedure, + PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults( + await _labsService!.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); - if (_labsService.hasError) { - error = _labsService.error; + if (_labsService!.hasError) { + error = _labsService!.error; setState(ViewState.Error); } else { bool isShouldClear = false; - if (_labsService.labOrdersResultsList.length == 1) { + if (_labsService!.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || - element.resultValue.contains('*') || - element.resultValue.isEmpty) isShouldClear = true; + if (element.resultValue!.contains('/') || + element.resultValue!.contains('*') || + element.resultValue!.isEmpty) isShouldClear = true; }); } - if (isShouldClear) _labsService.labOrdersResultsList.clear(); + if (isShouldClear) _labsService!.labOrdersResultsList.clear(); setState(ViewState.Idle); } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); - if (_labsService.hasError) { - error = _labsService.error; + sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { + await _labsService!.sendLabReportEmail(patientLabOrder: patientLabOrder); + if (_labsService!.hasError) { + error = _labsService!.error; } else DrAppToastMsg.showSuccesToast(mes); } diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index f464df0e..05391093 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -17,7 +17,7 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); - Locale _appLocale; + Locale? _appLocale; String currentLanguage = 'ar'; bool _isArabic = false; bool isInternetConnection = true; @@ -27,10 +27,10 @@ class ProjectViewModel with ChangeNotifier { String error = ''; BaseAppClient baseAppClient = BaseAppClient(); - Locale get appLocal => _appLocale; + Locale? get appLocal => _appLocale; bool get isArabic => _isArabic; - StreamSubscription subscription; + StreamSubscription? subscription; ProjectViewModel() { loadSharedPrefLanguage(); @@ -86,7 +86,7 @@ class ProjectViewModel with ChangeNotifier { @override void dispose() { - if (subscription != null) subscription.cancel(); + if (subscription != null) subscription!.cancel(); super.dispose(); } @@ -114,7 +114,7 @@ class ProjectViewModel with ChangeNotifier { void getProfile() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile as Map); ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: doctorProfile.clinicID, projectID: doctorProfile.projectID,); await Provider.of(AppGlobal.CONTEX, listen: false) diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index d656de6c..836aa86f 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -10,10 +10,10 @@ import 'base_view_model.dart'; class RadiologyViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; - RadiologyService _radiologyService = locator(); + RadiologyService? _radiologyService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => filterType == FilterType.Clinic @@ -23,13 +23,13 @@ class RadiologyViewModel extends BaseViewModel { void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, + await _radiologyService!.getPatientRadOrders(patient, isInPatient: isInPatient); - if (_radiologyService.hasError) { - error = _radiologyService.error; + if (_radiologyService!.hasError) { + error = _radiologyService!.error; setState(ViewState.Error); } else { - _radiologyService.finalRadiologyList.forEach((element) { + _radiologyService!.finalRadiologyList.forEach((element) { List finalRadiologyListClinic = _finalRadiologyListClinic .where((elementClinic) => @@ -70,21 +70,21 @@ class RadiologyViewModel extends BaseViewModel { } } - String get radImageURL => _radiologyService.url; + String? get radImageURL => _radiologyService!.url; getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + {int? invoiceNo, + int? lineItem, + int? projectId, + required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL( + await _radiologyService!.getRadImageURL( invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); - if (_radiologyService.hasError) { - error = _radiologyService.error; + if (_radiologyService!.hasError) { + error = _radiologyService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index 892284e2..e0e041fa 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -6,17 +6,17 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ReferralPatientViewModel extends BaseViewModel { - ReferralPatientService _referralPatientService = + ReferralPatientService? _referralPatientService = locator(); List get listMyReferralPatientModel => - _referralPatientService.listMyReferralPatientModel; + _referralPatientService!.listMyReferralPatientModel; Future getMyReferralPatient() async { setState(ViewState.Busy); - await _referralPatientService.getMyReferralPatient(); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getMyReferralPatient(); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -25,9 +25,9 @@ class ReferralPatientViewModel extends BaseViewModel { Future replay( String referredDoctorRemarks, MyReferralPatientModel model) async { setState(ViewState.BusyLocal); - await _referralPatientService.replay(referredDoctorRemarks, model); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.replay(referredDoctorRemarks, model); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/referred_view_model.dart b/lib/core/viewModel/referred_view_model.dart index 173aa60a..e3550249 100644 --- a/lib/core/viewModel/referred_view_model.dart +++ b/lib/core/viewModel/referred_view_model.dart @@ -6,17 +6,17 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ReferredPatientViewModel extends BaseViewModel { - ReferredPatientService _referralPatientService = + ReferredPatientService? _referralPatientService = locator(); List get listMyReferredPatientModel => - _referralPatientService.listMyReferredPatientModel; + _referralPatientService!.listMyReferredPatientModel; Future getMyReferredPatient() async { setState(ViewState.Busy); - await _referralPatientService.getMyReferredPatient(); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; + await _referralPatientService!.getMyReferredPatient(); + if (_referralPatientService!.hasError) { + error = _referralPatientService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index 3ee64c9b..4db7966c 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -6,16 +6,16 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ScheduleViewModel extends BaseViewModel { - ScheduleService _scheduleService = locator(); + ScheduleService? _scheduleService = locator(); List get listDoctorWorkingHoursTable => - _scheduleService.listDoctorWorkingHoursTable; + _scheduleService!.listDoctorWorkingHoursTable; Future getDoctorSchedule() async { setState(ViewState.Busy); - await _scheduleService.getDoctorSchedule(); - if (_scheduleService.hasError) { - error = _scheduleService.error; + await _scheduleService!.getDoctorSchedule(); + if (_scheduleService!.hasError) { + error = _scheduleService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index b768cc9d..b5709121 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -7,21 +7,21 @@ import '../../locator.dart'; import 'base_view_model.dart'; class SickLeaveViewModel extends BaseViewModel { - SickLeaveService _sickLeaveService = locator(); - get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; - get getAllSIckLeave => _sickLeaveService.getAllSickLeave; - get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient; - List get allOffTime => _sickLeaveService.getOffTimeList; - List get allReasons => _sickLeaveService.getReasons; - List get coveringDoctors => _sickLeaveService.coveringDoctorsList; - get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; - get postSechedule => _sickLeaveService.postReschedule; - get sickleaveResponse => _sickLeaveService.sickLeaveResponse; + SickLeaveService? _sickLeaveService = locator(); + get sickLeaveStatistics => _sickLeaveService!.sickLeavestatisitics; + get getAllSIckLeave => _sickLeaveService!.getAllSickLeave; + get getAllSIckLeavePatient => _sickLeaveService!.getAllSickLeavePatient; + List get allOffTime => _sickLeaveService!.getOffTimeList; + List? get allReasons => _sickLeaveService!.getReasons; + List? get coveringDoctors => _sickLeaveService!.coveringDoctorsList; + get getReschduleLeave => _sickLeaveService!.getAllRescheduleLeave; + get postSechedule => _sickLeaveService!.postReschedule; + get sickleaveResponse => _sickLeaveService!.sickLeaveResponse; Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.Busy); - await _sickLeaveService.addSickLeave(addSickLeaveRequest); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.addSickLeave(addSickLeaveRequest); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -29,9 +29,9 @@ class SickLeaveViewModel extends BaseViewModel { Future extendSickLeave(GetAllSickLeaveResponse extendSickLeaveRequest) async { setState(ViewState.Busy); - await _sickLeaveService.extendSickLeave(extendSickLeaveRequest); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.extendSickLeave(extendSickLeaveRequest); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -39,9 +39,9 @@ class SickLeaveViewModel extends BaseViewModel { Future preSickLeaveStatistics(appoNo, patientMRN) async { setState(ViewState.Busy); - await _sickLeaveService.getStatistics(appoNo, patientMRN); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.getStatistics(appoNo, patientMRN); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -49,9 +49,9 @@ class SickLeaveViewModel extends BaseViewModel { Future getSickLeave(patientMRN) async { setState(ViewState.Busy); - await _sickLeaveService.getSickLeave(patientMRN); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.getSickLeave(patientMRN); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -59,9 +59,9 @@ class SickLeaveViewModel extends BaseViewModel { Future getSickLeavePatient(patientMRN) async { setState(ViewState.Busy); - await _sickLeaveService.getSickLeavePatient(patientMRN); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.getSickLeavePatient(patientMRN); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -69,9 +69,9 @@ class SickLeaveViewModel extends BaseViewModel { Future getRescheduleLeave() async { setState(ViewState.Busy); - await _sickLeaveService.getRescheduleLeave(); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.getRescheduleLeave(); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -79,9 +79,9 @@ class SickLeaveViewModel extends BaseViewModel { Future getOffTime() async { setState(ViewState.Busy); - await _sickLeaveService.getOffTime(); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.getOffTime(); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -89,9 +89,9 @@ class SickLeaveViewModel extends BaseViewModel { Future getReasons(id) async { setState(ViewState.Busy); - await _sickLeaveService.getReasonsByID(id: id); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.getReasonsByID(id: id); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -99,9 +99,9 @@ class SickLeaveViewModel extends BaseViewModel { Future getCoveringDoctors() async { //setState(ViewState.Busy); - await _sickLeaveService.getCoveringDoctors(); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.getCoveringDoctors(); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; // setState(ViewState.Error); } //else @@ -110,10 +110,10 @@ class SickLeaveViewModel extends BaseViewModel { Future addReschedule(request) async { setState(ViewState.Busy); - await _sickLeaveService.addReschedule(request); + await _sickLeaveService!.addReschedule(request); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -121,9 +121,9 @@ class SickLeaveViewModel extends BaseViewModel { Future updateReschedule(request) async { setState(ViewState.Busy); - await _sickLeaveService.updateReschedule(request); - if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + await _sickLeaveService!.updateReschedule(request); + if (_sickLeaveService!.hasError) { + error = _sickLeaveService!.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 5e5ce23a..5d1790af 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -23,7 +23,7 @@ class DoctorApp { DoctorApp._(); static const _kFontFam = 'DoctorApp'; - static const String _kFontPkg = null; + static const String? _kFontPkg = null; static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 0e1e2c48..a0f35617 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -16,12 +16,12 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State { int currentTab = 0; - PageController pageController; + PageController? pageController; _changeCurrentTab(int tab) { setState(() { currentTab = tab; - pageController.jumpToPage(tab); + pageController!.jumpToPage(tab); }); } @@ -84,13 +84,13 @@ class _LandingPageState extends State { getText(currentTab) { switch (currentTab) { case 0: - return TranslationBase.of(context).home; + return TranslationBase.of(context)!.home; case 1: - return TranslationBase.of(context).mySchedule; + return TranslationBase.of(context)!.mySchedule; case 2: - return TranslationBase.of(context).qr; + return TranslationBase.of(context)!.qr; case 3: - return TranslationBase.of(context).replay2; + return TranslationBase.of(context)!.replay2; } } } @@ -99,7 +99,7 @@ class MyAppbar extends StatelessWidget with PreferredSizeWidget { @override final Size preferredSize; - MyAppbar({Key key}) + MyAppbar({Key? key}) : preferredSize = Size.fromHeight(0.0), super(key: key); @override diff --git a/lib/models/SOAP/Allergy_model.dart b/lib/models/SOAP/Allergy_model.dart index c3493832..b86aca46 100644 --- a/lib/models/SOAP/Allergy_model.dart +++ b/lib/models/SOAP/Allergy_model.dart @@ -1,16 +1,16 @@ class AllergyModel { - int allergyDiseaseId; - String allergyDiseaseName; - int allergyDiseaseType; - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - int episodeID; - bool isChecked; - bool isUpdatedByNurse; - int severity; - String severityName; + int? allergyDiseaseId; + String? allergyDiseaseName; + int? allergyDiseaseType; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + int? episodeID; + bool? isChecked; + bool? isUpdatedByNurse; + int? severity; + String? severityName; AllergyModel( {this.allergyDiseaseId, diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 80188dfe..4dffeb07 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -1,8 +1,8 @@ class GetChiefComplaintReqModel { - int patientMRN; - int appointmentNo; - int episodeId; - int episodeID; + int? patientMRN; + int? appointmentNo; + int? episodeId; + int? episodeID; dynamic doctorID; GetChiefComplaintReqModel( diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart index 85ada324..f43572fb 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart @@ -1,16 +1,16 @@ class GetChiefComplaintResModel { - int appointmentNo; - String ccdate; - String chiefComplaint; - String clinicDescription; - int clinicID; - String currentMedication; - int doctorID; - String doctorName; - int episodeId; - String hopi; - int patientMRN; - int status; + int? appointmentNo; + String? ccdate; + String? chiefComplaint; + String? clinicDescription; + int? clinicID; + String? currentMedication; + int? doctorID; + String? doctorName; + int? episodeId; + String? hopi; + int? patientMRN; + int? status; GetChiefComplaintResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 70e76313..65ba7d6b 100644 --- a/lib/models/SOAP/GeneralGetReqForSOAP.dart +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -1,7 +1,7 @@ class GeneralGetReqForSOAP { - int patientMRN; - int appointmentNo; - int episodeId; + int? patientMRN; + int? appointmentNo; + int? episodeId; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/models/SOAP/GetAllergiesResModel.dart index 1eeca63e..bda08928 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -1,17 +1,17 @@ class GetAllergiesResModel { - int allergyDiseaseId; - String allergyDiseaseName; - int allergyDiseaseType; - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - int episodeID; - bool isChecked; - bool isUpdatedByNurse; - int severity; - String severityName; - String remarks; + int? allergyDiseaseId; + String? allergyDiseaseName; + int? allergyDiseaseType; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + int? episodeID; + bool? isChecked; + bool? isUpdatedByNurse; + int? severity; + String? severityName; + String? remarks; GetAllergiesResModel( {this.allergyDiseaseId, diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart index 965382b5..0cef8abc 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -1,10 +1,10 @@ class GetAssessmentReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; - int clinicID; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; + int? clinicID; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/models/SOAP/GetAssessmentResModel.dart index 4d1b1b68..689ab00d 100644 --- a/lib/models/SOAP/GetAssessmentResModel.dart +++ b/lib/models/SOAP/GetAssessmentResModel.dart @@ -1,19 +1,19 @@ class GetAssessmentResModel { - int appointmentNo; - String asciiDesc; - String clinicDescription; - int clinicID; - bool complexDiagnosis; - int conditionID; - int createdBy; - String createdOn; - int diagnosisTypeID; - int doctorID; - String doctorName; - int episodeId; - String icdCode10ID; - int patientMRN; - String remarks; + int? appointmentNo; + String? asciiDesc; + String? clinicDescription; + int? clinicID; + bool? complexDiagnosis; + int? conditionID; + int? createdBy; + String? createdOn; + int? diagnosisTypeID; + int? doctorID; + String? doctorName; + int? episodeId; + String? icdCode10ID; + int? patientMRN; + String? remarks; GetAssessmentResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart index 1da4a8bf..1ca1244e 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -1,10 +1,10 @@ class GetGetProgressNoteReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; - int clinicID; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; + int? clinicID; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index 4ae7ed8c..fb286ff5 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,15 +1,15 @@ class GetPatientProgressNoteResModel { - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - String dName; - String editedByName; - String editedOn; - int episodeId; - String mName; - int patientMRN; - String planNote; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + String? dName; + String? editedByName; + String? editedOn; + int? episodeId; + String? mName; + int? patientMRN; + String? planNote; GetPatientProgressNoteResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index 720b6342..a9cc3d0f 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -1,11 +1,11 @@ class GetHistoryReqModel { - int patientMRN; - int historyType; - String episodeID; - String from; - String to; - int clinicID; - int appointmentNo; + int? patientMRN; + int? historyType; + String? episodeID; + String? from; + String? to; + int? clinicID; + int? appointmentNo; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/models/SOAP/GetHistoryResModel.dart index c4b4f129..e8473a43 100644 --- a/lib/models/SOAP/GetHistoryResModel.dart +++ b/lib/models/SOAP/GetHistoryResModel.dart @@ -1,11 +1,11 @@ class GetHistoryResModel { - int appointmentNo; - int episodeId; - int historyId; - int historyType; - bool isChecked; - int patientMRN; - String remarks; + int? appointmentNo; + int? episodeId; + int? historyId; + int? historyType; + bool? isChecked; + int? patientMRN; + String? remarks; GetHistoryResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart index c97189b1..fdf516cd 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -1,23 +1,23 @@ class GetPhysicalExamResModel { - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; Null editedBy; - String editedByName; - String editedOn; - int episodeId; - int examId; - String examName; - int examType; - int examinationType; - String examinationTypeName; - bool isAbnormal; - bool isNew; - bool isNormal; - bool notExamined; - int patientMRN; - String remarks; + String? editedByName; + String? editedOn; + int? episodeId; + int? examId; + String? examName; + int? examType; + int? examinationType; + String? examinationTypeName; + bool? isAbnormal; + bool? isNew; + bool? isNormal; + bool? notExamined; + int? patientMRN; + String? remarks; GetPhysicalExamResModel( {this.appointmentNo, diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index 5145c419..57d14a3f 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -1,9 +1,9 @@ class GetPhysicalExamReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/PatchAssessmentReqModel.dart b/lib/models/SOAP/PatchAssessmentReqModel.dart index 8cbf5cb7..f37683a4 100644 --- a/lib/models/SOAP/PatchAssessmentReqModel.dart +++ b/lib/models/SOAP/PatchAssessmentReqModel.dart @@ -1,13 +1,13 @@ class PatchAssessmentReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - String icdcode10Id; - String prevIcdCode10ID; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; + int? patientMRN; + int? appointmentNo; + int? episodeID; + String? icdcode10Id; + String? prevIcdCode10ID; + int? conditionId; + int? diagnosisTypeId; + bool? complexDiagnosis; + String? remarks; PatchAssessmentReqModel( {this.patientMRN, diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/models/SOAP/PostEpisodeReqModel.dart index 6d3ee45a..c0f7dec1 100644 --- a/lib/models/SOAP/PostEpisodeReqModel.dart +++ b/lib/models/SOAP/PostEpisodeReqModel.dart @@ -1,8 +1,8 @@ class PostEpisodeReqModel { - int appointmentNo; - int patientMRN; - int doctorID; - String vidaAuthTokenID; + int? appointmentNo; + int? patientMRN; + int? doctorID; + String? vidaAuthTokenID; PostEpisodeReqModel( {this.appointmentNo, diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/models/SOAP/get_Allergies_request_model.dart index 7676d530..d5b9972e 100644 --- a/lib/models/SOAP/get_Allergies_request_model.dart +++ b/lib/models/SOAP/get_Allergies_request_model.dart @@ -1,9 +1,9 @@ class GetAllergiesRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; - int episodeId; - String doctorID; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeId; + String? doctorID; GetAllergiesRequestModel( {this.vidaAuthTokenID, diff --git a/lib/models/SOAP/master_key_model.dart b/lib/models/SOAP/master_key_model.dart index a1c32039..acbdee64 100644 --- a/lib/models/SOAP/master_key_model.dart +++ b/lib/models/SOAP/master_key_model.dart @@ -1,6 +1,6 @@ class MasterKeyModel { - String alias; - String aliasN; + String? alias; + String? aliasN; dynamic code; dynamic description; dynamic detail1; @@ -8,13 +8,13 @@ class MasterKeyModel { dynamic detail3; dynamic detail4; dynamic detail5; - int groupID; - int id; - String nameAr; - String nameEn; + int? groupID; + int? id; + String? nameAr; + String? nameEn; dynamic remarks; - int typeId; - String valueList; + int? typeId; + String? valueList; MasterKeyModel( {this.alias, diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index c4e52af7..e54c3d2f 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAllergy { - MasterKeyModel selectedAllergySeverity; - MasterKeyModel selectedAllergy; - String remark; - bool isChecked; - bool isExpanded; - int createdBy; + MasterKeyModel? selectedAllergySeverity; + MasterKeyModel? selectedAllergy; + String? remark; + bool? isChecked; + bool? isExpanded; + int? createdBy; MySelectedAllergy( {this.selectedAllergySeverity, @@ -32,10 +32,10 @@ class MySelectedAllergy { Map toJson() { final Map data = new Map(); if (this.selectedAllergySeverity != null) { - data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson(); + data['selectedAllergySeverity'] = this.selectedAllergySeverity!.toJson(); } if (this.selectedAllergy != null) { - data['selectedAllergy'] = this.selectedAllergy.toJson(); + data['selectedAllergy'] = this.selectedAllergy!.toJson(); } data['remark'] = this.remark; data['isChecked'] = this.isChecked; diff --git a/lib/models/SOAP/my_selected_assement.dart b/lib/models/SOAP/my_selected_assement.dart index 4d4afc2d..a34c2fdf 100644 --- a/lib/models/SOAP/my_selected_assement.dart +++ b/lib/models/SOAP/my_selected_assement.dart @@ -1,16 +1,16 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAssessment { - MasterKeyModel selectedICD; - MasterKeyModel selectedDiagnosisCondition; - MasterKeyModel selectedDiagnosisType; - String remark; - int appointmentId; - int createdBy; - String createdOn; - int doctorID; - String doctorName; - String icdCode10ID; + MasterKeyModel? selectedICD; + MasterKeyModel? selectedDiagnosisCondition; + MasterKeyModel? selectedDiagnosisType; + String? remark; + int? appointmentId; + int? createdBy; + String? createdOn; + int? doctorID; + String? doctorName; + String? icdCode10ID; MySelectedAssessment( {this.selectedICD, @@ -45,13 +45,13 @@ class MySelectedAssessment { final Map data = new Map(); if (this.selectedICD != null) { - data['selectedICD'] = this.selectedICD.toJson(); + data['selectedICD'] = this.selectedICD!.toJson(); } if (this.selectedDiagnosisCondition != null) { - data['selectedICD'] = this.selectedDiagnosisCondition.toJson(); + data['selectedICD'] = this.selectedDiagnosisCondition!.toJson(); } if (this.selectedDiagnosisType != null) { - data['selectedICD'] = this.selectedDiagnosisType.toJson(); + data['selectedICD'] = this.selectedDiagnosisType!.toJson(); } data['remark'] = this.remark; data['appointmentId'] = this.appointmentId; diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index 393af944..a1213f6b 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedExamination { - MasterKeyModel selectedExamination; - String remark; - bool isNormal; - bool isAbnormal; - bool notExamined; - bool isNew; - int createdBy; + MasterKeyModel? selectedExamination; + String? remark; + bool? isNormal; + bool? isAbnormal; + bool? notExamined; + bool? isNew; + int? createdBy; MySelectedExamination( {this.selectedExamination, @@ -34,7 +34,7 @@ class MySelectedExamination { final Map data = new Map(); if (this.selectedExamination != null) { - data['selectedExamination'] = this.selectedExamination.toJson(); + data['selectedExamination'] = this.selectedExamination!.toJson(); } data['remark'] = this.remark; data['isNormal'] = this.isNormal; diff --git a/lib/models/SOAP/my_selected_history.dart b/lib/models/SOAP/my_selected_history.dart index 11e366c2..23d27614 100644 --- a/lib/models/SOAP/my_selected_history.dart +++ b/lib/models/SOAP/my_selected_history.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedHistory { - MasterKeyModel selectedHistory; - String remark; - bool isChecked; + MasterKeyModel? selectedHistory; + String? remark; + bool? isChecked; MySelectedHistory( { this.selectedHistory, this.remark, this.isChecked}); @@ -21,7 +21,7 @@ class MySelectedHistory { final Map data = new Map(); if (this.selectedHistory != null) { - data['selectedHistory'] = this.selectedHistory.toJson(); + data['selectedHistory'] = this.selectedHistory!.toJson(); } data['remark'] = this.remark; data['isChecked'] = this.remark; diff --git a/lib/models/SOAP/order-procedure.dart b/lib/models/SOAP/order-procedure.dart index 4e134a07..f0ab0d85 100644 --- a/lib/models/SOAP/order-procedure.dart +++ b/lib/models/SOAP/order-procedure.dart @@ -1,29 +1,29 @@ class OrderProcedure { - String achiCode; - String appointmentDate; - int appointmentNo; - int categoryID; - String clinicDescription; - String cptCode; - int createdBy; - String createdOn; - String doctorName; - bool isApprovalCreated; - bool isApprovalRequired; - bool isCovered; - bool isInvoiced; - bool isReferralInvoiced; - bool isUncoveredByDoctor; - int lineItemNo; - String orderDate; - int orderNo; - int orderType; - String procedureId; - String procedureName; - String remarks; - String status; - String template; + String? achiCode; + String? appointmentDate; + int? appointmentNo; + int? categoryID; + String? clinicDescription; + String? cptCode; + int? createdBy; + String? createdOn; + String? doctorName; + bool? isApprovalCreated; + bool? isApprovalRequired; + bool? isCovered; + bool? isInvoiced; + bool? isReferralInvoiced; + bool? isUncoveredByDoctor; + int? lineItemNo; + String? orderDate; + int? orderNo; + int? orderType; + String? procedureId; + String? procedureName; + String? remarks; + String? status; + String? template; OrderProcedure( {this.achiCode, diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/models/SOAP/post_allergy_request_model.dart index 6783d885..fd8feb53 100644 --- a/lib/models/SOAP/post_allergy_request_model.dart +++ b/lib/models/SOAP/post_allergy_request_model.dart @@ -1,5 +1,5 @@ class PostAllergyRequestModel { - List + List? listHisProgNotePatientAllergyDiseaseVM; PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM}); @@ -7,9 +7,9 @@ class PostAllergyRequestModel { PostAllergyRequestModel.fromJson(Map json) { if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) { listHisProgNotePatientAllergyDiseaseVM = - new List(); + []; json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) { - listHisProgNotePatientAllergyDiseaseVM + listHisProgNotePatientAllergyDiseaseVM! .add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); }); } @@ -19,7 +19,7 @@ class PostAllergyRequestModel { final Map data = new Map(); if (this.listHisProgNotePatientAllergyDiseaseVM != null) { data['listHisProgNotePatientAllergyDiseaseVM'] = this - .listHisProgNotePatientAllergyDiseaseVM + .listHisProgNotePatientAllergyDiseaseVM! .map((v) => v.toJson()) .toList(); } @@ -28,19 +28,19 @@ class PostAllergyRequestModel { } class ListHisProgNotePatientAllergyDiseaseVM { - int patientMRN; - int allergyDiseaseType; - int allergyDiseaseId; - int episodeId; - int appointmentNo; - int severity; - bool isChecked; - bool isUpdatedByNurse; - String remarks; - int createdBy; - String createdOn; - int editedBy; - String editedOn; + int? patientMRN; + int? allergyDiseaseType; + int? allergyDiseaseId; + int? episodeId; + int? appointmentNo; + int? severity; + bool? isChecked; + bool? isUpdatedByNurse; + String? remarks; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; ListHisProgNotePatientAllergyDiseaseVM( {this.patientMRN, diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/models/SOAP/post_assessment_request_model.dart index af577671..bcf665a4 100644 --- a/lib/models/SOAP/post_assessment_request_model.dart +++ b/lib/models/SOAP/post_assessment_request_model.dart @@ -1,8 +1,8 @@ class PostAssessmentRequestModel { - int patientMRN; - int appointmentNo; - int episodeId; - List icdCodeDetails; + int? patientMRN; + int? appointmentNo; + int? episodeId; + List? icdCodeDetails; PostAssessmentRequestModel( {this.patientMRN, @@ -15,9 +15,9 @@ class PostAssessmentRequestModel { appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; if (json['icdCodeDetails'] != null) { - icdCodeDetails = new List(); + icdCodeDetails = []; json['icdCodeDetails'].forEach((v) { - icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); + icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); }); } } @@ -29,18 +29,18 @@ class PostAssessmentRequestModel { data['EpisodeID'] = this.episodeId; if (this.icdCodeDetails != null) { data['icdCodeDetails'] = - this.icdCodeDetails.map((v) => v.toJson()).toList(); + this.icdCodeDetails!.map((v) => v.toJson()).toList(); } return data; } } class IcdCodeDetails { - String icdcode10Id; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; + String? icdcode10Id; + int? conditionId; + int? diagnosisTypeId; + bool? complexDiagnosis; + String? remarks; IcdCodeDetails( {this.icdcode10Id, diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index f1e9c2b4..36918783 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -1,13 +1,13 @@ class PostChiefComplaintRequestModel { - int appointmentNo; - int episodeID; - int patientMRN; - String chiefComplaint; - String hopi; - String currentMedication; - bool ispregnant; - bool isLactation; - int numberOfWeeks; + int? appointmentNo; + int? episodeID; + int? patientMRN; + String? chiefComplaint; + String? hopi; + String? currentMedication; + bool? ispregnant; + bool? isLactation; + int? numberOfWeeks; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart index d8be3fb2..afc8a9bc 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -1,14 +1,14 @@ class PostHistoriesRequestModel { - List listMedicalHistoryVM; + List? listMedicalHistoryVM; dynamic doctorID; PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID}); PostHistoriesRequestModel.fromJson(Map json) { if (json['listMedicalHistoryVM'] != null) { - listMedicalHistoryVM = new List(); + listMedicalHistoryVM = []; json['listMedicalHistoryVM'].forEach((v) { - listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); + listMedicalHistoryVM!.add(new ListMedicalHistoryVM.fromJson(v)); }); } doctorID = json['DoctorID']; @@ -18,7 +18,7 @@ class PostHistoriesRequestModel { final Map data = new Map(); if (this.listMedicalHistoryVM != null) { data['listMedicalHistoryVM'] = - this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); + this.listMedicalHistoryVM!.map((v) => v.toJson()).toList(); } data['DoctorID'] = this.doctorID; return data; @@ -26,13 +26,13 @@ class PostHistoriesRequestModel { } class ListMedicalHistoryVM { - int patientMRN; - int historyType; - int historyId; - int episodeId; - int appointmentNo; - bool isChecked; - String remarks; + int? patientMRN; + int? historyType; + int? historyId; + int? episodeId; + int? appointmentNo; + bool? isChecked; + String? remarks; ListMedicalHistoryVM( {this.patientMRN, diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 52836232..064c0746 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,14 +1,14 @@ class PostPhysicalExamRequestModel { - List listHisProgNotePhysicalExaminationVM; + List? listHisProgNotePhysicalExaminationVM; PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel.fromJson(Map json) { if (json['listHisProgNotePhysicalExaminationVM'] != null) { - listHisProgNotePhysicalExaminationVM = new List(); + listHisProgNotePhysicalExaminationVM = []; json['listHisProgNotePhysicalExaminationVM'].forEach((v) { - listHisProgNotePhysicalExaminationVM + listHisProgNotePhysicalExaminationVM! .add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); }); } @@ -18,32 +18,32 @@ class PostPhysicalExamRequestModel { final Map data = new Map(); if (this.listHisProgNotePhysicalExaminationVM != null) { data['listHisProgNotePhysicalExaminationVM'] = - this.listHisProgNotePhysicalExaminationVM.map((v) => v.toJson()).toList(); + this.listHisProgNotePhysicalExaminationVM!.map((v) => v.toJson()).toList(); } return data; } } class ListHisProgNotePhysicalExaminationVM { - int episodeId; - int appointmentNo; - int examType; - int examId; - int patientMRN; - bool isNormal; - bool isAbnormal; - bool notExamined; - String examName; - String examinationTypeName; - int examinationType; - String remarks; - bool isNew; - int createdBy; - String createdOn; - String createdByName; - int editedBy; - String editedOn; - String editedByName; + int? episodeId; + int? appointmentNo; + int? examType; + int? examId; + int? patientMRN; + bool? isNormal; + bool? isAbnormal; + bool? notExamined; + String? examName; + String? examinationTypeName; + int? examinationType; + String? remarks; + bool? isNew; + int? createdBy; + String? createdOn; + String? createdByName; + int? editedBy; + String? editedOn; + String? editedByName; ListHisProgNotePhysicalExaminationVM( {this.episodeId, diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index 2925819d..a96a9fcb 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -1,8 +1,8 @@ class PostProgressNoteRequestModel { - int appointmentNo; - int episodeId; - int patientMRN; - String planNote; + int? appointmentNo; + int? episodeId; + int? patientMRN; + String? planNote; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/dashboard/dashboard_model.dart b/lib/models/dashboard/dashboard_model.dart index 0e03e899..7bbff92f 100644 --- a/lib/models/dashboard/dashboard_model.dart +++ b/lib/models/dashboard/dashboard_model.dart @@ -1,7 +1,7 @@ class DashboardModel { - String kPIName; - int displaySequence; - List summaryoptions; + String? kPIName; + int? displaySequence; + List? summaryoptions; DashboardModel({this.kPIName, this.displaySequence, this.summaryoptions}); @@ -9,9 +9,9 @@ class DashboardModel { kPIName = json['KPIName']; displaySequence = json['displaySequence']; if (json['summaryoptions'] != null) { - summaryoptions = new List(); + summaryoptions = []; json['summaryoptions'].forEach((v) { - summaryoptions.add(new Summaryoptions.fromJson(v)); + summaryoptions!.add(new Summaryoptions.fromJson(v)); }); } } @@ -22,20 +22,20 @@ class DashboardModel { data['displaySequence'] = this.displaySequence; if (this.summaryoptions != null) { data['summaryoptions'] = - this.summaryoptions.map((v) => v.toJson()).toList(); + this.summaryoptions!.map((v) => v.toJson()).toList(); } return data; } } class Summaryoptions { - String kPIParameter; - String captionColor; - bool isCaptionBold; - bool isValueBold; - int order; - int value; - String valueColor; + String? kPIParameter; + String? captionColor; + bool? isCaptionBold; + bool? isValueBold; + int? order; + int? value; + String? valueColor; Summaryoptions( {this.kPIParameter, diff --git a/lib/models/doctor/clinic_model.dart b/lib/models/doctor/clinic_model.dart index e5eb8eee..09e1592f 100644 --- a/lib/models/doctor/clinic_model.dart +++ b/lib/models/doctor/clinic_model.dart @@ -7,11 +7,11 @@ */ class ClinicModel { Null setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; + int? projectID; + int? doctorID; + int? clinicID; + bool? isActive; + String? clinicName; ClinicModel( {this.setupID, diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/models/doctor/doctor_profile_model.dart index 17625968..c03345eb 100644 --- a/lib/models/doctor/doctor_profile_model.dart +++ b/lib/models/doctor/doctor_profile_model.dart @@ -1,45 +1,45 @@ class DoctorProfileModel { - int doctorID; - String doctorName; + int? doctorID; + String? doctorName; Null doctorNameN; - int clinicID; - String clinicDescription; + int? clinicID; + String? clinicDescription; Null clinicDescriptionN; Null licenseExpiry; - int employmentType; + int? employmentType; Null setupID; - int projectID; - String projectName; - String nationalityID; - String nationalityName; + int? projectID; + String? projectName; + String? nationalityID; + String? nationalityName; Null nationalityNameN; - int gender; - String genderDescription; + int? gender; + String? genderDescription; Null genderDescriptionN; Null doctorTitle; Null projectNameN; - bool isAllowWaitList; - String titleDescription; + bool? isAllowWaitList; + String? titleDescription; Null titleDescriptionN; Null isRegistered; Null isDoctorDummy; - bool isActive; + bool? isActive; Null isDoctorAppointmentDisplayed; - bool doctorClinicActive; + bool? doctorClinicActive; Null isbookingAllowed; - String doctorCases; + String? doctorCases; Null doctorPicture; - String doctorProfileInfo; - List specialty; - int actualDoctorRate; - String doctorImageURL; - int doctorRate; - String doctorTitleForProfile; - bool isAppointmentAllowed; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - int serviceID; + String? doctorProfileInfo; + List? specialty; + int? actualDoctorRate; + String? doctorImageURL; + int? doctorRate; + String? doctorTitleForProfile; + bool? isAppointmentAllowed; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + int? serviceID; DoctorProfileModel( {this.doctorID, diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 4712d285..94dede42 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class ListDoctorWorkingHoursTable { - DateTime date; - String dayName; - String workingHours; - String projectName; - String clinicName; + DateTime? date; + String? dayName; + String? workingHours; + String? projectName; + String? clinicName; ListDoctorWorkingHoursTable({ @@ -35,7 +35,7 @@ class ListDoctorWorkingHoursTable { } class WorkingHours { - String from; - String to; + String? from; + String? to; WorkingHours({this.from, this.to}); } diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index 35d09812..83d4b915 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -5,33 +5,33 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class ListGtMyPatientsQuestions { - String setupID; - int projectID; - int transactionNo; - int patientType; - int patientID; - int doctorID; - int requestType; - DateTime requestDate; - String requestTime; - String remarks; - int status; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - String patientName; + String? setupID; + int? projectID; + int? transactionNo; + int? patientType; + int? patientID; + int? doctorID; + int? requestType; + DateTime? requestDate; + String? requestTime; + String? remarks; + int? status; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? patientName; Null patientNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - int admissionNo; - int referringDoctor; - int lineItemNo; - String age; - String genderDescription; - bool isVidaCall; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + int? admissionNo; + int? referringDoctor; + int? lineItemNo; + String? age; + String? genderDescription; + bool? isVidaCall; ListGtMyPatientsQuestions( {this.setupID, diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 8f2ef985..23757a85 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -6,19 +6,19 @@ *@desc: ProfileReqModel */ class ProfileReqModel { - int projectID; - int clinicID; - int doctorID; - bool isRegistered; - bool license; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; + int? projectID; + int? clinicID; + int? doctorID; + bool? isRegistered; + bool? license; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; ProfileReqModel( {this.projectID, diff --git a/lib/models/doctor/request_add_referred_doctor_remarks.dart b/lib/models/doctor/request_add_referred_doctor_remarks.dart index b396c47f..7e8bec45 100644 --- a/lib/models/doctor/request_add_referred_doctor_remarks.dart +++ b/lib/models/doctor/request_add_referred_doctor_remarks.dart @@ -1,22 +1,22 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestAddReferredDoctorRemarks { - int projectID; - String admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int patientID; - int referringDoctor; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + String? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? patientID; + int? referringDoctor; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestAddReferredDoctorRemarks( diff --git a/lib/models/doctor/request_doctor_reply.dart b/lib/models/doctor/request_doctor_reply.dart index 707336d6..920d1a7c 100644 --- a/lib/models/doctor/request_doctor_reply.dart +++ b/lib/models/doctor/request_doctor_reply.dart @@ -1,18 +1,18 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestDoctorReply { - int projectID; - int doctorID; - int transactionNo; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? doctorID; + int? transactionNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestDoctorReply( {this.projectID , diff --git a/lib/models/doctor/request_schedule.dart b/lib/models/doctor/request_schedule.dart index 03bafeca..87c12eaf 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/models/doctor/request_schedule.dart @@ -1,20 +1,20 @@ class RequestSchedule { - int projectID; - int clinicID; - int doctorID; - int doctorWorkingHoursDays; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? clinicID; + int? doctorID; + int? doctorWorkingHoursDays; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RequestSchedule( {this.projectID, diff --git a/lib/models/doctor/statstics_for_certain_doctor_request.dart b/lib/models/doctor/statstics_for_certain_doctor_request.dart index 08fa03f3..444df675 100644 --- a/lib/models/doctor/statstics_for_certain_doctor_request.dart +++ b/lib/models/doctor/statstics_for_certain_doctor_request.dart @@ -1,10 +1,10 @@ class StatsticsForCertainDoctorRequest { - bool outSA; - int doctorID; - String tokenID; - int channel; - int projectID; - String generalid; + bool? outSA; + int? doctorID; + String? tokenID; + int? channel; + int? projectID; + String? generalid; StatsticsForCertainDoctorRequest( {this.outSA, diff --git a/lib/models/doctor/user_model.dart b/lib/models/doctor/user_model.dart index 95035f8d..66768c8a 100644 --- a/lib/models/doctor/user_model.dart +++ b/lib/models/doctor/user_model.dart @@ -1,16 +1,16 @@ class UserModel { - String userID; - String password; - int projectID; - int languageID; - String iPAdress; - double versionID; - int channel; - String sessionID; - String tokenID; - String stamp; - bool isLoginForDoctorApp; - int patientOutSA; + String? userID; + String? password; + int? projectID; + int? languageID; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + String? tokenID; + String? stamp; + bool? isLoginForDoctorApp; + int? patientOutSA; UserModel( {this.userID, diff --git a/lib/models/doctor/verify_referral_doctor_remarks.dart b/lib/models/doctor/verify_referral_doctor_remarks.dart index b9bfce0a..7b453c10 100644 --- a/lib/models/doctor/verify_referral_doctor_remarks.dart +++ b/lib/models/doctor/verify_referral_doctor_remarks.dart @@ -1,28 +1,28 @@ import 'package:doctor_app_flutter/config/config.dart'; class VerifyReferralDoctorRemarks { - int projectID; - String admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int patientID; - int referringDoctor; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String firstName; + int? projectID; + String? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? patientID; + int? referringDoctor; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; VerifyReferralDoctorRemarks( {this.projectID, diff --git a/lib/models/livecare/end_call_req.dart b/lib/models/livecare/end_call_req.dart index 7a1ae8eb..533bc02b 100644 --- a/lib/models/livecare/end_call_req.dart +++ b/lib/models/livecare/end_call_req.dart @@ -1,9 +1,9 @@ class EndCallReq { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isDestroy; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isDestroy; EndCallReq( {this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); diff --git a/lib/models/livecare/get_panding_req_list.dart b/lib/models/livecare/get_panding_req_list.dart index 719b9134..521e9a5f 100644 --- a/lib/models/livecare/get_panding_req_list.dart +++ b/lib/models/livecare/get_panding_req_list.dart @@ -1,9 +1,9 @@ class LiveCarePendingListRequest { - PatientData patientData; - int doctorID; - String sErServiceID; - int projectID; - int sourceID; + PatientData? patientData; + int? doctorID; + String? sErServiceID; + int? projectID; + int? sourceID; LiveCarePendingListRequest( {this.patientData, @@ -23,7 +23,7 @@ class LiveCarePendingListRequest { Map toJson() { final Map data = new Map(); - data['PatientData'] = this.patientData.toJson(); + data['PatientData'] = this.patientData!.toJson(); data['DoctorID'] = this.doctorID; data['SErServiceID'] = this.sErServiceID; data['ProjectID'] = this.projectID; @@ -33,7 +33,7 @@ class LiveCarePendingListRequest { } class PatientData { - bool isOutKSA; + bool? isOutKSA; PatientData({this.isOutKSA}); diff --git a/lib/models/livecare/get_pending_res_list.dart b/lib/models/livecare/get_pending_res_list.dart index b45c53b9..1faeadfb 100644 --- a/lib/models/livecare/get_pending_res_list.dart +++ b/lib/models/livecare/get_pending_res_list.dart @@ -1,43 +1,43 @@ class LiveCarePendingListResponse { dynamic acceptedBy; dynamic acceptedOn; - int age; + int? age; dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestID; - String clinicName; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; + String? clientRequestID; + String? clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - String dateOfBirth; - String deviceToken; - String deviceType; + String? dateOfBirth; + String? deviceToken; + String? deviceType; dynamic doctorName; - String editOn; - String gender; - bool isFollowUP; + String? editOn; + String? gender; + bool? isFollowUP; dynamic isFromVida; - int isLoginB; - bool isOutKSA; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; + int? isLoginB; + bool? isOutKSA; + int? isRejected; + String? language; + double? latitude; + double? longitude; + String? mobileNumber; dynamic openSession; dynamic openTokenID; - String patientID; - String patientName; - int patientStatus; - String preferredLanguage; - int projectID; - double scoring; - int serviceID; + String? patientID; + String? patientName; + int? patientStatus; + String? preferredLanguage; + int? projectID; + double? scoring; + int? serviceID; dynamic tokenID; - int vCID; - String voipToken; + int? vCID; + String? voipToken; LiveCarePendingListResponse( {this.acceptedBy, diff --git a/lib/models/livecare/session_status_model.dart b/lib/models/livecare/session_status_model.dart index 7e7a3e43..14e30692 100644 --- a/lib/models/livecare/session_status_model.dart +++ b/lib/models/livecare/session_status_model.dart @@ -1,8 +1,8 @@ class SessionStatusModel { - bool isAuthenticated; - int messageStatus; - String result; - int sessionStatus; + bool? isAuthenticated; + int? messageStatus; + String? result; + int? sessionStatus; SessionStatusModel( {this.isAuthenticated, diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index 1ad04480..9dabccc1 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,15 +1,15 @@ class StartCallReq { - int vCID; - bool isrecall; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; - String projectName; - String docotrName; - String clincName; - String docSpec; - int clinicId; + int? vCID; + bool? isrecall; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; + String? projectName; + String? docotrName; + String? clincName; + String? docSpec; + int? clinicId; StartCallReq( {this.vCID, diff --git a/lib/models/livecare/start_call_res.dart b/lib/models/livecare/start_call_res.dart index 0566d76d..bce777dc 100644 --- a/lib/models/livecare/start_call_res.dart +++ b/lib/models/livecare/start_call_res.dart @@ -1,9 +1,9 @@ class StartCallRes { - String result; - String openSessionID; - String openTokenID; - bool isAuthenticated; - int messageStatus; + String? result; + String? openSessionID; + String? openTokenID; + bool? isAuthenticated; + int? messageStatus; StartCallRes( {this.result, diff --git a/lib/models/livecare/transfer_to_admin.dart b/lib/models/livecare/transfer_to_admin.dart index 841f5e7d..040ff39a 100644 --- a/lib/models/livecare/transfer_to_admin.dart +++ b/lib/models/livecare/transfer_to_admin.dart @@ -1,10 +1,10 @@ class TransferToAdminReq { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; - String notes; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; + String? notes; TransferToAdminReq( {this.vCID, diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/models/patient/PatientArrivalEntity.dart index 54622cd7..e6e5c807 100644 --- a/lib/models/patient/PatientArrivalEntity.dart +++ b/lib/models/patient/PatientArrivalEntity.dart @@ -1,22 +1,22 @@ class PatientArrivalEntity { - String age; - String appointmentDate; - int appointmentNo; - String appointmentType; - String arrivedOn; - String companyName; - String endTime; - int episodeNo; - int fallRiskScore; - String gender; - int medicationOrders; - String mobileNumber; - String nationality; - int patientMRN; - String patientName; - int rowCount; - String startTime; - String visitType; + String? age; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + String? arrivedOn; + String? companyName; + String? endTime; + int? episodeNo; + int? fallRiskScore; + String? gender; + int? medicationOrders; + String? mobileNumber; + String? nationality; + int? patientMRN; + String? patientName; + int? rowCount; + String? startTime; + String? visitType; PatientArrivalEntity( {this.age, diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 09198dc0..d5e953d7 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -8,17 +8,17 @@ class ClinicByProjectIdRequest { *@desc: ClinicByProjectIdRequest */ - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; /* { "ProjectID": 21, diff --git a/lib/models/patient/get_doctor_by_clinic_id_request.dart b/lib/models/patient/get_doctor_by_clinic_id_request.dart index 9504fc35..c5591e95 100644 --- a/lib/models/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/models/patient/get_doctor_by_clinic_id_request.dart @@ -1,17 +1,17 @@ class DoctorsByClinicIdRequest { - int clinicID; - int projectID; - bool continueDentalPlan; - bool isSearchAppointmnetByClinicID; - int patientID; - int gender; - bool isGetNearAppointment; - bool isVoiceCommand; - int latitude; - int longitude; - bool license; - bool isDentalAllowedBackend; + int? clinicID; + int? projectID; + bool? continueDentalPlan; + bool? isSearchAppointmnetByClinicID; + int? patientID; + int? gender; + bool? isGetNearAppointment; + bool? isVoiceCommand; + int? latitude; + int? longitude; + bool? license; + bool? isDentalAllowedBackend; DoctorsByClinicIdRequest( diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index 7f466deb..4d995e75 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -8,16 +8,16 @@ class STPReferralFrequencyRequest { *@desc: */ - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; /* { "LanguageID": 2, diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/models/patient/get_pending_patient_er_model.dart index e1b50a81..48703173 100644 --- a/lib/models/patient/get_pending_patient_er_model.dart +++ b/lib/models/patient/get_pending_patient_er_model.dart @@ -56,43 +56,43 @@ class ListPendingPatientListModel { dynamic acceptedBy; dynamic acceptedOn; - int age; + int? age; dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestId; - String clinicName; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; + String? clientRequestId; + String? clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - DateTime dateOfBirth; - String deviceToken; - String deviceType; + DateTime? dateOfBirth; + String? deviceToken; + String? deviceType; dynamic doctorName; - String editOn; - String gender; - bool isFollowUp; + String? editOn; + String? gender; + bool? isFollowUp; dynamic isFromVida; - int isLoginB; - bool isOutKsa; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; + int? isLoginB; + bool? isOutKsa; + int? isRejected; + String? language; + double? latitude; + double? longitude; + String? mobileNumber; dynamic openSession; dynamic openTokenId; - String patientId; - String patientName; - int patientStatus; - String preferredLanguage; - int projectId; - int scoring; - int serviceId; + String? patientId; + String? patientName; + int? patientStatus; + String? preferredLanguage; + int? projectId; + int? scoring; + int? serviceId; dynamic tokenId; - int vcId; - String voipToken; + int? vcId; + String? voipToken; factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( acceptedBy: json["AcceptedBy"], @@ -149,7 +149,7 @@ class ListPendingPatientListModel { "ConsoltationEnd": consoltationEnd, "ConsultationNotes": consultationNotes, "CreatedOn": createdOn, - "DateOfBirth": "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}", + "DateOfBirth": "${dateOfBirth!.year.toString().padLeft(4, '0')}-${dateOfBirth!.month.toString().padLeft(2, '0')}-${dateOfBirth!.day.toString().padLeft(2, '0')}", "DeviceToken": deviceToken, "DeviceType": deviceType, "DoctorName": doctorName, diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index 2d3ac663..9946e9f6 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -21,19 +21,19 @@ *@desc: */ class InsuranceAprovalsRequest { - int exuldAppNO; - int patientID; - int channel; - int projectID; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? exuldAppNO; + int? patientID; + int? channel; + int? projectID; + int? languageID; + String? stamp; + String? ipAdress; + double? versionID; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; InsuranceAprovalsRequest( { diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/models/patient/lab_orders/lab_orders_req_model.dart index a97f4093..3c330a75 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_req_model.dart @@ -7,18 +7,18 @@ *@desc: LabOrdersReqModel class */ class LabOrdersReqModel { - int patientID; - int patientTypeID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? patientTypeID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; LabOrdersReqModel( {this.patientID, diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/models/patient/lab_orders/lab_orders_res_model.dart index 7f463933..ae93c4b3 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -3,27 +3,27 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class LabOrdersResModel { - String setupID; - int projectID; - int patientID; - int patientType; - int orderNo; - String orderDate; - int invoiceTransactionType; - int invoiceNo; - int clinicId; - int doctorId; - int status; - String createdBy; + String? setupID; + int? projectID; + int? patientID; + int? patientType; + int? orderNo; + String? orderDate; + int? invoiceTransactionType; + int? invoiceNo; + int? clinicId; + int? doctorId; + int? status; + String? createdBy; Null createdByN; - DateTime createdOn; - String editedBy; + DateTime? createdOn; + String? editedBy; Null editedByN; - String editedOn; - String clinicName; - String doctorImageURL; - String doctorName; - String projectName; + String? editedOn; + String? clinicName; + String? doctorImageURL; + String? doctorName; + String? projectName; LabOrdersResModel( {this.setupID, diff --git a/lib/models/patient/lab_result/lab_result.dart b/lib/models/patient/lab_result/lab_result.dart index ca753f2d..37b8b7c6 100644 --- a/lib/models/patient/lab_result/lab_result.dart +++ b/lib/models/patient/lab_result/lab_result.dart @@ -1,32 +1,32 @@ class LabResult { - String setupID; - int projectID; - int orderNo; - int lineItemNo; - int packageID; - int testID; - String description; - String resultValue; - String referenceRange; + String? setupID; + int? projectID; + int? orderNo; + int? lineItemNo; + int? packageID; + int? testID; + String? description; + String? resultValue; + String? referenceRange; Null convertedResultValue; Null convertedReferenceRange; Null resultValueFlag; - int status; - String createdBy; + int? status; + String? createdBy; Null createdByN; - String createdOn; - String editedBy; + String? createdOn; + String? editedBy; Null editedByN; - String editedOn; - String verifiedBy; + String? editedOn; + String? verifiedBy; Null verifiedByN; - String verifiedOn; + String? verifiedOn; Null patientID; - int gender; + int? gender; Null maleInterpretativeData; Null femaleInterpretativeData; - String testCode; - String statusDescription; + String? testCode; + String? statusDescription; LabResult( {this.setupID, diff --git a/lib/models/patient/lab_result/lab_result_req_model.dart b/lib/models/patient/lab_result/lab_result_req_model.dart index 5e58a4a5..cadcd9c2 100644 --- a/lib/models/patient/lab_result/lab_result_req_model.dart +++ b/lib/models/patient/lab_result/lab_result_req_model.dart @@ -1,18 +1,18 @@ class RequestLabResult { - int projectID; - String setupID; - int orderNo; - int invoiceNo; - int patientTypeID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + String? setupID; + int? orderNo; + int? invoiceNo; + int? patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestLabResult( {this.projectID, diff --git a/lib/models/patient/my_referral/PendingReferral.dart b/lib/models/patient/my_referral/PendingReferral.dart index 6d3f0b83..ee790e2a 100644 --- a/lib/models/patient/my_referral/PendingReferral.dart +++ b/lib/models/patient/my_referral/PendingReferral.dart @@ -1,37 +1,37 @@ import '../patiant_info_model.dart'; class PendingReferral { - PatiantInformtion patientDetails; - String doctorImageUrl; - String nationalityFlagUrl; - String responded; - String answerFromTarget; - String createdOn; - int data; - int isSameBranch; - String editedOn; - int interBranchReferral; - int patientID; - String patientName; - int patientType; - int referralNo; - String referralStatus; - String referredByDoctorInfo; - String referredFromBranchName; - String referredOn; - String referredType; - String remarksFromSource; - String respondedOn; - int sourceAppointmentNo; - int sourceProjectId; - String sourceSetupID; - String startDate; - int targetAppointmentNo; - String targetClinicID; - String targetDoctorID; - int targetProjectId; - String targetSetupID; - bool isReferralDoctorSameBranch; + PatiantInformtion? patientDetails; + String? doctorImageUrl; + String? nationalityFlagUrl; + String? responded; + String? answerFromTarget; + String? createdOn; + int? data; + int? isSameBranch; + String? editedOn; + int? interBranchReferral; + int? patientID; + String? patientName; + int? patientType; + int? referralNo; + String? referralStatus; + String? referredByDoctorInfo; + String? referredFromBranchName; + String? referredOn; + String? referredType; + String? remarksFromSource; + String? respondedOn; + int? sourceAppointmentNo; + int? sourceProjectId; + String? sourceSetupID; + String? startDate; + int? targetAppointmentNo; + String? targetClinicID; + String? targetDoctorID; + int? targetProjectId; + String? targetSetupID; + bool? isReferralDoctorSameBranch; PendingReferral({ this.patientDetails, diff --git a/lib/models/patient/my_referral/clinic-doctor.dart b/lib/models/patient/my_referral/clinic-doctor.dart index 843f636c..9d08992a 100644 --- a/lib/models/patient/my_referral/clinic-doctor.dart +++ b/lib/models/patient/my_referral/clinic-doctor.dart @@ -1,43 +1,43 @@ class ClinicDoctor { - int clinicID; - String clinicName; - String doctorTitle; - int iD; - String name; - int projectID; - String projectName; - int actualDoctorRate; - int clinicRoomNo; - String date; - String dayName; - int doctorID; - String doctorImageURL; - String doctorProfile; - String doctorProfileInfo; - int doctorRate; - int gender; - String genderDescription; - bool isAppointmentAllowed; - bool isDoctorAllowVedioCall; - bool isDoctorDummy; - bool isLiveCare; - String latitude; - String longitude; - String nationalityFlagURL; - String nationalityID; - String nationalityName; - String nearestFreeSlot; - int noOfPatientsRate; - String originalClinicID; - int personRate; - int projectDistanceInKiloMeters; - String qR; - String qRString; - int rateNumber; - String serviceID; - String setupID; - List speciality; - String workingHours; + int? clinicID; + String? clinicName; + String? doctorTitle; + int? iD; + String? name; + int? projectID; + String? projectName; + int? actualDoctorRate; + int? clinicRoomNo; + String? date; + String? dayName; + int? doctorID; + String? doctorImageURL; + String? doctorProfile; + String? doctorProfileInfo; + int? doctorRate; + int? gender; + String? genderDescription; + bool? isAppointmentAllowed; + bool? isDoctorAllowVedioCall; + bool? isDoctorDummy; + bool? isLiveCare; + String? latitude; + String? longitude; + String? nationalityFlagURL; + String? nationalityID; + String? nationalityName; + String? nearestFreeSlot; + int? noOfPatientsRate; + String? originalClinicID; + int? personRate; + int? projectDistanceInKiloMeters; + String? qR; + String? qRString; + int? rateNumber; + String? serviceID; + String? setupID; + List? speciality; + String? workingHours; ClinicDoctor( {this.clinicID, diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/models/patient/my_referral/my_referral_patient_model.dart index f1506f8e..c3a48642 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -1,55 +1,55 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - DateTime mAXResponseTime; - String age; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; + String? nursingStationID; + String? description; + String? nationalityName; + String? nationalityNameN; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + String? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + DateTime? mAXResponseTime; + String? age; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; MyReferralPatientModel( {this.projectID, diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index 44a427f7..19fb4c29 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -1,70 +1,70 @@ class MyReferredPatientModel { - String rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - int episodeID; - int appointmentNo; - String appointmentDate; - int appointmentType; - int patientMRN; - String createdOn; - int clinicID; - String nationalityID; - String age; - String doctorImageURL; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nationalityFlagURL; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referralDoctorName; - String referralClinicDescription; - String referringDoctorName; - bool isReferralDoctorSameBranch; - String referralStatusDesc; + String? rowID; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; + String? nursingStationID; + String? description; + String? nationalityName; + String? nationalityNameN; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + String? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + int? episodeID; + int? appointmentNo; + String? appointmentDate; + int? appointmentType; + int? patientMRN; + String? createdOn; + int? clinicID; + String? nationalityID; + String? age; + String? doctorImageURL; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nationalityFlagURL; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referralDoctorName; + String? referralClinicDescription; + String? referringDoctorName; + bool? isReferralDoctorSameBranch; + String? referralStatusDesc; MyReferredPatientModel({ this.rowID, diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 1372cfd6..27ec4498 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -23,19 +23,19 @@ */ class OrdersRequest { - int visitType; - int admissionNo; - int projectID; - int languageID; - String stamp; - String iPAdress; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - double versionID; + int? visitType; + int? admissionNo; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + double? versionID; OrdersRequest( {this.visitType , diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2dec82d1..19bc8ae1 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,67 +1,67 @@ // TODO : it have to be changed. class PatiantInformtion { - final PatiantInformtion patientDetails; - int genderInt; + final PatiantInformtion? patientDetails; + int? genderInt; dynamic age; - String appointmentDate; - int appointmentNo; - String appointmentType; - int appointmentTypeId; - String arrivedOn; - int clinicGroupId; - String companyName; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + int? appointmentTypeId; + String? arrivedOn; + int? clinicGroupId; + String? companyName; dynamic dischargeStatus; dynamic doctorDetails; - int doctorId; - String endTime; - int episodeNo; - int fallRiskScore; - bool isSigned; - int medicationOrders; - String mobileNumber; - String nationality; - int projectId; - int clinicId; - int patientId; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - String fullName; - String fullNameN; - int gender; - String dateofBirth; - String nationalityId; - String emailAddress; - String patientIdentificationNo; - int patientType; - int patientMRN; - String admissionNo; - String admissionDate; - String createdOn; - String roomId; - String bedId; - String nursingStationId; - String description; - String clinicDescription; - String clinicDescriptionN; - String nationalityName; - String nationalityNameN; - String genderDescription; - String nursingStationName; - String startTime; - String visitType; - String nationalityFlagURL; - int patientStatusType; - int visitTypeId; - String startTimes; - String dischargeDate; - int status; + int? doctorId; + String? endTime; + int? episodeNo; + int? fallRiskScore; + bool? isSigned; + int? medicationOrders; + String? mobileNumber; + String? nationality; + int? projectId; + int? clinicId; + int? patientId; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + String? fullName; + String? fullNameN; + int? gender; + String? dateofBirth; + String? nationalityId; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + int? patientMRN; + String? admissionNo; + String? admissionDate; + String? createdOn; + String? roomId; + String? bedId; + String? nursingStationId; + String? description; + String? clinicDescription; + String? clinicDescriptionN; + String? nationalityName; + String? nationalityNameN; + String? genderDescription; + String? nursingStationName; + String? startTime; + String? visitType; + String? nationalityFlagURL; + int? patientStatusType; + int? visitTypeId; + String? startTimes; + String? dischargeDate; + int? status; PatiantInformtion( {this.patientDetails, this.projectId, diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 1d0da9c5..ce401222 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -1,12 +1,12 @@ class GetPatientArrivalListRequestModel { - String vidaAuthTokenID; - String from; - String to; - String doctorID; - int pageIndex; - int pageSize; - int clinicID; - int patientMRN; + String? vidaAuthTokenID; + String? from; + String? to; + String? doctorID; + int? pageIndex; + int? pageSize; + int? clinicID; + int? patientMRN; GetPatientArrivalListRequestModel( {this.vidaAuthTokenID, diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index 7368c538..26d6be48 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -7,54 +7,54 @@ *@desc: */ class PatientModel { - int ProjectID; - int ClinicID; - int DoctorID; - String FirstName; - - String MiddleName; - String LastName; - String PatientMobileNumber; - String PatientIdentificationID; - int PatientID; - String From; - String To; - int LanguageID; - String stamp; - String IPAdress; - double VersionID; - int Channel; - String TokenID; - String SessionID; - bool IsLoginForDoctorApp; - bool PatientOutSA; - int Searchtype; - String IdentificationNo; - String MobileNo; - int get getProjectID => ProjectID; + int? ProjectID; + int? ClinicID; + int? DoctorID; + String? FirstName; + + String? MiddleName; + String? LastName; + String? PatientMobileNumber; + String? PatientIdentificationID; + int? PatientID; + String? From; + String? To; + int? LanguageID; + String? stamp; + String? IPAdress; + double? VersionID; + int? Channel; + String? TokenID; + String? SessionID; + bool? IsLoginForDoctorApp; + bool? PatientOutSA; + int? Searchtype; + String? IdentificationNo; + String? MobileNo; + int? get getProjectID => ProjectID; set setProjectID(int ProjectID) => this.ProjectID = ProjectID; - int get getClinicID => ClinicID; + int? get getClinicID => ClinicID; set setClinicID(int ClinicID) => this.ClinicID = ClinicID; - int get getDoctorID => DoctorID; + int? get getDoctorID => DoctorID; set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; - String get getFirstName => FirstName; + String? get getFirstName => FirstName; set setFirstName(String FirstName) => this.FirstName = FirstName; - String get getMiddleName => MiddleName; + String? get getMiddleName => MiddleName; set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; - String get getLastName => LastName; + String? get getLastName => LastName; set setLastName(String LastName) => this.LastName = LastName; - String get getPatientMobileNumber => PatientMobileNumber; + String? get getPatientMobileNumber => PatientMobileNumber; set setPatientMobileNumber(String PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber; @@ -63,52 +63,52 @@ class PatientModel { // set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; - int get getPatientID => PatientID; + int? get getPatientID => PatientID; set setPatientID(int PatientID) => this.PatientID = PatientID; - String get getFrom => From; + String? get getFrom => From; set setFrom(String From) => this.From = From; - String get getTo => To; + String? get getTo => To; set setTo(String To) => this.To = To; - int get getLanguageID => LanguageID; + int? get getLanguageID => LanguageID; set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; - String get getStamp => stamp; + String? get getStamp => stamp; set setStamp(String stamp) => this.stamp = stamp; - String get getIPAdress => IPAdress; + String? get getIPAdress => IPAdress; set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; - double get getVersionID => VersionID; + double? get getVersionID => VersionID; set setVersionID(double VersionID) => this.VersionID = VersionID; - int get getChannel => Channel; + int? get getChannel => Channel; set setChannel(int Channel) => this.Channel = Channel; - String get getTokenID => TokenID; + String? get getTokenID => TokenID; set setTokenID(String TokenID) => this.TokenID = TokenID; - String get getSessionID => SessionID; + String? get getSessionID => SessionID; set setSessionID(String SessionID) => this.SessionID = SessionID; - bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; + bool? get getIsLoginForDoctorApp => IsLoginForDoctorApp; set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp; - bool get getPatientOutSA => PatientOutSA; + bool? get getPatientOutSA => PatientOutSA; set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; diff --git a/lib/models/patient/prescription/prescription_report.dart b/lib/models/patient/prescription/prescription_report.dart index 05d28bdc..added64a 100644 --- a/lib/models/patient/prescription/prescription_report.dart +++ b/lib/models/patient/prescription/prescription_report.dart @@ -1,36 +1,36 @@ class PrescriptionReport { - String address; - int appointmentNo; - String clinic; - String companyName; - int days; - String doctorName; - int doseDailyQuantity; - String frequency; - int frequencyNumber; + String? address; + int? appointmentNo; + String? clinic; + String? companyName; + int? days; + String? doctorName; + int? doseDailyQuantity; + String? frequency; + int? frequencyNumber; Null imageExtension; Null imageSRCUrl; Null imageString; Null imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; + String? isCovered; + String? itemDescription; + int? itemID; + String? orderDate; + int? patientID; + String? patientName; + String? phoneOffice1; Null prescriptionQR; - int prescriptionTimes; + int? prescriptionTimes; Null productImage; - String productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String? productImageBase64; + String? productImageString; + int? projectID; + String? projectName; + String? remarks; + String? route; + String? sKU; + int? scaleOffset; + String? startDate; PrescriptionReport( {this.address, diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/models/patient/prescription/prescription_report_for_in_patient.dart index 21cb13b1..cf1e181f 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -1,52 +1,52 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionReportForInPatient { - int admissionNo; - int authorizedBy; + int? admissionNo; + int? authorizedBy; Null bedNo; - String comments; - int createdBy; - String createdByName; + String? comments; + int? createdBy; + String? createdByName; Null createdByNameN; - String createdOn; - String direction; - int directionID; + String? createdOn; + String? direction; + int? directionID; Null directionN; - String dose; - int editedBy; + String? dose; + int? editedBy; Null iVDiluentLine; - int iVDiluentType; + int? iVDiluentType; Null iVDiluentVolume; Null iVRate; Null iVStability; - String itemDescription; - int itemID; - int lineItemNo; - int locationId; - int noOfDoses; - int orderNo; - int patientID; - String pharmacyRemarks; - DateTime prescriptionDatetime; - int prescriptionNo; - String processedBy; - int projectID; - int refillID; - String refillType; + String? itemDescription; + int? itemID; + int? lineItemNo; + int? locationId; + int? noOfDoses; + int? orderNo; + int? patientID; + String? pharmacyRemarks; + DateTime? prescriptionDatetime; + int? prescriptionNo; + String? processedBy; + int? projectID; + int? refillID; + String? refillType; Null refillTypeN; - int reviewedPharmacist; + int? reviewedPharmacist; Null roomId; - String route; - int routeId; + String? route; + int? routeId; Null routeN; Null setupID; - DateTime startDatetime; - int status; - String statusDescription; + DateTime? startDatetime; + int? status; + String? statusDescription; Null statusDescriptionN; - DateTime stopDatetime; - int unitofMeasurement; - String unitofMeasurementDescription; + DateTime? stopDatetime; + int? unitofMeasurement; + String? unitofMeasurementDescription; Null unitofMeasurementDescriptionN; PrescriptionReportForInPatient( diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/models/patient/prescription/prescription_req_model.dart index 9141c282..80bcb1ff 100644 --- a/lib/models/patient/prescription/prescription_req_model.dart +++ b/lib/models/patient/prescription/prescription_req_model.dart @@ -6,19 +6,19 @@ *@desc: PrescriptionReqModel class */ class PrescriptionReqModel { - int patientID; - int setupID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? setupID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; PrescriptionReqModel( {this.patientID, diff --git a/lib/models/patient/prescription/prescription_res_model.dart b/lib/models/patient/prescription/prescription_res_model.dart index 9c7e296d..db864617 100644 --- a/lib/models/patient/prescription/prescription_res_model.dart +++ b/lib/models/patient/prescription/prescription_res_model.dart @@ -6,39 +6,39 @@ *@desc: PrescriptionResModel class */ class PrescriptionResModel { - String setupID; - int projectID; - int patientID; - int appointmentNo; - String appointmentDate; - String doctorName; - String clinicDescription; - String name; - int episodeID; - int actualDoctorRate; - int admission; - int clinicID; - String companyName; - String despensedStatus; - String dischargeDate; - int dischargeNo; - int doctorID; - String doctorImageURL; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isInsurancePatient; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - List speciality; + String? setupID; + int? projectID; + int? patientID; + int? appointmentNo; + String? appointmentDate; + String? doctorName; + String? clinicDescription; + String? name; + int? episodeID; + int? actualDoctorRate; + int? admission; + int? clinicID; + String? companyName; + String? despensedStatus; + String? dischargeDate; + int? dischargeNo; + int? doctorID; + String? doctorImageURL; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isInsurancePatient; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + List? speciality; PrescriptionResModel( {this.setupID, diff --git a/lib/models/patient/prescription/request_prescription_report.dart b/lib/models/patient/prescription/request_prescription_report.dart index 0581692e..3546210d 100644 --- a/lib/models/patient/prescription/request_prescription_report.dart +++ b/lib/models/patient/prescription/request_prescription_report.dart @@ -1,18 +1,18 @@ class RequestPrescriptionReport { - int projectID; - int appointmentNo; - int episodeID; - String setupID; - int patientTypeID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? appointmentNo; + int? episodeID; + String? setupID; + int? patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestPrescriptionReport( {this.projectID, diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index fe0add5f..d7e2c131 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -23,19 +23,19 @@ */ class ProgressNoteRequest { - int visitType; - int admissionNo; - int projectID; - int languageID; - String stamp; - String iPAdress; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - double versionID; + int? visitType; + int? admissionNo; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + double? versionID; ProgressNoteRequest( {this.visitType , diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/models/patient/radiology/radiology_req_model.dart index 47154d8b..83c8f847 100644 --- a/lib/models/patient/radiology/radiology_req_model.dart +++ b/lib/models/patient/radiology/radiology_req_model.dart @@ -6,18 +6,18 @@ *@desc: RadiologyReqModel class */ class RadiologyReqModel { - int patientID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RadiologyReqModel( {this.patientID, diff --git a/lib/models/patient/radiology/radiology_res_model.dart b/lib/models/patient/radiology/radiology_res_model.dart index 6c6509a9..e53d55d4 100644 --- a/lib/models/patient/radiology/radiology_res_model.dart +++ b/lib/models/patient/radiology/radiology_res_model.dart @@ -6,20 +6,20 @@ *@desc: RadiologyResModel class */ class RadiologyResModel { - String setupID; - int projectID; - int patientID; - int invoiceLineItemNo; - int invoiceNo; - String reportData; - String imageURL; - int clinicId; - int doctorId; - String reportDate; - String clinicName; - String doctorImageURL; - String doctorName; - String projectName; + String? setupID; + int? projectID; + int? patientID; + int? invoiceLineItemNo; + int? invoiceNo; + String? reportData; + String? imageURL; + int? clinicId; + int? doctorId; + String? reportDate; + String? clinicName; + String? doctorImageURL; + String? doctorName; + String? projectName; Null statusDescription; RadiologyResModel( diff --git a/lib/models/patient/reauest_prescription_report_for_in_patient.dart b/lib/models/patient/reauest_prescription_report_for_in_patient.dart index 857705c4..fe5b93ec 100644 --- a/lib/models/patient/reauest_prescription_report_for_in_patient.dart +++ b/lib/models/patient/reauest_prescription_report_for_in_patient.dart @@ -1,17 +1,17 @@ class RequestPrescriptionReportForInPatient { - int patientID; - int projectID; - int admissionNo; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? projectID; + int? admissionNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RequestPrescriptionReportForInPatient( {this.patientID, diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index 83db54f4..c47e1ef4 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -10,30 +10,30 @@ class ReferToDoctorRequest { *@desc: ReferToDoctor */ - int projectID; - int admissionNo; - String roomID; - String referralClinic; - String referralDoctor; - int createdBy; - int editedBy; - int patientID; - int patientTypeID; - int referringClinic; - int referringDoctor; - String referringDoctorRemarks; - String priority; - String frequency; - String extension; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? admissionNo; + String? roomID; + String? referralClinic; + String? referralDoctor; + int? createdBy; + int? editedBy; + int? patientID; + int? patientTypeID; + int? referringClinic; + int? referringDoctor; + String? referringDoctorRemarks; + String? priority; + String? frequency; + String? extension; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; /* @@ -66,27 +66,27 @@ class ReferToDoctorRequest { */ ReferToDoctorRequest( - {@required this.projectID, - @required this.admissionNo, - @required this.roomID , - @required this.referralClinic, - @required this.referralDoctor , - @required this.createdBy, - @required this.editedBy , - @required this.patientID, - @required this.patientTypeID, - @required this.referringClinic, - @required this.referringDoctor, - @required this.referringDoctorRemarks, - @required this.priority , - @required this.frequency, - @required this.extension, + {required this.projectID, + required this.admissionNo, + required this.roomID , + required this.referralClinic, + required this.referralDoctor , + required this.createdBy, + required this.editedBy , + required this.patientID, + required this.patientTypeID, + required this.referringClinic, + required this.referringDoctor, + required this.referringDoctorRemarks, + required this.priority , + required this.frequency, + required this.extension, this.languageID = 2, this.stamp = "2020-06-03T11:26:42.358Z", this.iPAdress = "11.11.11.11", this.versionID = 5.5, this.channel = 9, - @required this.tokenID, + required this.tokenID, this.sessionID = "JBXRsDl37L", this.isLoginForDoctorApp = true, this.patientOutSA = false}); diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/models/patient/request_my_referral_patient_model.dart index 219b7b2a..4a76b5a9 100644 --- a/lib/models/patient/request_my_referral_patient_model.dart +++ b/lib/models/patient/request_my_referral_patient_model.dart @@ -1,26 +1,26 @@ class RequestMyReferralPatientModel { - int projectID; - int clinicID; - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? clinicID; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestMyReferralPatientModel( {this.projectID, diff --git a/lib/models/patient/topten_users_res_model.dart b/lib/models/patient/topten_users_res_model.dart index 3454568f..d276bcb0 100644 --- a/lib/models/patient/topten_users_res_model.dart +++ b/lib/models/patient/topten_users_res_model.dart @@ -10,8 +10,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; //ModelResponse class ModelResponse { - final List list; - String firstName; + final List? list; + String? firstName; ModelResponse({ this.list, this.firstName, @@ -20,7 +20,7 @@ class ModelResponse { factory ModelResponse.fromJson(List parsedJson) { - List list = new List(); + List list = []; list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index 57133a08..cb126d94 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,33 +1,33 @@ class VitalSignData { - int appointmentNo; - int bloodPressureCuffLocation; - int bloodPressureCuffSize; - int bloodPressureHigher; - int bloodPressureLower; - int bloodPressurePatientPosition; + int? appointmentNo; + int? bloodPressureCuffLocation; + int? bloodPressureCuffSize; + int? bloodPressureHigher; + int? bloodPressureLower; + int? bloodPressurePatientPosition; var bodyMassIndex; - int fio2; - int headCircumCm; + int? fio2; + int? headCircumCm; var heightCm; - int idealBodyWeightLbs; - bool isPainManagementDone; - bool isVitalsRequired; - int leanBodyWeightLbs; - String painCharacter; - String painDuration; - String painFrequency; - String painLocation; - int painScore; - int patientMRN; - int patientType; - int pulseBeatPerMinute; - int pulseRhythm; - int respirationBeatPerMinute; - int respirationPattern; - int sao2; - int status; + int? idealBodyWeightLbs; + bool? isPainManagementDone; + bool? isVitalsRequired; + int? leanBodyWeightLbs; + String? painCharacter; + String? painDuration; + String? painFrequency; + String? painLocation; + int? painScore; + int? patientMRN; + int? patientType; + int? pulseBeatPerMinute; + int? pulseRhythm; + int? respirationBeatPerMinute; + int? respirationPattern; + int? sao2; + int? status; var temperatureCelcius; - int temperatureCelciusMethod; + int? temperatureCelciusMethod; var waistSizeInch; var weightKg; diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/models/patient/vital_sign/patient-vital-sign-history.dart index ed39a86e..d3d445f6 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-history.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-history.dart @@ -25,9 +25,9 @@ class VitalSignHistory { var painDuration; var painCharacter; var painFrequency; - bool isPainManagementDone; + bool? isPainManagementDone; var status; - bool isVitalsRequired; + bool? isVitalsRequired; var patientID; var createdOn; var doctorID; diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index 2cfd24c2..8d487d91 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -7,20 +7,20 @@ *@desc: VitalSignReqModel */ class VitalSignReqModel { - int patientID; - int projectID; - int patientTypeID; - int inOutpatientType; - int transNo; - int languageID; - String stamp ; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? projectID; + int? patientTypeID; + int? inOutpatientType; + int? transNo; + int? languageID; + String? stamp ; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; VitalSignReqModel( {this.patientID, diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/models/patient/vital_sign/vital_sign_res_model.dart index 78af108d..d5b8cbc4 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -34,9 +34,9 @@ class VitalSignResModel { var painDuration; var painCharacter; var painFrequency; - bool isPainManagementDone; + bool? isPainManagementDone; var status; - bool isVitalsRequired; + bool? isVitalsRequired; var patientID; var createdOn; var doctorID; @@ -44,7 +44,7 @@ class VitalSignResModel { var triageCategory; var gCScore; var lineItemNo; - DateTime vitalSignDate; + DateTime? vitalSignDate; var actualTimeTaken; var sugarLevel; var fBS; diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index 90b5c378..96775f37 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -8,17 +8,17 @@ */ class PharmaciesListRequestModel { - int itemID; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - int channel; + int? itemID; + int? languageID; + String? stamp; + String? ipAdress; + double? versionID; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + int? channel; PharmaciesListRequestModel( {this.itemID, diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 4f2e947a..801fed36 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -7,18 +7,18 @@ */ class PharmaciesItemsRequestModel { - String pHRItemName; - int pageIndex = 0; - int pageSize = 20; - double versionID = 5.5; - int channel = 3; - int languageID = 2; - String iPAdress = "10.20.10.20"; - String generalid = "Cs2020@2016\$2958"; - int patientOutSA = 0; - String sessionID = "KvFJENeAUCxyVdIfEkHw"; - bool isDentalAllowedBackend = false; - int deviceTypeID = 2; + String? pHRItemName; + int? pageIndex = 0; + int? pageSize = 20; + double? versionID = 5.5; + int? channel = 3; + int? languageID = 2; + String? iPAdress = "10.20.10.20"; + String? generalid = "Cs2020@2016\$2958"; + int? patientOutSA = 0; + String? sessionID = "KvFJENeAUCxyVdIfEkHw"; + bool? isDentalAllowedBackend = false; + int? deviceTypeID = 2; PharmaciesItemsRequestModel( {this.pHRItemName, diff --git a/lib/models/sickleave/add_sickleave_request.dart b/lib/models/sickleave/add_sickleave_request.dart index d398153b..5e098da5 100644 --- a/lib/models/sickleave/add_sickleave_request.dart +++ b/lib/models/sickleave/add_sickleave_request.dart @@ -1,9 +1,9 @@ class AddSickLeaveRequest { - String patientMRN; - String appointmentNo; - String startDate; - String noOfDays; - String remarks; + String? patientMRN; + String? appointmentNo; + String? startDate; + String? noOfDays; + String? remarks; AddSickLeaveRequest( {this.patientMRN, diff --git a/lib/models/sickleave/extend_sick_leave_request.dart b/lib/models/sickleave/extend_sick_leave_request.dart index 8b61eb90..026fc8bd 100644 --- a/lib/models/sickleave/extend_sick_leave_request.dart +++ b/lib/models/sickleave/extend_sick_leave_request.dart @@ -1,8 +1,8 @@ class ExtendSickLeaveRequest { - String patientMRN; - String previousRequestNo; - String noOfDays; - String remarks; + String? patientMRN; + String? previousRequestNo; + String? noOfDays; + String? remarks; ExtendSickLeaveRequest( {this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart index de831213..7cfb292b 100644 --- a/lib/models/sickleave/get_all_sickleave_response.dart +++ b/lib/models/sickleave/get_all_sickleave_response.dart @@ -1,13 +1,13 @@ class GetAllSickLeaveResponse { - int appointmentNo; - bool isExtendedLeave; - int noOfDays; - int patientMRN; - String remarks; - int requestNo; - String startDate; - int status; - String statusDescription; + int? appointmentNo; + bool? isExtendedLeave; + int? noOfDays; + int? patientMRN; + String? remarks; + int? requestNo; + String? startDate; + int? status; + String? statusDescription; GetAllSickLeaveResponse( {this.appointmentNo, this.isExtendedLeave, diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 84517932..21c47215 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -23,7 +23,7 @@ class LoginScreen extends StatefulWidget { } class _LoginScreenState extends State { - String platformImei; + String? platformImei; bool allowCallApi = true; //TODO change AppTextFormField to AppTextFormFieldCustom @@ -34,7 +34,7 @@ class _LoginScreenState extends State { List projectsList = []; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel? authenticationViewModel; @override Widget build(BuildContext context) { @@ -77,8 +77,8 @@ class _LoginScreenState extends State { ), Text( TranslationBase - .of(context) - .welcomeTo, + .of(context)! + .welcomeTo!, style: TextStyle( fontSize: 16, fontWeight: FontWeight @@ -87,8 +87,8 @@ class _LoginScreenState extends State { ), Text( TranslationBase - .of(context) - .drSulaimanAlHabib, + .of(context)! + .drSulaimanAlHabib!, style: TextStyle( color:Color(0xFF2B353E), fontWeight: FontWeight @@ -97,7 +97,7 @@ class _LoginScreenState extends State { .isMobile ? 24 : SizeConfig - .realScreenWidth * + .realScreenWidth! * 0.029, fontFamily: 'Poppins'), ), @@ -109,7 +109,7 @@ class _LoginScreenState extends State { SizeConfig.isMobile ? 16 : SizeConfig - .realScreenWidth * + .realScreenWidth! * 0.030, fontWeight: FontWeight .w600, @@ -129,9 +129,9 @@ class _LoginScreenState extends State { children: [ Container( width: SizeConfig - .realScreenWidth * 0.90, + .realScreenWidth! * 0.90, height: SizeConfig - .realScreenHeight * 0.65, + .realScreenHeight! * 0.65, child: Column( crossAxisAlignment: CrossAxisAlignment @@ -139,13 +139,13 @@ class _LoginScreenState extends State { buildSizedBox(), AppTextFieldCustom( - hintText: TranslationBase.of(context).enterId, + hintText: TranslationBase.of(context)!.enterId, hasBorder: true, controller: userIdController, onChanged: (value){ if (value != null) setState(() { - authenticationViewModel.userInfo + authenticationViewModel!.userInfo .userID = value .trim(); @@ -154,21 +154,21 @@ class _LoginScreenState extends State { ), buildSizedBox(), AppTextFieldCustom( - hintText: TranslationBase.of(context).enterPassword, + hintText: TranslationBase.of(context)!.enterPassword, hasBorder: true, isSecure: true, controller: passwordController, onChanged: (value){ if (value != null) setState(() { - authenticationViewModel.userInfo + authenticationViewModel!.userInfo .password = value .trim(); }); if(allowCallApi) { this.getProjects( - authenticationViewModel.userInfo + authenticationViewModel!.userInfo .userID); setState(() { allowCallApi = false; @@ -181,7 +181,7 @@ class _LoginScreenState extends State { ), buildSizedBox(), AppTextFieldCustom( - hintText: TranslationBase.of(context).selectYourProject, + hintText: TranslationBase.of(context)!.selectYourProject, hasBorder: true, controller: projectIdController, isTextFieldHasSuffix: true, @@ -221,13 +221,13 @@ class _LoginScreenState extends State { children: [ AppButton( title: TranslationBase - .of(context) + .of(context)! .login, color: Color(0xFFD02127), fontWeight: FontWeight.w700, - disabled: authenticationViewModel.userInfo + disabled: authenticationViewModel!.userInfo .userID == null || - authenticationViewModel.userInfo + authenticationViewModel!.userInfo .password == null, onPressed: () { @@ -250,13 +250,13 @@ class _LoginScreenState extends State { } login(context,) async { - if (loginFormKey.currentState.validate()) { - loginFormKey.currentState.save(); + if (loginFormKey.currentState!.validate()) { + loginFormKey.currentState!.save(); GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.login(authenticationViewModel.userInfo); - if (authenticationViewModel.state == ViewState.ErrorLocal) { + await authenticationViewModel!.login(authenticationViewModel!.userInfo); + if (authenticationViewModel!.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(authenticationViewModel.error); + Helpers.showErrorToast(authenticationViewModel!.error); } else { GifLoaderDialogUtils.hideDialog(context); @@ -264,7 +264,7 @@ class _LoginScreenState extends State { MaterialPageRoute( builder: (BuildContext context) => VerificationMethodsScreen( - password: authenticationViewModel.userInfo.password, + password: authenticationViewModel!.userInfo.password, ), ), ); @@ -274,22 +274,22 @@ class _LoginScreenState extends State { onSelectProject(index) { setState(() { - authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; - projectIdController.text = projectsList[index].facilityName; + authenticationViewModel!.userInfo.projectID = projectsList[index].facilityId; + projectIdController.text = projectsList[index].facilityName!; }); - primaryFocus.unfocus(); + primaryFocus!.unfocus(); } getProjects(memberID)async { if (memberID != null && memberID != '') { if (projectsList.length == 0) { - await authenticationViewModel.getHospitalsList(memberID); - if(authenticationViewModel.state == ViewState.Idle) { - projectsList = authenticationViewModel.hospitals; + await authenticationViewModel!.getHospitalsList(memberID); + if(authenticationViewModel!.state == ViewState.Idle) { + projectsList = authenticationViewModel!.hospitals; setState(() { - authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; - projectIdController.text = projectsList[0].facilityName; + authenticationViewModel!.userInfo.projectID = projectsList[0].facilityId; + projectIdController.text = projectsList[0].facilityName!; }); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 0ec7f5ee..a1fc2b65 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -42,12 +42,12 @@ class VerificationMethodsScreen extends StatefulWidget { class _VerificationMethodsScreenState extends State { - ProjectViewModel projectsProvider; + ProjectViewModel? projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - AuthMethodTypes fingerPrintBefore; - AuthMethodTypes selectedOption; - AuthenticationViewModel authenticationViewModel; + AuthMethodTypes? fingerPrintBefore; + AuthMethodTypes? selectedOption; + AuthenticationViewModel? authenticationViewModel; @override Widget build(BuildContext context) { @@ -63,7 +63,7 @@ class _VerificationMethodsScreenState extends State { child: FractionallySizedBox( child: Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - height: SizeConfig.realScreenHeight * .95, + height: SizeConfig.realScreenHeight! * .95, width: SizeConfig.realScreenWidth, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -86,7 +86,7 @@ class _VerificationMethodsScreenState extends State { SizedBox( height: 20, ), - authenticationViewModel.user != null && isMoreOption == false + authenticationViewModel!.user != null && isMoreOption == false ? Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -94,13 +94,13 @@ class _VerificationMethodsScreenState extends State { children: [ AppText( - TranslationBase.of(context).welcomeBack, + TranslationBase.of(context)!.welcomeBack, fontSize:12, fontWeight: FontWeight.w700, color: Color(0xFF2B353E), ), AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), + Helpers.capitalize(authenticationViewModel!.user!.doctorName), fontSize: 24, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, @@ -109,7 +109,7 @@ class _VerificationMethodsScreenState extends State { height: 20, ), AppText( - TranslationBase.of(context).accountInfo , + TranslationBase.of(context)!.accountInfo , fontSize: 16, color: Color(0xFF2E303A), fontWeight: FontWeight.w600, @@ -135,8 +135,8 @@ class _VerificationMethodsScreenState extends State { children: [ Text( - TranslationBase.of(context) - .lastLoginAt, + TranslationBase.of(context)! + .lastLoginAt!, overflow: TextOverflow.ellipsis, style: TextStyle( @@ -150,15 +150,15 @@ class _VerificationMethodsScreenState extends State { children: [ AppText( TranslationBase - .of(context) + .of(context)! .verifyWith, fontSize: 14, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), AppText( - authenticationViewModel.getType( - authenticationViewModel.user + authenticationViewModel!.getType( + authenticationViewModel!.user! .logInTypeID, context), fontSize: 14, @@ -172,16 +172,16 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start,), Column(children: [ AppText( - authenticationViewModel.user.editedOn != + authenticationViewModel!.user!.editedOn != null ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( - authenticationViewModel.user + authenticationViewModel!.user! .editedOn)) - : authenticationViewModel.user.createdOn != + : authenticationViewModel!.user!.createdOn != null ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user + AppDateUtils.convertStringToDate(authenticationViewModel!.user! .createdOn)) : '--', textAlign: @@ -191,16 +191,16 @@ class _VerificationMethodsScreenState extends State { fontWeight: FontWeight.w700, ), AppText( - authenticationViewModel.user.editedOn != + authenticationViewModel!.user!.editedOn != null ? AppDateUtils.getHour( AppDateUtils.convertStringToDate( - authenticationViewModel.user + authenticationViewModel!.user! .editedOn)) - : authenticationViewModel.user.createdOn != + : authenticationViewModel!.user!.createdOn != null ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user + AppDateUtils.convertStringToDate(authenticationViewModel!.user! .createdOn)) : '--', textAlign: @@ -241,7 +241,7 @@ class _VerificationMethodsScreenState extends State { ? Container( margin: EdgeInsets.only(bottom: 20, top: 30), child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .verifyLoginWith, fontSize: 18, color: Color(0xFF2E303A), @@ -250,14 +250,14 @@ class _VerificationMethodsScreenState extends State { ), ) : AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .verifyFingerprint2, fontSize: SizeConfig.textMultiplier * 2.5, textAlign: TextAlign.start, ), ]), - authenticationViewModel.user != null && isMoreOption == false + authenticationViewModel!.user != null && isMoreOption == false ? Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -279,7 +279,7 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel:authenticationViewModel, authMethodType: SelectedAuthMethodTypesService .getMethodsTypeService( - authenticationViewModel.user + authenticationViewModel!.user! .logInTypeID), authenticateUser: (AuthMethodTypes @@ -383,7 +383,7 @@ class _VerificationMethodsScreenState extends State { ), ), ), - bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( + bottomSheet: authenticationViewModel!.user == null ? SizedBox(height: 0,) : Container( height: 90, width: double.infinity, child: Center( @@ -394,11 +394,11 @@ class _VerificationMethodsScreenState extends State { children: [ AppButton( title: TranslationBase - .of(context) + .of(context)! .useAnotherAccount, color: Color(0xFFD02127),fontWeight: FontWeight.w700, onPressed: () { - authenticationViewModel.deleteUser(); + authenticationViewModel!.deleteUser(); Navigator.pushAndRemoveUntil( AppGlobal.CONTEX, @@ -425,12 +425,12 @@ class _VerificationMethodsScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: widget.password ); - if (authenticationViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(authenticationViewModel.error); + await authenticationViewModel!.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: widget.password ); + if (authenticationViewModel!.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(authenticationViewModel!.error); GifLoaderDialogUtils.hideDialog(context); } else { - authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeForDoctorAppRes); + authenticationViewModel!.setDataAfterSendActivationSuccess(authenticationViewModel!.activationCodeForDoctorAppRes); sharedPref.setString(PASSWORD, widget.password); GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType); @@ -445,14 +445,14 @@ class _VerificationMethodsScreenState extends State { sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel + await authenticationViewModel! .sendActivationCodeVerificationScreen(authMethodType); - if (authenticationViewModel.state == ViewState.ErrorLocal) { + if (authenticationViewModel!.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(authenticationViewModel.error); + Helpers.showErrorToast(authenticationViewModel!.error); } else { - authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeVerificationScreenRes); + authenticationViewModel!.setDataAfterSendActivationSuccess(authenticationViewModel!.activationCodeVerificationScreenRes); if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); @@ -492,7 +492,7 @@ class _VerificationMethodsScreenState extends State { } sendActivationCode(AuthMethodTypes authMethodType) async { - if (authenticationViewModel.user != null) { + if (authenticationViewModel!.user != null) { sendActivationCodeVerificationScreen(authMethodType); } else { sendActivationCodeByOtpNotificationType(authMethodType); @@ -503,7 +503,7 @@ class _VerificationMethodsScreenState extends State { new SMSOTP( context, type, - authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, + authenticationViewModel!.loggedUser != null ? authenticationViewModel!.loggedUser!.mobileNumber : authenticationViewModel!.user!.mobile, (value) { showDialog( context: context, @@ -522,14 +522,14 @@ class _VerificationMethodsScreenState extends State { loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async { if (isActive) { - await authenticationViewModel.showIOSAuthMessages(); + await authenticationViewModel!.showIOSAuthMessages(); if (!mounted) return; - if (authenticationViewModel.user != null && + if (authenticationViewModel!.user != null && (SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == + authenticationViewModel!.user!.logInTypeID) == AuthMethodTypes.Fingerprint || SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { + authenticationViewModel!.user!.logInTypeID) == AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -540,19 +540,19 @@ class _VerificationMethodsScreenState extends State { } checkActivationCode({value}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value); - if (authenticationViewModel.state == ViewState.ErrorLocal) { + await authenticationViewModel!.checkActivationCodeForDoctorApp(activationCode: value); + if (authenticationViewModel!.state == ViewState.ErrorLocal) { Navigator.pop(context); - Helpers.showErrorToast(authenticationViewModel.error); + Helpers.showErrorToast(authenticationViewModel!.error); } else { - await authenticationViewModel.onCheckActivationCodeSuccess(); + await authenticationViewModel!.onCheckActivationCodeSuccess(); navigateToLandingPage(); } } navigateToLandingPage() { - if (authenticationViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(authenticationViewModel.error); + if (authenticationViewModel!.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(authenticationViewModel!.error); } else { Navigator.pushAndRemoveUntil( context, diff --git a/lib/screens/base/base_view.dart b/lib/screens/base/base_view.dart index 7a5c93e6..5f6d8475 100644 --- a/lib/screens/base/base_view.dart +++ b/lib/screens/base/base_view.dart @@ -4,9 +4,9 @@ import 'package:provider/provider.dart'; import '../../locator.dart'; -class BaseView extends StatefulWidget { - final Widget Function(BuildContext context, T model, Widget child) builder; - final Function(T) onModelReady; +class BaseView extends StatefulWidget { + final Widget Function(BuildContext context, T model, Widget child)? builder; + final Function(T)? onModelReady; BaseView({ this.builder, @@ -17,15 +17,15 @@ class BaseView extends StatefulWidget { _BaseViewState createState() => _BaseViewState(); } -class _BaseViewState extends State> { - T model = locator(); +class _BaseViewState extends State> { + T? model = locator(); bool isLogin = false; @override void initState() { if (widget.onModelReady != null) { - widget.onModelReady(model); + widget.onModelReady!(model); } super.initState(); @@ -34,8 +34,8 @@ class _BaseViewState extends State> { @override Widget build(BuildContext context) { return ChangeNotifierProvider.value( - value: model, - child: Consumer(builder: widget.builder), + value: model!, + child: Consumer(builder: widget.builder!), ); } diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 14e446e8..8747c2a0 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -13,11 +13,11 @@ import 'package:url_launcher/url_launcher.dart'; class DoctorReplayChat extends StatelessWidget { - final ListGtMyPatientsQuestions reply; + final ListGtMyPatientsQuestions? reply; TextEditingController msgController = TextEditingController(); - final DoctorReplayViewModel previousModel; + final DoctorReplayViewModel? previousModel; DoctorReplayChat( - {Key key, this.reply, this.previousModel, + {Key? key, this.reply, this.previousModel, }); @override @@ -62,7 +62,7 @@ class DoctorReplayChat extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: reply.patientName + text: reply!.patientName .toString(), style: TextStyle( color: Color(0xFF2B353E), @@ -125,7 +125,7 @@ class DoctorReplayChat extends StatelessWidget { width: 60, height: 60, child: Image.asset( - reply.gender == 1 + reply!.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -136,7 +136,7 @@ class DoctorReplayChat extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - reply.patientName + reply!.patientName .toString(), fontSize: 14, fontFamily: 'Poppins', @@ -149,7 +149,7 @@ class DoctorReplayChat extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" +reply.mobileNumber); + launch("tel://" +reply!.mobileNumber!); }, child: Icon( Icons.phone, @@ -164,14 +164,14 @@ class DoctorReplayChat extends StatelessWidget { children: [ AppText( - reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + reply!.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply!.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w600, color: Colors.white, fontSize: 14, ), AppText( - reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), + reply!.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply!.createdOn)):AppDateUtils.getHour(DateTime.now()), fontSize: 14, fontFamily: 'Poppins', color: Colors.white, @@ -195,7 +195,7 @@ class DoctorReplayChat extends StatelessWidget { child: Container( width: MediaQuery.of(context).size.width * 0.7, child: AppText( - reply.remarks, + reply!.remarks, fontSize: 15, fontFamily: 'Poppins', color: Colors.white, diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index f522561f..4f6bb18a 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -17,9 +17,9 @@ import 'package:flutter/material.dart'; */ class DoctorReplyScreen extends StatelessWidget { - final Function changeCurrentTab; + final Function? changeCurrentTab; - const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key? key, this.changeCurrentTab}) : super(key: key); @override Widget build(BuildContext context) { @@ -29,15 +29,15 @@ class DoctorReplyScreen extends StatelessWidget { }, builder: (_, model, w) => WillPopScope( onWillPop: ()async{ - changeCurrentTab(); + changeCurrentTab!(); return false; }, child: AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context)!.replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ? DrAppEmbeddedError(error: TranslationBase.of(context)!.noItem) : Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: ListView( diff --git a/lib/screens/doctor/my_referral_patient_screen.dart b/lib/screens/doctor/my_referral_patient_screen.dart index 960bbdd9..a6afae04 100644 --- a/lib/screens/doctor/my_referral_patient_screen.dart +++ b/lib/screens/doctor/my_referral_patient_screen.dart @@ -21,11 +21,11 @@ class _MyReferralPatientState extends State { onModelReady: (model) => model.getMyReferralPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).myReferralPatient, + appBarTitle: TranslationBase.of(context)!.myReferralPatient, body: model.listMyReferralPatientModel.length == 0 ? Center( child: AppText( - TranslationBase.of(context).errorNoSchedule, + TranslationBase.of(context)!.errorNoSchedule, color: Theme.of(context).errorColor, ), ) diff --git a/lib/screens/doctor/my_schedule_screen.dart b/lib/screens/doctor/my_schedule_screen.dart index b94b3823..b5283214 100644 --- a/lib/screens/doctor/my_schedule_screen.dart +++ b/lib/screens/doctor/my_schedule_screen.dart @@ -4,44 +4,46 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/doctor/my_schedule_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/html_rich_editor.dart'; import 'package:flutter/material.dart'; +import 'package:html_editor_enhanced/html_editor.dart'; class MyScheduleScreen extends StatelessWidget { - + HtmlEditorController controller = HtmlEditorController(); @override Widget build(BuildContext context) { + return BaseView( - onModelReady: (model) => model.getDoctorSchedule(), + // onModelReady: (model) => model.getDoctorSchedule(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - body: model.listDoctorWorkingHoursTable.length == 0 - ? Center( - child: AppText( - TranslationBase.of(context).errorNoSchedule, - color: Theme.of(context).errorColor, - ), - ) - : Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), + body: SingleChildScrollView( + child: Column( + children: [ + HtmlRichEditor(initialText: "dfdfd", controller:controller ,), + SizedBox(height: 20,), + Container( + child: AppButton( + title: "get Text", + color: Colors.red, + onPressed: () async { + var txr = controller.getText(); - scheduleListByDate(model), - // scheduleListByDate('Wednesday, 8 April '), - ], - ), - ], + print("ddd"); + }), + ), + SizedBox(height: 20,), + Container( + child: AppButton( + title: "set Text", + color: Colors.red, + onPressed: () async { + print("ddd"); + var txr = controller.setText('

This is a heading

This is a paragraph.

'); + }), ), ], ), @@ -49,22 +51,5 @@ class MyScheduleScreen extends StatelessWidget { )); } - Column scheduleListByDate(ScheduleViewModel model ) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Container( - child: Column( - children: model.listDoctorWorkingHoursTable.map((item) { - return MyScheduleWidget(workingHoursTable: item,); - }).toList(), - ), - ), - ], - ); - } -} +} \ No newline at end of file diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 5ef8b617..0ad5ca07 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -16,7 +16,7 @@ class PatientArrivalScreen extends StatefulWidget { class _PatientArrivalScreen extends State with SingleTickerProviderStateMixin { - TabController _tabController; + TabController? _tabController; var _patientSearchFormValues = PatientModel( FirstName: "0", MiddleName: "0", @@ -46,7 +46,7 @@ class _PatientArrivalScreen extends State @override void dispose() { super.dispose(); - _tabController.dispose(); + _tabController!.dispose(); } @override @@ -54,7 +54,7 @@ class _PatientArrivalScreen extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).arrivalpatient, + appBarTitle: TranslationBase.of(context)!.arrivalpatient, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -86,14 +86,14 @@ class _PatientArrivalScreen extends State width: MediaQuery.of(context).size.width * 0.30, child: Center( child: AppText( - TranslationBase.of(context).arrivalpatient), + TranslationBase.of(context)!.arrivalpatient), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( child: AppText( - TranslationBase.of(context).rescheduleLeaves), + TranslationBase.of(context)!.rescheduleLeaves), ), ), ], diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4b7c4f46..fb3054cd 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -28,8 +28,8 @@ class DashboardSliderItemWidget extends StatelessWidget { child: ListView( scrollDirection: Axis.horizontal, children: - List.generate(item.summaryoptions.length, (int index) { - return GetActivityButton(item.summaryoptions[index]); + List.generate(item.summaryoptions!.length, (int index) { + return GetActivityButton(item.summaryoptions![index]); }))) ], ); diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index a6dc12eb..30c903e6 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -140,14 +140,14 @@ class _DashboardSwipeWidgetState extends State { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .patients, fontSize: 12, fontWeight: FontWeight.bold, fontHeight: 0.5, ), AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .referral, fontSize: 22, fontWeight: FontWeight.bold, @@ -163,30 +163,30 @@ class _DashboardSwipeWidgetState extends State { Expanded( child: RowCounts( dashboardItemList[2] - .summaryoptions[0] + .summaryoptions![0] .kPIParameter, dashboardItemList[2] - .summaryoptions[0] + .summaryoptions![0] .value, Colors.black), ), Expanded( child: RowCounts( dashboardItemList[2] - .summaryoptions[1] + .summaryoptions![1] .kPIParameter, dashboardItemList[2] - .summaryoptions[1] + .summaryoptions![1] .value, Colors.grey), ), Expanded( child: RowCounts( dashboardItemList[2] - .summaryoptions[2] + .summaryoptions![2] .kPIParameter, dashboardItemList[2] - .summaryoptions[2] + .summaryoptions![2] .value, Colors.red), ), @@ -226,35 +226,35 @@ class _DashboardSwipeWidgetState extends State { return Container(); } - static List> _createReferralData( + static List> _createReferralData( List dashboardItemList) { final data = [ new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), + dashboardItemList[2].summaryoptions![0].kPIParameter, + getValue(dashboardItemList[1].summaryoptions![0].value), charts.MaterialPalette.black), new GaugeSegment( - dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), + dashboardItemList[2].summaryoptions![1].kPIParameter, + getValue(dashboardItemList[1].summaryoptions![1].value), charts.MaterialPalette.gray.shadeDefault), new GaugeSegment( - dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), + dashboardItemList[2].summaryoptions![2].kPIParameter, + getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault), ]; return [ - new charts.Series( + new charts.Series( id: 'Segments', domainFn: (GaugeSegment segment, _) => segment.segment, - measureFn: (GaugeSegment segment, _) => segment.size, + measureFn: (GaugeSegment segment, _) => segment.size!, data: data, colorFn: (GaugeSegment segment, _) => segment.color, ) ]; } - static int getValue(value) { + static int? getValue(value) { return value == 0 ? 1 : value; } } diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 503bbe60..385c1fdd 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -5,24 +5,24 @@ class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, this.imageName, - @required this.child, + required this.child, this.onTap, - Key key, + Key? key, this.color, this.opacity = 0.4, this.margin}) : super(key: key); final bool hasBorder; - final String imageName; + final String? imageName; final Widget child; - final Function onTap; - final Color color; + final Function? onTap; + final Color? color; final double opacity; - final EdgeInsets margin; + final EdgeInsets? margin; @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Container( width: 120, height: MediaQuery.of(context).orientation == Orientation.portrait diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index bdaac7a7..dd5bb36d 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -4,20 +4,20 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { - final Color backgroundColor; + final Color? backgroundColor; final IconData cardIcon; final Color backgroundIconColor; - final String text; + final String? text; final Color textColor; final Function onTap; HomePatientCard({ - @required this.backgroundColor, - @required this.backgroundIconColor, - @required this.cardIcon, - @required this.text, - @required this.textColor, - @required this.onTap, + required this.backgroundColor, + required this.backgroundIconColor, + required this.cardIcon, + required this.text, + required this.textColor, + required this.onTap, }); @override diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 2827a421..1fc55419 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -34,9 +34,9 @@ import '../../widgets/shared/app_texts_widget.dart'; import 'home_page_card.dart'; class HomeScreen extends StatefulWidget { - HomeScreen({Key key, this.title}) : super(key: key); + HomeScreen({Key? key, this.title}) : super(key: key); - final String title; + final String? title; final String iconURL = 'assets/images/dashboard_icon/'; @override @@ -45,14 +45,14 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel projectsProvider; + ProjectViewModel? projectsProvider; var _isInit = true; - DoctorProfileModel profile; + DoctorProfileModel? profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; var clinicId; - AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel? authenticationViewModel; @override Widget build(BuildContext context) { @@ -172,12 +172,12 @@ class _HomeScreenState extends State { ); }).toList(); }, - onChanged: (newValue) async { + onChanged: (dynamic newValue) async { clinicId = newValue; GifLoaderDialogUtils.showMyDialog( context); await model.changeClinic( - newValue, authenticationViewModel); + newValue, authenticationViewModel!); GifLoaderDialogUtils.hideDialog( context); if (model.state == @@ -201,7 +201,7 @@ class _HomeScreenState extends State { ], ) : AppText( - TranslationBase.of(context).noClinic), + TranslationBase.of(context)!.noClinic), ), ], ), @@ -266,13 +266,13 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).patients, + TranslationBase.of(context)!.patients, fontSize: 12, fontWeight: FontWeight.bold, fontHeight: .5, ), AppText( - TranslationBase.of(context).services, + TranslationBase.of(context)!.services, fontSize: 22, fontWeight: FontWeight.bold, ), @@ -293,7 +293,7 @@ class _HomeScreenState extends State { textColor: Colors.white, text: - TranslationBase.of(context) + TranslationBase.of(context)! .myInPatient, onTap: () { Navigator.push( @@ -309,7 +309,7 @@ class _HomeScreenState extends State { backgroundIconColor: Colors.white38, cardIcon: DoctorApp.arrival_patients, textColor: Colors.black, - text: TranslationBase.of(context) + text: TranslationBase.of(context)! .myOutPatient, onTap: () { String date = @@ -328,8 +328,8 @@ class _HomeScreenState extends State { PatientSearchRequestModel( from: date, to: date, - doctorID: authenticationViewModel - .doctorProfile + doctorID: authenticationViewModel! + .doctorProfile! .doctorID)), )); }, @@ -339,7 +339,7 @@ class _HomeScreenState extends State { backgroundIconColor: Colors.white10, cardIcon: DoctorApp.referral_1, textColor: Colors.white, - text: TranslationBase.of(context) + text: TranslationBase.of(context)! .patientsreferral, onTap: () { Navigator.push( @@ -356,7 +356,7 @@ class _HomeScreenState extends State { backgroundIconColor: Colors.white10, cardIcon: DoctorApp.search, textColor: Colors.white, - text: TranslationBase.of(context) + text: TranslationBase.of(context)! .searchPatient, onTap: () { Navigator.push( @@ -372,7 +372,7 @@ class _HomeScreenState extends State { backgroundIconColor: Colors.black12, cardIcon: DoctorApp.search_medicines, textColor: Color(0xff2B353E), - text: TranslationBase.of(context) + text: TranslationBase.of(context)! .searchMedicine, onTap: () { Navigator.push( diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index 8c9851db..2c9cb02c 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -21,7 +21,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class LiveCarePandingListScreen extends StatefulWidget { // In the constructor, require a item id. - LiveCarePandingListScreen({Key key}) : super(key: key); + LiveCarePandingListScreen({Key? key}) : super(key: key); @override _LiveCarePandingListState createState() => _LiveCarePandingListState(); @@ -31,7 +31,7 @@ class _LiveCarePandingListState extends State { List _data = []; Helpers helpers = new Helpers(); bool _isInit = true; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; @override void didChangeDependencies() { super.didChangeDependencies(); @@ -45,7 +45,7 @@ class _LiveCarePandingListState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).livecare, + appBarTitle: TranslationBase.of(context)!.livecare, body: Container( child: ListView(scrollDirection: Axis.vertical, @@ -96,9 +96,9 @@ class _LiveCarePandingListState extends State { 1, 1), colors: [ Colors.grey[ - 100], + 100]!, Colors.grey[ - 200], + 200]!, ]), boxShadow: [ BoxShadow( @@ -153,8 +153,8 @@ class _LiveCarePandingListState extends State { ), AppText( TranslationBase.of( - context) - .fileNo + + context)! + .fileNo! + item.patientID .toString(), fontSize: 2.0 * @@ -166,8 +166,8 @@ class _LiveCarePandingListState extends State { ), AppText( TranslationBase.of( - context) - .age + + context)! + .age! + ' ' + item.age .toString(), @@ -255,9 +255,9 @@ class _LiveCarePandingListState extends State { MyGlobals myGlobals = new MyGlobals(); class MyGlobals { - GlobalKey _scaffoldKey; + GlobalKey? _scaffoldKey; MyGlobals() { _scaffoldKey = GlobalKey(); } - GlobalKey get scaffoldKey => _scaffoldKey; + GlobalKey? get scaffoldKey => _scaffoldKey; } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 961654cc..c18b8d14 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -24,10 +24,10 @@ class VideoCallPage extends StatefulWidget { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class _VideoCallPageState extends State { - Timer _timmerInstance; + Timer? _timmerInstance; int _start = 0; String _timmer = ''; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; bool _isInit = true; var _tokenData; bool isTransfer = false; @@ -71,13 +71,13 @@ class _VideoCallPageState extends State { }, onCallEnd: () { //TODO handling onCallEnd - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { changeRoute(context); }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { //TODO handling onCalcallNotRespondlEnd - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { changeRoute(context); }); }); @@ -130,7 +130,7 @@ class _VideoCallPageState extends State { height: MediaQuery.of(context).size.height * 0.02, ), Text( - widget.patientData.patientName, + widget.patientData.patientName!, style: TextStyle( color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, @@ -226,7 +226,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {endCall()}, child: - Text(TranslationBase.of(context).endcall), + Text(TranslationBase.of(context)!.endcall!), color: Colors.red, textColor: Colors.white, )), @@ -235,7 +235,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {resumeCall()}, child: - Text(TranslationBase.of(context).resumecall), + Text(TranslationBase.of(context)!.resumecall!), color: Colors.green[900], textColor: Colors.white, ), @@ -244,8 +244,8 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {endCallWithCharge()}, - child: Text(TranslationBase.of(context) - .endcallwithcharge), + child: Text(TranslationBase.of(context)! + .endcallwithcharge!), textColor: Colors.white, ), ), @@ -256,7 +256,7 @@ class _VideoCallPageState extends State { setState(() => {isTransfer = true}) }, child: Text( - TranslationBase.of(context).transfertoadmin), + TranslationBase.of(context)!.transfertoadmin!), color: Colors.yellow[900], ), ), diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index ad7f13cb..18054378 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -17,16 +17,16 @@ class HealthSummaryPage extends StatefulWidget { } class _HealthSummaryPageState extends State { - PatiantInformtion patient; + PatiantInformtion? patient; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - bool isInpatient = routeArgs['isInpatient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; + bool? isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), + onModelReady: (model) => model.getMedicalFile(mrn: patient!.patientId), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( @@ -37,7 +37,7 @@ class _HealthSummaryPageState extends State { isInpatient: isInpatient, ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context)!.medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -55,7 +55,7 @@ class _HealthSummaryPageState extends State { Row( children: [ AppText( - TranslationBase.of(context).health, + TranslationBase.of(context)!.health, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -65,7 +65,7 @@ class _HealthSummaryPageState extends State { Row( children: [ AppText( - TranslationBase.of(context).summary, + TranslationBase.of(context)!.summary, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -83,104 +83,104 @@ class _HealthSummaryPageState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0] - .timelines.length, + itemCount: model.medicalFileList[0].entityList![0] + .timelines!.length, itemBuilder: (BuildContext ctxt, int index) { return InkWell( onTap: () { if (model .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![index] + .timeLineEvents![0] + .consulations! .length != 0) Navigator.push( context, MaterialPageRoute( builder: (context) => MedicalFileDetails( - age: patient.age is String - ? patient.age ?? "" - : "${patient.age}", - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, + age: patient!.age is String + ? patient!.age ?? "" + : "${patient!.age}", + firstName: patient!.firstName, + lastName: patient!.lastName, + gender: patient!.genderDescription, encounterNumber: index, - pp: patient.patientId, + pp: patient!.patientId, patient: patient, doctorName: model .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![index] + .timeLineEvents![0] + .consulations! .isNotEmpty ? model .medicalFileList[0] - .entityList[0] - .timelines[index] + .entityList![0] + .timelines![index] .doctorName : "", clinicName: model .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![index] + .timeLineEvents![0] + .consulations! .isNotEmpty ? model .medicalFileList[0] - .entityList[0] - .timelines[index] + .entityList![0] + .timelines![index] .clinicName : "", doctorImage: model .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![index] + .timeLineEvents![0] + .consulations! .isNotEmpty ? model .medicalFileList[0] - .entityList[0] - .timelines[index] + .entityList![0] + .timelines![index] .doctorImage : "", - episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() + episode: model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations![0].episodeID.toString() : "", - vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), + vistDate: model.medicalFileList[0].entityList![0].timelines![index].date.toString())), ); }, child: DoctorCard( doctorName: model .medicalFileList[0] - .entityList[0] - .timelines[index] + .entityList![0] + .timelines![index] .doctorName, - clinic: model.medicalFileList[0].entityList[0] - .timelines[index].clinicName, - branch: model.medicalFileList[0].entityList[0] - .timelines[index].projectName, + clinic: model.medicalFileList[0].entityList![0] + .timelines![index].clinicName, + branch: model.medicalFileList[0].entityList![0] + .timelines![index].projectName, profileUrl: model .medicalFileList[0] - .entityList[0] - .timelines[index] + .entityList![0] + .timelines![index] .doctorImage, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.medicalFileList[0].entityList[0] - .timelines[index].date, + model.medicalFileList[0].entityList![0] + .timelines![index].date, ), isPrescriptions: true, isShowEye: model .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![index] + .timeLineEvents![0] + .consulations! .length != 0 ? true @@ -197,7 +197,7 @@ class _HealthSummaryPageState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) + child: AppText(TranslationBase.of(context)! .noMedicalFileFound), ) ], diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 9bfde511..fb5cb751 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -14,18 +14,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class MedicalFileDetails extends StatefulWidget { - String age; - String firstName; - String lastName; - String gender; - int encounterNumber; - int pp; - PatiantInformtion patient; - String clinicName; - String episode; - String doctorName; - String vistDate; - String doctorImage; + String? age; + String? firstName; + String? lastName; + String? gender; + int? encounterNumber; + int? pp; + PatiantInformtion? patient; + String? clinicName; + String? episode; + String? doctorName; + String? vistDate; + String? doctorImage; MedicalFileDetails( {this.age, @@ -59,18 +59,18 @@ class MedicalFileDetails extends StatefulWidget { } class _MedicalFileDetailsState extends State { - int encounterNumber; - String age; - String firstName; - String lastName; - String gender; - int pp; - PatiantInformtion patient; - String clinicName; - String episode; - String doctorName; - String vistDate; - String doctorImage; + int? encounterNumber; + String? age; + String? firstName; + String? lastName; + String? gender; + int? pp; + PatiantInformtion? patient; + String? clinicName; + String? episode; + String? doctorName; + String? vistDate; + String? doctorImage; _MedicalFileDetailsState( {this.age, @@ -104,8 +104,8 @@ class _MedicalFileDetailsState extends State { AppScaffold( appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, - patientType: patient.patientType.toString() ?? "0", - arrivalType: patient.arrivedOn.toString() ?? 0, + patientType: patient!.patientType.toString() ?? "0", + arrivalType: patient!.arrivedOn.toString() ?? 0 as String?, doctorName: doctorName, profileUrl: doctorImage, clinic: clinicName, @@ -118,7 +118,7 @@ class _MedicalFileDetailsState extends State { ), isArabic: projectViewModel.isArabic)}', ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context)!.medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -129,10 +129,10 @@ class _MedicalFileDetailsState extends State { model.medicalFileList.length != 0 && model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations! .length != 0 ? Padding( @@ -144,10 +144,10 @@ class _MedicalFileDetailsState extends State { if (model.medicalFileList.length != 0 && model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations! .length != 0) Container( @@ -161,7 +161,7 @@ class _MedicalFileDetailsState extends State { Radius.circular(10.0), ), border: Border.all( - color: Colors.grey[200], + color: Colors.grey[200]!, width: 0.5), ), child: Padding( @@ -175,8 +175,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .historyOfPresentIllness + context)! + .historyOfPresentIllness! .toUpperCase(), variant: isHistoryExpand ? "bodyText" @@ -206,11 +206,11 @@ class _MedicalFileDetailsState extends State { shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint! .length, itemBuilder: (BuildContext ctxt, int index) { @@ -229,17 +229,17 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[ + .entityList![ 0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstCheifComplaint[ + .lstCheifComplaint![ index] - .hOPI + .hOPI! .trim(), ), ), @@ -266,10 +266,10 @@ class _MedicalFileDetailsState extends State { if (model.medicalFileList.length != 0 && model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations! .length != 0) Container( @@ -283,7 +283,7 @@ class _MedicalFileDetailsState extends State { Radius.circular(10.0), ), border: Border.all( - color: Colors.grey[200], + color: Colors.grey[200]!, width: 0.5), ), child: Padding( @@ -297,8 +297,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .assessment + context)! + .assessment! .toUpperCase(), variant: isAssessmentExpand @@ -329,11 +329,11 @@ class _MedicalFileDetailsState extends State { shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations![0] + .lstAssessments! .length, itemBuilder: (BuildContext ctxt, int index) { @@ -355,16 +355,16 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .entityList![0] + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstAssessments[ + .lstAssessments![ index] - .iCD10 + .iCD10! .trim(), fontSize: 13.5, fontWeight: @@ -379,8 +379,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .condition + + context)! + .condition! + ": ", fontSize: 12.5, ), @@ -389,17 +389,17 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[ + .entityList![ 0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstAssessments[ + .lstAssessments![ index] - .condition + .condition! .trim(), fontSize: 13.0, fontWeight: @@ -416,15 +416,15 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[ + .entityList![ 0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstAssessments[ + .lstAssessments![ index] .description, fontWeight: @@ -439,8 +439,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .type + + context)! + .type! + ": ", fontSize: 15.5, ), @@ -449,15 +449,15 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[ + .entityList![ 0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstAssessments[ + .lstAssessments![ index] .type, fontSize: 16.0, @@ -475,14 +475,14 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ + .entityList![0] + .timelines![ + encounterNumber!] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![ index] - .remarks + .remarks! .trim(), ), Divider( @@ -509,10 +509,10 @@ class _MedicalFileDetailsState extends State { if (model.medicalFileList.length != 0 && model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations! .length != 0) Container( @@ -526,7 +526,7 @@ class _MedicalFileDetailsState extends State { Radius.circular(10.0), ), border: Border.all( - color: Colors.grey[200], + color: Colors.grey[200]!, width: 0.5), ), child: Padding( @@ -540,8 +540,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .test + context)! + .test! .toUpperCase(), variant: isProcedureExpand ? "bodyText" @@ -571,11 +571,11 @@ class _MedicalFileDetailsState extends State { shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations![0] + .lstProcedure! .length, itemBuilder: (BuildContext ctxt, int index) { @@ -598,17 +598,17 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[ + .entityList![ 0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstProcedure[ + .lstProcedure![ index] - .procedureId + .procedureId! .trim(), fontSize: 13.5, @@ -624,8 +624,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .orderDate + + context)! + .orderDate! + ": ", ), AppText( @@ -635,17 +635,17 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[ + .entityList![ 0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstProcedure[ + .lstProcedure![ index] - .orderDate + .orderDate! .trim(), )), fontSize: @@ -668,15 +668,15 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[ + .entityList![ 0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstProcedure[ + .lstProcedure![ index] .procName, fontWeight: @@ -695,14 +695,14 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .entityList![0] + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstProcedure[ + .lstProcedure![ index] .patientID .toString(), @@ -739,10 +739,10 @@ class _MedicalFileDetailsState extends State { if (model.medicalFileList.length != 0 && model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations! .length != 0) Container( @@ -756,7 +756,7 @@ class _MedicalFileDetailsState extends State { Radius.circular(10.0), ), border: Border.all( - color: Colors.grey[200], + color: Colors.grey[200]!, width: 0.5), ), child: Padding( @@ -770,8 +770,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .physicalSystemExamination + context)! + .physicalSystemExamination! .toUpperCase(), variant: isPhysicalExam ? "bodyText" @@ -801,11 +801,11 @@ class _MedicalFileDetailsState extends State { shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam + .entityList![0] + .timelines![encounterNumber!] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam! .length, itemBuilder: (BuildContext ctxt, int index) { @@ -817,21 +817,21 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText(TranslationBase.of( - context) - .examType + + context)! + .examType! + ": "), AppText( model .medicalFileList[ 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .entityList![0] + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstPhysicalExam[ + .lstPhysicalExam![ index] .examDesc, fontWeight: @@ -846,14 +846,14 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .entityList![0] + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstPhysicalExam[ + .lstPhysicalExam![ index] .examDesc, fontWeight: @@ -865,21 +865,21 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText(TranslationBase.of( - context) - .abnormal + + context)! + .abnormal! + ": "), AppText( model .medicalFileList[ 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ + .entityList![0] + .timelines![ + encounterNumber!] + .timeLineEvents![ 0] - .consulations[ + .consulations![ 0] - .lstPhysicalExam[ + .lstPhysicalExam![ index] .abnormal, fontWeight: @@ -895,12 +895,12 @@ class _MedicalFileDetailsState extends State { model .medicalFileList[ 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ + .entityList![0] + .timelines![ + encounterNumber!] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![ index] .remarks, ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index eeea51c5..9a0b046d 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -31,7 +31,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { MedicineSearchScreen({this.changeLoadingState}); - final Function changeLoadingState; + final Function? changeLoadingState; @override _MedicineSearchState createState() => _MedicineSearchState(); @@ -46,17 +46,17 @@ class _MedicineSearchState extends State { bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - GetMedicationResponseModel _selectedMedication; + GetMedicationResponseModel? _selectedMedication; GlobalKey key = new GlobalKey>(); // String lastWords; List _localeNames = []; - String lastError; + String? lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String reconizedWord; + String? reconizedWord; @override void didChangeDependencies() { @@ -76,7 +76,7 @@ class _MedicineSearchState extends State { // _localeNames = await speech.locales(); // var systemLocale = await speech.systemLocale(); - _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' + _currentLocaleId = TranslationBase.of(context)!.locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; // } @@ -90,7 +90,7 @@ class _MedicineSearchState extends State { InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {IconData icon}) { + {IconData? icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -123,7 +123,7 @@ class _MedicineSearchState extends State { return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).searchMedicine, + appBarTitle: TranslationBase.of(context)!.searchMedicine, body: SingleChildScrollView( child: FractionallySizedBox( widthFactor: 0.97, @@ -147,7 +147,7 @@ class _MedicineSearchState extends State { child: AppTextFormField( borderColor: Colors.white, hintText: - TranslationBase.of(context).searchMedicineNameHere, + TranslationBase.of(context)!.searchMedicineNameHere, controller: myController, onSaved: (value) {}, onFieldSubmitted: (value) { @@ -168,7 +168,7 @@ class _MedicineSearchState extends State { children: [ // TODO change it secondary button and add loading AppButton( - title: TranslationBase.of(context).search, + title: TranslationBase.of(context)!.search, onPressed: () async { await searchMedicine(context, model); }, @@ -184,12 +184,12 @@ class _MedicineSearchState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).youCanFind + + TranslationBase.of(context)!.youCanFind! + (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + " " + - TranslationBase.of(context).itemsInSearch, + TranslationBase.of(context)!.itemsInSearch!, fontWeight: FontWeight.bold, ), ], @@ -245,12 +245,12 @@ class _MedicineSearchState extends State { searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); if (myController.text.isNullOrEmpty()) { - Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + Helpers.showErrorToast(TranslationBase.of(context)!.typeMedicineName); //"Type Medicine Name") return; } if (myController.text.length < 3) { - Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + Helpers.showErrorToast(TranslationBase.of(context)!.moreThan3Letter); return; } @@ -280,7 +280,7 @@ class _MedicineSearchState extends State { // lastWords = "${result.recognizedWords} - ${result.finalResult}"; reconizedWord = result.recognizedWords; lastStatus = ''; - myController.text = reconizedWord; + myController.text = reconizedWord!; Future.delayed(const Duration(seconds: 2), () { // searchMedicine(context); }); diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 49c39c53..b4d4474a 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -19,11 +19,11 @@ import 'package:url_launcher/url_launcher.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class PharmaciesListScreen extends StatefulWidget { - final int itemID; + final int? itemID; - final String url; + final String? url; - PharmaciesListScreen({Key key, @required this.itemID, this.url}) + PharmaciesListScreen({Key? key, required this.itemID, this.url}) : super(key: key); @override @@ -32,7 +32,7 @@ class PharmaciesListScreen extends StatefulWidget { class _PharmaciesListState extends State { Helpers helpers = new Helpers(); - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override @@ -42,7 +42,7 @@ class _PharmaciesListState extends State { onModelReady: (model) => model.getPharmaciesList(widget.itemID), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).pharmaciesList, + appBarTitle: TranslationBase.of(context)!.pharmaciesList, body: Container( height: SizeConfig.screenHeight, child: ListView( @@ -61,7 +61,7 @@ class _PharmaciesListState extends State { BorderRadius.all(Radius.circular(7)), child: widget.url != null ? Image.network( - widget.url, + widget.url!, height: SizeConfig.imageSizeMultiplier * 21, @@ -81,7 +81,7 @@ class _PharmaciesListState extends State { CrossAxisAlignment.stretch, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .description, marginLeft: 10, marginTop: 0, @@ -97,7 +97,7 @@ class _PharmaciesListState extends State { marginBottom: 10, ), AppText( - TranslationBase.of(context).price, + TranslationBase.of(context)!.price, marginLeft: 10, marginTop: 0, marginRight: 10, @@ -127,7 +127,7 @@ class _PharmaciesListState extends State { child: Align( alignment: Alignment.centerLeft, child: AppText( - TranslationBase.of(context).youCanFindItIn, + TranslationBase.of(context)!.youCanFindItIn, fontWeight: FontWeight.bold, ), ), @@ -136,7 +136,7 @@ class _PharmaciesListState extends State { : Alignment.topLeft, ), Container( - width: SizeConfig.screenWidth * 0.99, + width: SizeConfig.screenWidth! * 0.99, margin: EdgeInsets.only(left: 10,right: 10), child: ListView.builder( shrinkWrap: true, diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 7f314c0e..f32f94cc 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -80,7 +80,7 @@ class _DischargedPatientState extends State { left: 10, top: 10), child: AppText( TranslationBase.of( - context) + context)! .searchPatientName, fontSize: 13, )), @@ -94,6 +94,7 @@ class _DischargedPatientState extends State { color: Colors.black, ), iconSize: 20, + onPressed: null, padding: EdgeInsets.only( bottom: 30), @@ -141,11 +142,11 @@ class _DischargedPatientState extends State { child: AppText( (Helpers.capitalize(model .filterData[index] - .firstName) + + .firstName)! + " " + Helpers.capitalize(model .filterData[index] - .lastName)), + .lastName)!), fontSize: 16, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -166,9 +167,9 @@ class _DischargedPatientState extends State { children: [ AppText( model.filterData[index].nationalityName != null - ? model.filterData[index].nationalityName.trim() + ? model.filterData[index].nationalityName!.trim() : model.filterData[index].nationality != null - ? model.filterData[index].nationality.trim() + ? model.filterData[index].nationality!.trim() : model.filterData[index].nationalityId != null ? model.filterData[index].nationalityId : "", @@ -187,14 +188,14 @@ class _DischargedPatientState extends State { BorderRadius.circular(20.0), child: Image.network( model.filterData[index].nationalityFlagURL != null ? - model.filterData[index].nationalityFlagURL + model.filterData[index].nationalityFlagURL! : '', height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return AppText( '', fontSize: 10, @@ -243,7 +244,7 @@ class _DischargedPatientState extends State { color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context) + text: TranslationBase.of(context)! .fileNumber, style: TextStyle( fontSize: 14, @@ -273,7 +274,7 @@ class _DischargedPatientState extends State { children: [ new TextSpan( text: model.filterData[index].admissionDate == null ? "" : - TranslationBase.of(context).admissionDate + " : ", + TranslationBase.of(context)!.admissionDate! + " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: model.filterData[index].admissionDate == null ? "" @@ -312,7 +313,7 @@ class _DischargedPatientState extends State { Row( children: [ AppText( - "${TranslationBase.of(context).numOfDays}: ", + "${TranslationBase.of(context)!.numOfDays}: ", fontSize: 14,fontWeight: FontWeight.w300, ), AppText( diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 33692628..2bbf3d97 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -17,14 +17,14 @@ import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patient-type']; - String arrivalType = routeArgs['arrival-type']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patient-type']; + String? arrivalType = routeArgs['arrival-type']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getECGPatient( - patientType: patient.patientType, + patientType: patient!.patientType, patientOutSA: 0, patientID: patient.patientId), builder: (_, model, w) => AppScaffold( @@ -46,7 +46,7 @@ class ECGPage extends StatelessWidget { ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { await launch( - model.patientMuseResultsModelList[index].imageURL); + model.patientMuseResultsModelList[index].imageURL!); }, child: Container( width: double.infinity, @@ -78,7 +78,7 @@ class ECGPage extends StatelessWidget { children: [ new TextSpan( text: - TranslationBase.of(context).orderNo, + TranslationBase.of(context)!.orderNo, style: TextStyle( fontSize: 12, fontFamily: @@ -101,7 +101,7 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), - AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), + AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime!)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), ], ), ), diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index 1b42d305..ac634898 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -46,7 +46,7 @@ class _InPatientPageState extends State { Container( margin: EdgeInsets.all(16.0), child: AppTextFieldCustom( - hintText: TranslationBase.of(context).searchPatientName, + hintText: TranslationBase.of(context)!.searchPatientName, isTextFieldHasSuffix: true, suffixIcon: IconButton( icon: Icon( @@ -80,7 +80,7 @@ class _InPatientPageState extends State { isMyPatient: model .filteredInPatientItems[index] .doctorId == - model.doctorProfile.doctorID, + model.doctorProfile!.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -104,7 +104,7 @@ class _InPatientPageState extends State { ); else if (model.filteredInPatientItems[index] .doctorId == - model.doctorProfile.doctorID && + model.doctorProfile!.doctorID && widget.isMyInPatient) return PatientCard( patientInfo: @@ -115,7 +115,7 @@ class _InPatientPageState extends State { isMyPatient: model .filteredInPatientItems[index] .doctorId == - model.doctorProfile.doctorID, + model.doctorProfile!.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -153,7 +153,7 @@ class _InPatientPageState extends State { child: Container( child: ErrorMessage( error: - TranslationBase.of(context).noDataAvailable)), + TranslationBase.of(context)!.noDataAvailable)), ), ), ], diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 60446887..b3055bd8 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -18,25 +18,25 @@ class PatientInPatientScreen extends StatefulWidget { class _PatientInPatientScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + TabController? _tabController; int _activeTab = 0; @override void initState() { super.initState(); _tabController = TabController(length: 3, vsync: this); - _tabController.addListener(_handleTabSelection); + _tabController!.addListener(_handleTabSelection); } @override void dispose() { super.dispose(); - _tabController.dispose(); + _tabController!.dispose(); } _handleTabSelection() { setState(() { - _activeTab = _tabController.index; + _activeTab = _tabController!.index; }); } @@ -72,7 +72,7 @@ class _PatientInPatientScreenState extends State ), Expanded( child: AppText( - TranslationBase.of(context).inPatient, + TranslationBase.of(context)!.inPatient, fontSize: SizeConfig.textMultiplier * 2.8, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), @@ -109,13 +109,13 @@ class _PatientInPatientScreenState extends State unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll, + TranslationBase.of(context)!.inPatientAll, counter: model.inPatientList.length), tabWidget( screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged), + TranslationBase.of(context)!.discharged), ], ), ), @@ -144,7 +144,7 @@ class _PatientInPatientScreenState extends State ); } - Widget tabWidget(Size screenSize, bool isActive, String title, + Widget tabWidget(Size screenSize, bool isActive, String? title, {int counter = -1}) { return Center( child: Container( diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index f78752ec..28327840 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -241,7 +241,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -274,7 +274,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).refClinic}: ", + "${TranslationBase.of(context)!.refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * @@ -299,8 +299,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + + TranslationBase.of(context)! + .frequency! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -331,7 +331,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + + TranslationBase.of(context)!.priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -425,8 +425,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + + TranslationBase.of(context)! + .maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -506,7 +506,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", + "${TranslationBase.of(context)!.dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * @@ -556,7 +556,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks, + TranslationBase.of(context)!.remarks, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 2.4 * SizeConfig.textMultiplier, diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 92f92f87..264e083f 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -65,10 +65,10 @@ class _ReferralDischargedPatientPageState extends State( - onModelReady: patient.admissionNo != null - ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) + onModelReady: patient!.admissionNo != null + ? (model) => model.getInsuranceInPatient(mrn: patient!.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, + appointmentNo: patient!.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => @@ -52,14 +52,14 @@ class _InsuranceApprovalScreenNewState ), isShowAppBar: true, baseViewModel: model, - appBarTitle: TranslationBase.of(context).approvals, - body: patient.admissionNo != null + appBarTitle: TranslationBase.of(context)!.approvals, + body: patient!.admissionNo != null ? SingleChildScrollView( child: Container( margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, + left: SizeConfig.screenWidth! * 0.004, + right: SizeConfig.screenWidth! * 0.004, + top: SizeConfig.screenWidth! * 0.04, ), child: model.insuranceApprovalInPatient.length != 0 ? Column( @@ -71,7 +71,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context)!.insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -81,7 +81,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context)!.approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -145,7 +145,7 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) + child: AppText(TranslationBase.of(context)! .noInsuranceApprovalFound), ), SizedBox( @@ -159,9 +159,9 @@ class _InsuranceApprovalScreenNewState : SingleChildScrollView( child: Container( margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, + left: SizeConfig.screenWidth! * 0.004, + right: SizeConfig.screenWidth! * 0.004, + top: SizeConfig.screenWidth! * 0.04, ), child: model.insuranceApproval.length != 0 ? Column( @@ -173,7 +173,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, @@ -184,7 +184,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, @@ -245,7 +245,7 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) + child: AppText(TranslationBase.of(context)! .noInsuranceApprovalFound), ) ], diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 92910394..b53057ba 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -13,9 +13,9 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class InsuranceApprovalsDetails extends StatefulWidget { - PatiantInformtion patient; - int indexInsurance; - String patientType; + PatiantInformtion? patient; + int? indexInsurance; + String? patientType; InsuranceApprovalsDetails( {this.patient, this.indexInsurance, this.patientType}); @@ -28,9 +28,9 @@ class InsuranceApprovalsDetails extends StatefulWidget { } class _InsuranceApprovalsDetailsState extends State { - PatiantInformtion patient; - int indexInsurance; - String patientType; + PatiantInformtion? patient; + int? indexInsurance; + String? patientType; _InsuranceApprovalsDetailsState( {this.patient, this.indexInsurance, this.patientType}); @@ -38,16 +38,16 @@ class _InsuranceApprovalsDetailsState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map?; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 - ? patient.admissionNo != null - ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) - : patient.appointmentNo != null + ? patient!.admissionNo != null + ? (model) => model.getInsuranceInPatient(mrn: patient!.patientId) + : patient!.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, - projectId: patient.projectId) + appointmentNo: patient!.appointmentNo, + projectId: patient!.projectId) : (model) => model.getInsuranceApproval(patient) : null, builder: (BuildContext context, InsuranceViewModel model, Widget child) => @@ -55,8 +55,8 @@ class _InsuranceApprovalsDetailsState extends State { isShowAppBar: true, baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString(), patient.arrivedOn), - body: patient.admissionNo != null + patient, patient!.patientType.toString(), patient!.arrivedOn), + body: patient!.admissionNo != null ? SingleChildScrollView( child: Container( child: Column( @@ -68,7 +68,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context)!.insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -78,7 +78,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context)!.approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -107,23 +107,23 @@ class _InsuranceApprovalsDetailsState extends State { AppText( model .insuranceApprovalInPatient[ - indexInsurance] + indexInsurance!] .approvalStatusDescption != null ? model .insuranceApprovalInPatient[ - indexInsurance] + indexInsurance!] .approvalStatusDescption ?? "" : "", color: model .insuranceApprovalInPatient[ - indexInsurance] + indexInsurance!] .approvalStatusDescption != null - ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + ? "${model.insuranceApprovalInPatient[indexInsurance!].approvalStatusDescption}" == "Approved" || - "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "${model.insuranceApprovalInPatient[indexInsurance!].approvalStatusDescption}" == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127) @@ -136,8 +136,8 @@ class _InsuranceApprovalsDetailsState extends State { AppText( model .insuranceApprovalInPatient[ - indexInsurance] - .doctorName + indexInsurance!] + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -167,8 +167,8 @@ class _InsuranceApprovalsDetailsState extends State { child: Image.network( model .insuranceApprovalInPatient[ - indexInsurance] - .doctorImage, + indexInsurance!] + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -196,8 +196,8 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .clinic + + context)! + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, @@ -206,7 +206,7 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( model .insuranceApprovalInPatient[ - indexInsurance] + indexInsurance!] .clinicName, fontSize: 14, ), @@ -217,8 +217,8 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .approvalNo + + context)! + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, @@ -226,7 +226,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( model .insuranceApprovalInPatient[ - indexInsurance] + indexInsurance!] .approvalNo .toString(), fontSize: 14, @@ -243,7 +243,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( model .insuranceApprovalInPatient[ - indexInsurance] + indexInsurance!] .unUsedCount .toString(), fontSize: 14, @@ -254,8 +254,8 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .companyName + + context)! + .companyName! + ": ", color: Colors.grey[500], ), @@ -266,14 +266,14 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .receiptOn + + context)! + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance!].receiptOn), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -285,13 +285,13 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .expiryDate + + context)! + .expiryDate! + ": ", color: Colors.grey[500], ), AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance!].expiryDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -318,21 +318,21 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .usageStatus, fontWeight: FontWeight.w700, ), @@ -351,8 +351,8 @@ class _InsuranceApprovalsDetailsState extends State { physics: ScrollPhysics(), itemCount: model .insuranceApprovalInPatient[ - indexInsurance] - .apporvalDetails + indexInsurance!] + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -367,8 +367,8 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( model .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ + indexInsurance!] + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -383,8 +383,8 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( model .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ + indexInsurance!] + ?.apporvalDetails![ index] ?.status ?? "", @@ -399,8 +399,8 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( model .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ + indexInsurance!] + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", @@ -445,7 +445,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context)!.insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -455,7 +455,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context)!.approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -484,21 +484,21 @@ class _InsuranceApprovalsDetailsState extends State { AppText( model .insuranceApproval[ - indexInsurance] + indexInsurance!] .approvalStatusDescption != null ? model .insuranceApproval[ - indexInsurance] + indexInsurance!] .approvalStatusDescption ?? "" : "", color: model .insuranceApproval[ - indexInsurance] + indexInsurance!] .approvalStatusDescption != null - ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == + ? "${model.insuranceApproval[indexInsurance!].approvalStatusDescption}" == "Approved" ? Color(0xff359846) : Color(0xffD02127) @@ -510,8 +510,8 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( model - .insuranceApproval[indexInsurance] - .doctorName + .insuranceApproval[indexInsurance!] + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -541,8 +541,8 @@ class _InsuranceApprovalsDetailsState extends State { child: Image.network( model .insuranceApproval[ - indexInsurance] - .doctorImage, + indexInsurance!] + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -570,8 +570,8 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .clinic + + context)! + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, @@ -580,7 +580,7 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( model .insuranceApproval[ - indexInsurance] + indexInsurance!] .clinicName, fontSize: 14, ), @@ -591,8 +591,8 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .approvalNo + + context)! + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, @@ -600,7 +600,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( model .insuranceApproval[ - indexInsurance] + indexInsurance!] .approvalNo .toString(), fontSize: 14, @@ -611,8 +611,8 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .unusedCount + + context)! + .unusedCount! + ": ", color: Colors.grey[500], fontSize: 14, @@ -620,7 +620,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( model .insuranceApproval[ - indexInsurance] + indexInsurance!] .unUsedCount .toString(), fontSize: 14, @@ -631,8 +631,8 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .companyName + + context)! + .companyName! + ": ", color: Colors.grey[500], ), @@ -643,14 +643,14 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .receiptOn + + context)! + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance!].rceiptOn), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -662,18 +662,18 @@ class _InsuranceApprovalsDetailsState extends State { children: [ AppText( TranslationBase.of( - context) - .expiryDate + + context)! + .expiryDate! + ": ", color: Colors.grey[500], ), if (model .insuranceApproval[ - indexInsurance] + indexInsurance!] .expiryDate != null) AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance!].expiryDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -700,21 +700,21 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .usageStatus, fontWeight: FontWeight.w700, ), @@ -733,8 +733,8 @@ class _InsuranceApprovalsDetailsState extends State { physics: ScrollPhysics(), itemCount: model .insuranceApproval[ - indexInsurance] - .apporvalDetails + indexInsurance!] + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -749,8 +749,8 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( model .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ + indexInsurance!] + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -765,8 +765,8 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( model .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ + indexInsurance!] + ?.apporvalDetails![ index] ?.status ?? "", @@ -781,8 +781,8 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( model .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ + indexInsurance!] + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 14ae707b..31c04bd9 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -13,11 +13,11 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class FilterDatePage extends StatefulWidget { - final OutPatientFilterType outPatientFilterType; - final PatientSearchViewModel patientSearchViewModel; + final OutPatientFilterType? outPatientFilterType; + final PatientSearchViewModel? patientSearchViewModel; const FilterDatePage( - {Key key, this.outPatientFilterType, this.patientSearchViewModel}) + {Key? key, this.outPatientFilterType, this.patientSearchViewModel}) : super(key: key); @override @@ -69,11 +69,11 @@ class _FilterDatePageState extends State { getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).fromDate, - widget.patientSearchViewModel + TranslationBase.of(context)!.fromDate, + widget.patientSearchViewModel! .selectedFromDate != null - ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel!.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -98,11 +98,11 @@ class _FilterDatePageState extends State { getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).toDate, - widget.patientSearchViewModel + TranslationBase.of(context)!.toDate, + widget.patientSearchViewModel! .selectedToDate != null - ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel!.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -142,30 +142,30 @@ class _FilterDatePageState extends State { widthFactor: .80, child: Center( child: AppButton( - title: TranslationBase.of(context).search, + title: TranslationBase.of(context)!.search, padding: 10, color: Color(0xFF359846), onPressed: () async { - if (widget.patientSearchViewModel.selectedFromDate == + if (widget.patientSearchViewModel!.selectedFromDate == null || - widget.patientSearchViewModel.selectedToDate == + widget.patientSearchViewModel!.selectedToDate == null) { Helpers.showErrorToast( "Please Select All The date Fields "); } else { Duration difference = widget - .patientSearchViewModel.selectedToDate + .patientSearchViewModel!.selectedToDate! .difference(widget - .patientSearchViewModel.selectedFromDate); + .patientSearchViewModel!.selectedFromDate!); if (difference.inDays > 90) { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); } else { String dateTo = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedToDate, + widget.patientSearchViewModel!.selectedToDate!, 'yyyy-MM-dd'); String dateFrom = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate, + widget.patientSearchViewModel!.selectedFromDate!, 'yyyy-MM-dd'); PatientSearchRequestModel currentModel = @@ -174,13 +174,13 @@ class _FilterDatePageState extends State { currentModel.to = dateTo; currentModel.from = dateFrom; GifLoaderDialogUtils.showMyDialog(context); - await widget.patientSearchViewModel + await widget.patientSearchViewModel! .getOutPatient(currentModel, isLocalBusy: true); GifLoaderDialogUtils.hideDialog(context); - if (widget.patientSearchViewModel.state == + if (widget.patientSearchViewModel!.state == ViewState.ErrorLocal) { Helpers.showErrorToast( - widget.patientSearchViewModel.error); + widget.patientSearchViewModel!.error); } else { Navigator.of(context).pop(); } @@ -200,12 +200,12 @@ class _FilterDatePageState extends State { } selectDate(BuildContext context, - {bool isFromDate = true, DateTime firstDate, lastDate}) async { + {bool isFromDate = true, required DateTime firstDate, required lastDate}) async { Helpers.hideKeyboard(context); DateTime selectedDate = isFromDate - ? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate - : this.widget.patientSearchViewModel.selectedToDate ?? lastDate; - final DateTime picked = await showDatePicker( + ? this.widget.patientSearchViewModel!.selectedFromDate ?? firstDate + : this.widget.patientSearchViewModel!.selectedToDate ?? lastDate; + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: firstDate, @@ -215,22 +215,22 @@ class _FilterDatePageState extends State { if (picked != null) { if (isFromDate) { setState(() { - this.widget.patientSearchViewModel.selectedFromDate = picked; + this.widget.patientSearchViewModel!.selectedFromDate = picked; var date = picked.add(Duration(days: 30)); if (date.isBefore(lastDate)) { - this.widget.patientSearchViewModel.selectedToDate = date; + this.widget.patientSearchViewModel!.selectedToDate = date; } else - this.widget.patientSearchViewModel.selectedToDate = lastDate; + this.widget.patientSearchViewModel!.selectedToDate = lastDate; }); } else { setState(() { - this.widget.patientSearchViewModel.selectedToDate = picked; + this.widget.patientSearchViewModel!.selectedToDate = picked; }); } } } - getFirstDate(OutPatientFilterType outPatientFilterType) { + getFirstDate(OutPatientFilterType? outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { return DateTime( DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); @@ -240,7 +240,7 @@ class _FilterDatePageState extends State { } } - getLastDate(OutPatientFilterType outPatientFilterType) { + getLastDate(OutPatientFilterType? outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { return DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); @@ -251,8 +251,8 @@ class _FilterDatePageState extends State { } InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 30400c65..deaec35b 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -35,13 +35,13 @@ class OutPatientsScreen extends StatefulWidget { final isAppbar; final arrivalType; final isView; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; + final PatientType? selectedPatientType; + final PatientSearchRequestModel? patientSearchRequestModel; final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; final bool isSearchAndOut; - final String searchKey; + final String? searchKey; OutPatientsScreen( {this.patientSearchForm, @@ -62,21 +62,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; + int? clinicId; + AuthenticationViewModel? authenticationViewModel; - List _times = []; + List _times = []; int _activeLocation = 1; - String patientType; - String patientTypeTitle; + String? patientType; + String? patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + String? arrivalType; + ProjectViewModel? projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + PatientModel? patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; @@ -84,15 +84,15 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); _times = [ - TranslationBase.of(context).previous, - TranslationBase.of(context).today, - TranslationBase.of(context).nextWeek, + TranslationBase.of(context)!.previous, + TranslationBase.of(context)!.today, + TranslationBase.of(context)!.nextWeek, ]; final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel!); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -135,7 +135,7 @@ class _OutPatientsScreenState extends State { item: item, selectedPatientType: widget.selectedPatientType, patientSearchRequestModel: - widget.patientSearchRequestModel, + widget.patientSearchRequestModel!, isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); GifLoaderDialogUtils.hideDialog(context); @@ -202,7 +202,7 @@ class _OutPatientsScreenState extends State { ), SizedBox(height: 18.5), Container( - width: SizeConfig.screenWidth * 0.9, + width: SizeConfig.screenWidth! * 0.9, height: 75, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), @@ -217,7 +217,7 @@ class _OutPatientsScreenState extends State { Padding( padding: EdgeInsets.only(left: 10, top: 10), child: AppText( - TranslationBase.of(context).searchPatientName, + TranslationBase.of(context)!.searchPatientName, fontSize: 13, )), AppTextFormField( @@ -260,7 +260,7 @@ class _OutPatientsScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) + error: TranslationBase.of(context)! .youDontHaveAnyPatient, ), ) @@ -291,9 +291,9 @@ class _OutPatientsScreenState extends State { "patient": model.filterData[index], "patientType": "1", "from": widget - .patientSearchRequestModel.from, + .patientSearchRequestModel!.from, "to": widget - .patientSearchRequestModel.from, + .patientSearchRequestModel!.from, "isSearch": false, "isInpatient": false, "arrivalType": "7", diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index c7056ce3..3199f1a8 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -10,9 +10,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsScreen extends StatefulWidget { - final PrescriptionResModel prescriptionResModel; + final PrescriptionResModel? prescriptionResModel; - OutPatientPrescriptionDetailsScreen({Key key, this.prescriptionResModel}); + OutPatientPrescriptionDetailsScreen({Key? key, this.prescriptionResModel}); @override _OutPatientPrescriptionDetailsScreenState createState() => @@ -26,10 +26,10 @@ class _OutPatientPrescriptionDetailsScreenState getPrescriptionReport(BuildContext context,PatientViewModel model ){ RequestPrescriptionReport prescriptionReqModel = RequestPrescriptionReport( - appointmentNo: widget.prescriptionResModel.appointmentNo, - episodeID: widget.prescriptionResModel.episodeID, - setupID: widget.prescriptionResModel.setupID, - patientTypeID: widget.prescriptionResModel.patientID); + appointmentNo: widget.prescriptionResModel!.appointmentNo, + episodeID: widget.prescriptionResModel!.episodeID, + setupID: widget.prescriptionResModel!.setupID, + patientTypeID: widget.prescriptionResModel!.patientID); model.getPrescriptionReport(prescriptionReqModel.toJson()); } @override @@ -37,7 +37,7 @@ class _OutPatientPrescriptionDetailsScreenState return BaseView( onModelReady: (model) => getPrescriptionReport(context, model), builder: (_, model, w) => AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionDetails, + appBarTitle: TranslationBase.of(context)!.prescriptionDetails, body: CardWithBgWidgetNew( widget: ListView.builder( itemCount: model.prescriptionReport.length, diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index b9afab7d..a0581838 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -3,9 +3,9 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { - final String title; + final String? title; - const PatientSearchHeader({Key key, this.title}) : super(key: key); + const PatientSearchHeader({Key? key, this.title}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 02bde8d0..5dd05a77 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -23,13 +23,13 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class PatientsSearchResultScreen extends StatefulWidget { - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; + final PatientType? selectedPatientType; + final PatientSearchRequestModel? patientSearchRequestModel; final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; final bool isSearchAndOut; - final String searchKey; + final String? searchKey; PatientsSearchResultScreen( {this.selectedPatientType, @@ -47,18 +47,18 @@ class PatientsSearchResultScreen extends StatefulWidget { class _PatientsSearchResultScreenState extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; + int? clinicId; + AuthenticationViewModel? authenticationViewModel; - String patientType; - String patientTypeTitle; + String? patientType; + String? patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + String? arrivalType; + ProjectViewModel? projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + PatientModel? patient; @override Widget build(BuildContext context) { @@ -67,10 +67,10 @@ class _PatientsSearchResultScreenState onModelReady: (model) async { if (!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel!); } else { await model - .getPatientFileInformation(widget.patientSearchRequestModel); + .getPatientFileInformation(widget.patientSearchRequestModel!); } }, builder: (_, model, w) => AppScaffold( @@ -84,7 +84,7 @@ class _PatientsSearchResultScreenState children: [ SizedBox(height: 18.5), Container( - width: SizeConfig.screenWidth * 0.9, + width: SizeConfig.screenWidth! * 0.9, height: 75, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), @@ -99,7 +99,7 @@ class _PatientsSearchResultScreenState Padding( padding: EdgeInsets.only(left: 10, top: 10), child: AppText( - TranslationBase.of(context).searchPatientName, + TranslationBase.of(context)!.searchPatientName, fontSize: 13, )), AppTextFormField( @@ -107,6 +107,7 @@ class _PatientsSearchResultScreenState controller: _controller, borderColor: Colors.white, prefix: IconButton( + onPressed: null, icon: Icon( DoctorApp.filter_1, color: Colors.black, @@ -126,7 +127,7 @@ class _PatientsSearchResultScreenState child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) + error: TranslationBase.of(context)! .youDontHaveAnyPatient, ), ) @@ -151,9 +152,9 @@ class _PatientsSearchResultScreenState "patient": model.filterData[index], "patientType": "1", "from": widget - .patientSearchRequestModel.from, + .patientSearchRequestModel!.from, "to": widget - .patientSearchRequestModel.from, + .patientSearchRequestModel!.from, "isSearch": widget.isSearch, "isInpatient": widget.isInpatient, "arrivalType": "7", diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index 2275cc09..5c01603b 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -29,7 +29,7 @@ class _PatientSearchScreenState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -45,7 +45,7 @@ class _PatientSearchScreenState extends State { child: Column( children: [ BottomSheetTitle( - title: TranslationBase.of(context).searchPatient), + title: TranslationBase.of(context)!.searchPatient), FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -63,7 +63,7 @@ class _PatientSearchScreenState extends State { margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: AppTextFieldCustom( - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context)! .patpatientIDMobilenationalientID, isTextFieldHasSuffix: false, maxLines: 1, @@ -85,7 +85,7 @@ class _PatientSearchScreenState extends State { .text.isEmpty && lastNameFileInfoController .text.isEmpty)) - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), ), @@ -122,7 +122,7 @@ class _PatientSearchScreenState extends State { child: Center( child: AppButton( fontWeight: FontWeight.w700, - title: TranslationBase.of(context).search, + title: TranslationBase.of(context)!.search, onPressed: () { onSubmitSearch(); }, @@ -148,7 +148,7 @@ class _PatientSearchScreenState extends State { }); PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( - doctorID: authenticationViewModel.doctorProfile.doctorID); + doctorID: authenticationViewModel.doctorProfile!.doctorID); if (showOther) { patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart index a1ee2cab..f7698df7 100644 --- a/lib/screens/patients/patient_search/time_bar.dart +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -8,13 +8,13 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class TimeBar extends StatefulWidget { - final PatientSearchViewModel model; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; - final bool isSearchWithKeyInfo; + final PatientSearchViewModel? model; + final PatientType? selectedPatientType; + final PatientSearchRequestModel? patientSearchRequestModel; + final bool? isSearchWithKeyInfo; const TimeBar( - {Key key, + {Key? key, this.model, this.selectedPatientType, this.patientSearchRequestModel, @@ -28,14 +28,14 @@ class _TimeBarState extends State { @override Widget build(BuildContext context) { List _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, + TranslationBase.of(context)!.today, + TranslationBase.of(context)!.tomorrow, + TranslationBase.of(context)!.nextWeek, ]; int _activeLocation = 0; return Container( height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, + width: SizeConfig.screenWidth! * 0.94, decoration: BoxDecoration( color: Color(0Xffffffff), borderRadius: BorderRadius.circular(12.5), @@ -54,7 +54,7 @@ class _TimeBarState extends State { child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, + width: SizeConfig.screenWidth! * 0.2334, decoration: BoxDecoration( borderRadius: BorderRadius.only( bottomRight: Radius.circular(12.5), @@ -82,11 +82,11 @@ class _TimeBarState extends State { _activeLocation = _locations.indexOf(item); }); GifLoaderDialogUtils.showMyDialog(context); - await widget.model.getPatientBasedOnDate( + await widget.model!.getPatientBasedOnDate( item: item, selectedPatientType: widget.selectedPatientType, patientSearchRequestModel: - widget.patientSearchRequestModel, + widget.patientSearchRequestModel!, isSearchWithKeyInfo: widget.isSearchWithKeyInfo); GifLoaderDialogUtils.hideDialog(context); }), @@ -99,7 +99,7 @@ class _TimeBarState extends State { color: Colors.white), alignment: Alignment.center, height: 1, - width: SizeConfig.screenWidth * 0.23, + width: SizeConfig.screenWidth! * 0.23, ) : Container() ]); diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 6890d74f..1735296d 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -31,10 +31,10 @@ class _UcafDetailScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; final screenSize = MediaQuery.of(context).size; @@ -49,7 +49,7 @@ class _UcafDetailScreenState extends State { isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).ucaf, + appBarTitle: TranslationBase.of(context)!.ucaf, body: Column( children: [ Expanded( @@ -65,13 +65,13 @@ class _UcafDetailScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).patient}", + "${TranslationBase.of(context)!.patient}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, ), AppText( - "${TranslationBase.of(context).ucaf}", + "${TranslationBase.of(context)!.ucaf}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, @@ -114,7 +114,7 @@ class _UcafDetailScreenState extends State { Expanded( child: Container( child: AppButton( - title: TranslationBase.of(context).cancel, + title: TranslationBase.of(context)!.cancel, hasBorder: true, vPadding: 8, hPadding: 8, @@ -137,7 +137,7 @@ class _UcafDetailScreenState extends State { Expanded( child: Container( child: AppButton( - title: TranslationBase.of(context).save, + title: TranslationBase.of(context)!.save, hasBorder: true, vPadding: 8, hPadding: 8, @@ -146,10 +146,10 @@ class _UcafDetailScreenState extends State { fontColor: Colors.white, fontSize: 2.0, onPressed: () async { - await model.postUCAF(patient); + await model.postUCAF(patient!); if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) + TranslationBase.of(context)! .postUcafSuccessMsg); Navigator.of(context).popUntil((route) { return route.settings.name == @@ -171,11 +171,11 @@ class _UcafDetailScreenState extends State { } Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, - Size screenSize, PatiantInformtion patient) { + Size screenSize, PatiantInformtion? patient) { List __treatmentSteps = [ - TranslationBase.of(context).diagnosis.toUpperCase(), - TranslationBase.of(context).medications.toUpperCase(), - TranslationBase.of(context).procedures.toUpperCase(), + TranslationBase.of(context)!.diagnosis!.toUpperCase(), + TranslationBase.of(context)!.medications!.toUpperCase(), + TranslationBase.of(context)!.procedures!.toUpperCase(), ]; return Container( height: screenSize.height * 0.070, @@ -249,10 +249,10 @@ class _UcafDetailScreenState extends State { return [ ...List.generate( model.prescriptionList != null - ? model.prescriptionList.entityList.length + ? model.prescriptionList!.entityList!.length : 0, (index) => MedicationWidget( - model, model.prescriptionList.entityList[index])).toList() + model, model.prescriptionList!.entityList![index])).toList() ]; break; case 2: @@ -286,10 +286,10 @@ class DiagnosisWidget extends StatelessWidget { @override Widget build(BuildContext context) { - MasterKeyModel diagnosisType = model.findMasterDataById( + MasterKeyModel? diagnosisType = model.findMasterDataById( masterKeys: MasterKeysService.DiagnosisType, id: diagnosis.diagnosisTypeID); - MasterKeyModel diagnosisCondition = model.findMasterDataById( + MasterKeyModel? diagnosisCondition = model.findMasterDataById( masterKeys: MasterKeysService.DiagnosisCondition, id: diagnosis.conditionID); @@ -299,7 +299,7 @@ class DiagnosisWidget extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).diagnoseType}: ", + "${TranslationBase.of(context)!.diagnoseType}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -334,7 +334,7 @@ class DiagnosisWidget extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).condition}: ", + "${TranslationBase.of(context)!.condition}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -351,7 +351,7 @@ class DiagnosisWidget extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).icd}: ", + "${TranslationBase.of(context)!.icd}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -394,7 +394,7 @@ class MedicationWidget extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).id}: ", + "${TranslationBase.of(context)!.id}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -407,7 +407,7 @@ class MedicationWidget extends StatelessWidget { width: 16, ), AppText( - "${TranslationBase.of(context).price}: ", + "${TranslationBase.of(context)!.price}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -420,7 +420,7 @@ class MedicationWidget extends StatelessWidget { width: 16, ), AppText( - "${TranslationBase.of(context).quantity}: ", + "${TranslationBase.of(context)!.quantity}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -437,7 +437,7 @@ class MedicationWidget extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).durDays}: ", + "${TranslationBase.of(context)!.durDays}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -507,7 +507,7 @@ class ProceduresWidget extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).codeNo}: ", + "${TranslationBase.of(context)!.codeNo}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -521,7 +521,7 @@ class ProceduresWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - "${TranslationBase.of(context).quantity}: ", + "${TranslationBase.of(context)!.quantity}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -555,21 +555,21 @@ class ProceduresWidget extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).covered}: ", + "${TranslationBase.of(context)!.covered}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: procedure.isCovered ? Colors.green : Colors.red, + color: procedure.isCovered! ? Colors.green : Colors.red, fontSize: SizeConfig.textMultiplier * 2.0, ), SizedBox( width: 16, ), AppText( - "${TranslationBase.of(context).approvalRequired}: ", + "${TranslationBase.of(context)!.approvalRequired}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -586,7 +586,7 @@ class ProceduresWidget extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).uncoveredByDoctor}: ", + "${TranslationBase.of(context)!.uncoveredByDoctor}: ", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 5e1b6155..3e461ea9 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -53,21 +53,21 @@ class _UCAFInputScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getUCAFData(patient), + onModelReady: (model) => model.getUCAFData(patient!), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).ucaf, + appBarTitle: TranslationBase.of(context)!.ucaf, body: model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 @@ -85,13 +85,13 @@ class _UCAFInputScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).patient}", + "${TranslationBase.of(context)!.patient}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, ), AppText( - "${TranslationBase.of(context).ucaf}", + "${TranslationBase.of(context)!.ucaf}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, @@ -199,7 +199,7 @@ class _UCAFInputScreenState extends State { child: Row( children: [ AppText( - "${TranslationBase.of(context).temperature}", + "${TranslationBase.of(context)!.temperature}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, @@ -232,7 +232,7 @@ class _UCAFInputScreenState extends State { Row( children: [ AppText( - "${TranslationBase.of(context).pulseBeats}:", + "${TranslationBase.of(context)!.pulseBeats}:", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, @@ -256,7 +256,7 @@ class _UCAFInputScreenState extends State { height: 16, ), AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .chiefComplaintsAndSymptoms, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.2, @@ -279,7 +279,7 @@ class _UCAFInputScreenState extends State { ), AppTextFieldCustom( hintText: - TranslationBase.of(context).instruction, + TranslationBase.of(context)!.instruction, dropDownText: Helpers.parseHtmlString(model .patientChiefComplaintList[0] .chiefComplaint), @@ -403,7 +403,7 @@ class _UCAFInputScreenState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: AppButton( - title: TranslationBase.of(context).next, + title: TranslationBase.of(context)!.next, color: HexColor("#D02127"), onPressed: () { Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, @@ -429,8 +429,8 @@ class _UCAFInputScreenState extends State { padding: const EdgeInsets.all(8.0), child: AppText( model.patientVitalSignsHistory.length > 0 - ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context).chiefComplaintEmptyMsg, + ? TranslationBase.of(context)!.vitalSignEmptyMsg + : TranslationBase.of(context)!.chiefComplaintEmptyMsg, fontWeight: FontWeight.normal, color: HexColor("#B8382B"), fontSize: SizeConfig.textMultiplier * 2.5, diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index da0381ed..5c287b66 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -13,15 +13,15 @@ import 'package:flutter/material.dart'; */ class PageStepperWidget extends StatelessWidget { - final int stepsCount; - final int currentStepIndex; - final Size screenSize; + final int? stepsCount; + final int? currentStepIndex; + final Size? screenSize; PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize}); @override Widget build(BuildContext context) { - double dividerWidth = (screenSize.width / stepsCount) - (10 * stepsCount); + double dividerWidth = (screenSize!.width / stepsCount!) - (10 * stepsCount!); return Container( margin: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0), @@ -30,12 +30,12 @@ class PageStepperWidget extends StatelessWidget { children: [ Row( children: [ - for (int i = 1; i <= stepsCount; i++) + for (int i = 1; i <= stepsCount!; i++) if (i == currentStepIndex) - StepWidget(i, true, i == stepsCount, i < currentStepIndex, + StepWidget(i, true, i == stepsCount, i < currentStepIndex!, dividerWidth) else - StepWidget(i, false, i == stepsCount, i < currentStepIndex, + StepWidget(i, false, i == stepsCount, i < currentStepIndex!, dividerWidth) ], ) @@ -106,7 +106,7 @@ class StepWidget extends StatelessWidget { height: 8, ), AppText( - "${TranslationBase.of(context).step} $index", + "${TranslationBase.of(context)!.step} $index", fontWeight: FontWeight.bold, color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black, fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index bbc968b0..00a08245 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -25,14 +25,14 @@ class AdmissionRequestDetailScreen extends StatefulWidget { class _AdmissionRequestDetailScreenState extends State { - DateTime selectedDate; + DateTime? selectedDate; dynamic _selectedSpeciality; dynamic _selectedDoctor; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context); @@ -40,7 +40,7 @@ class _AdmissionRequestDetailScreenState onModelReady: (model) => model.getSpecialityList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).admissionRequest, + appBarTitle: TranslationBase.of(context)!.admissionRequest, body: model.doctorsList != null ? Column( children: [ @@ -60,7 +60,7 @@ class _AdmissionRequestDetailScreenState height: 16, ), AppText( - TranslationBase.of(context).patientDetails, + TranslationBase.of(context)!.patientDetails, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, ), @@ -94,7 +94,7 @@ class _AdmissionRequestDetailScreenState child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).date, + TranslationBase.of(context)!.date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -111,7 +111,7 @@ class _AdmissionRequestDetailScreenState height: 20, ), AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .specialityAndDoctorDetail, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, @@ -132,7 +132,7 @@ class _AdmissionRequestDetailScreenState : 'nameEn', attributeValueId: 'id', okText: - TranslationBase.of(context) + TranslationBase.of(context)! .ok, okFunction: (selectedValue) { setState(() { @@ -151,7 +151,7 @@ class _AdmissionRequestDetailScreenState child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) + TranslationBase.of(context)! .speciality, _selectedSpeciality != null ? projectViewModel.isArabic @@ -172,7 +172,7 @@ class _AdmissionRequestDetailScreenState height: screenSize.height * 0.070, child: InkWell( onTap: model.doctorsList != null && - model.doctorsList.length > 0 + model.doctorsList!.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( @@ -181,10 +181,10 @@ class _AdmissionRequestDetailScreenState attributeValueId: 'DoctorID', usingSearch: true, hintSearchText: - TranslationBase.of(context) + TranslationBase.of(context)! .doctorSearch, okText: - TranslationBase.of(context) + TranslationBase.of(context)! .ok, okFunction: (selectedValue) { setState(() { @@ -205,7 +205,7 @@ class _AdmissionRequestDetailScreenState child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) + TranslationBase.of(context)! .doctor, _selectedDoctor != null ? _selectedDoctor[ @@ -229,7 +229,7 @@ class _AdmissionRequestDetailScreenState child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) + TranslationBase.of(context)! .referringDate, null, true, @@ -254,7 +254,7 @@ class _AdmissionRequestDetailScreenState child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) + TranslationBase.of(context)! .referringDoctor, null, true, @@ -273,7 +273,7 @@ class _AdmissionRequestDetailScreenState Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: AppButton( - title: TranslationBase.of(context).next, + title: TranslationBase.of(context)!.next, color: HexColor("#B8382B"), onPressed: () { Navigator.of(context).pushNamed( @@ -291,9 +291,9 @@ class _AdmissionRequestDetailScreenState _selectDate(BuildContext context, AdmissionRequestViewModel model) async { selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, - initialDate: selectedDate, + initialDate: selectedDate!, firstDate: DateTime.now().add(Duration(hours: 2)), lastDate: DateTime(2040), initialEntryMode: DatePickerEntryMode.calendar, diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index d23397da..ef9637bd 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -38,22 +38,22 @@ class _AdmissionRequestThirdScreenState dynamic _selectedDoctor; dynamic _selectedDietType; - bool _isSickLeaveRequired = false; - bool _patientPregnant = false; + bool? _isSickLeaveRequired = false; + bool? _patientPregnant = false; - String clinicError; - String doctorError; - String sickLeaveCommentError; - String dietTypeError; - String medicalHistoryError; - String surgicalHistoryError; + String? clinicError; + String? doctorError; + String? sickLeaveCommentError; + String? dietTypeError; + String? medicalHistoryError; + String? surgicalHistoryError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context); @@ -63,7 +63,7 @@ class _AdmissionRequestThirdScreenState isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBarTitle: TranslationBase.of(context)!.admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -85,13 +85,13 @@ class _AdmissionRequestThirdScreenState crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).admission}", + "${TranslationBase.of(context)!.admission}", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), AppText( - TranslationBase.of(context).request, + TranslationBase.of(context)!.request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), @@ -106,7 +106,7 @@ class _AdmissionRequestThirdScreenState crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .specialityAndDoctorDetail, color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, @@ -117,7 +117,7 @@ class _AdmissionRequestThirdScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).clinic, + hintText: TranslationBase.of(context)!.clinic, isTextFieldHasSuffix: true, validationError: clinicError, dropDownText: _selectedClinic != null @@ -167,7 +167,7 @@ class _AdmissionRequestThirdScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).doctor, + hintText: TranslationBase.of(context)!.doctor, isTextFieldHasSuffix: true, dropDownText: _selectedDoctor != null ? _selectedDoctor['DoctorName'] @@ -176,7 +176,7 @@ class _AdmissionRequestThirdScreenState validationError: doctorError, onClick: _selectedClinic != null ? model.doctorsList != null && - model.doctorsList.length > 0 + model.doctorsList!.length > 0 ? () { openListDialogField('DoctorName', 'DoctorID', model.doctorsList, @@ -195,7 +195,7 @@ class _AdmissionRequestThirdScreenState .then((_) => GifLoaderDialogUtils .hideDialog(context)); if (model.state == ViewState.Idle && - model.doctorsList.length > 0) { + model.doctorsList!.length > 0) { openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) { @@ -218,7 +218,7 @@ class _AdmissionRequestThirdScreenState height: 16, ), AppText( - TranslationBase.of(context).patientDetails, + TranslationBase.of(context)!.patientDetails, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, @@ -226,10 +226,10 @@ class _AdmissionRequestThirdScreenState SizedBox( height: 10, ), - if(patient.gender != 1) + if(patient!.gender != 1) CheckboxListTile( title: AppText( - TranslationBase.of(context).patientPregnant, + TranslationBase.of(context)!.patientPregnant, fontWeight: FontWeight.normal, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.0, @@ -246,7 +246,7 @@ class _AdmissionRequestThirdScreenState ), CheckboxListTile( title: AppText( - TranslationBase.of(context).isSickLeaveRequired, + TranslationBase.of(context)!.isSickLeaveRequired, fontWeight: FontWeight.normal, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.0, @@ -263,7 +263,7 @@ class _AdmissionRequestThirdScreenState ), AppTextFieldCustom( hintText: - TranslationBase.of(context).sickLeaveComments, + TranslationBase.of(context)!.sickLeaveComments, controller: _sickLeaveCommentsController, minLines: 2, maxLines: 4, @@ -275,7 +275,7 @@ class _AdmissionRequestThirdScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).dietType, + hintText: TranslationBase.of(context)!.dietType, isTextFieldHasSuffix: true, validationError: dietTypeError, dropDownText: _selectedDietType != null @@ -323,7 +323,7 @@ class _AdmissionRequestThirdScreenState ), AppTextFieldCustom( hintText: - TranslationBase.of(context).dietTypeRemarks, + TranslationBase.of(context)!.dietTypeRemarks, controller: _dietTypeRemarksController, minLines: 4, maxLines: 6, @@ -333,7 +333,7 @@ class _AdmissionRequestThirdScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).pastMedicalHistory, + hintText: TranslationBase.of(context)!.pastMedicalHistory, controller: _postMedicalHistoryController, minLines: 4, maxLines: 6, @@ -344,7 +344,7 @@ class _AdmissionRequestThirdScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).pastSurgicalHistory, + hintText: TranslationBase.of(context)!.pastSurgicalHistory, controller: _postSurgicalHistoryController, minLines: 2, maxLines: 4, @@ -361,7 +361,7 @@ class _AdmissionRequestThirdScreenState Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: AppButton( - title: TranslationBase.of(context).next, + title: TranslationBase.of(context)!.next, color: HexColor("#D02127"), onPressed: () { model.admissionRequestData = AdmissionRequest(); @@ -370,34 +370,34 @@ class _AdmissionRequestThirdScreenState _sickLeaveCommentsController.text != "" && _postMedicalHistoryController.text != "" && _postSurgicalHistoryController.text != "") { - model.admissionRequestData.patientMRN = + model.admissionRequestData!.patientMRN = patient.patientMRN; - model.admissionRequestData.appointmentNo = + model.admissionRequestData!.appointmentNo = patient.appointmentNo; - model.admissionRequestData.episodeID = patient.episodeNo; - model.admissionRequestData.admissionRequestNo = 0; + model.admissionRequestData!.episodeID = patient.episodeNo; + model.admissionRequestData!.admissionRequestNo = 0; - model.admissionRequestData.admitToClinic = + model.admissionRequestData!.admitToClinic = _selectedClinic['clinicID']; - model.admissionRequestData.mrpDoctorID = + model.admissionRequestData!.mrpDoctorID = _selectedDoctor['DoctorID']; - model.admissionRequestData.isPregnant = _patientPregnant; - model.admissionRequestData.isSickLeaveRequired = + model.admissionRequestData!.isPregnant = _patientPregnant; + model.admissionRequestData!.isSickLeaveRequired = _isSickLeaveRequired; - model.admissionRequestData.sickLeaveComments = + model.admissionRequestData!.sickLeaveComments = _sickLeaveCommentsController.text; - model.admissionRequestData.isDietType = + model.admissionRequestData!.isDietType = _selectedDietType != null ? true : false; - model.admissionRequestData.dietType = + model.admissionRequestData!.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; - model.admissionRequestData.dietRemarks = + model.admissionRequestData!.dietRemarks = _dietTypeRemarksController.text; - model.admissionRequestData.pastMedicalHistory = + model.admissionRequestData!.pastMedicalHistory = _postMedicalHistoryController.text; - model.admissionRequestData.pastSurgicalHistory = + model.admissionRequestData!.pastSurgicalHistory = _postSurgicalHistoryController.text; Navigator.of(context) .pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: { @@ -408,36 +408,36 @@ class _AdmissionRequestThirdScreenState }); } else { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + TranslationBase.of(context)!.pleaseFill); setState(() { if(_selectedClinic == null){ - clinicError = TranslationBase.of(context).fieldRequired; + clinicError = TranslationBase.of(context)!.fieldRequired; }else { clinicError = null; } if(_selectedDoctor == null){ - doctorError = TranslationBase.of(context).fieldRequired; + doctorError = TranslationBase.of(context)!.fieldRequired; }else { doctorError = null; } if(_sickLeaveCommentsController.text == ""){ - sickLeaveCommentError = TranslationBase.of(context).fieldRequired; + sickLeaveCommentError = TranslationBase.of(context)!.fieldRequired; }else { sickLeaveCommentError = null; } if(_selectedDietType == null){ - dietTypeError = TranslationBase.of(context).fieldRequired; + dietTypeError = TranslationBase.of(context)!.fieldRequired; }else { dietTypeError = null; } if(_postMedicalHistoryController.text == ""){ - medicalHistoryError = TranslationBase.of(context).fieldRequired; + medicalHistoryError = TranslationBase.of(context)!.fieldRequired; }else { medicalHistoryError = null; } if(_postSurgicalHistoryController.text == ""){ - surgicalHistoryError = TranslationBase.of(context).fieldRequired; + surgicalHistoryError = TranslationBase.of(context)!.fieldRequired; }else { surgicalHistoryError = null; } @@ -455,7 +455,7 @@ class _AdmissionRequestThirdScreenState Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async { - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: dateTime, firstDate: DateTime.now(), @@ -468,13 +468,13 @@ class _AdmissionRequestThirdScreenState } void openListDialogField(String attributeName, String attributeValueId, - List list, Function(dynamic selectedValue) okFunction) { + List? list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, attributeValueId: attributeValueId, usingSearch: true, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { okFunction(selectedValue); }, diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index 120b6adf..9003da79 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -33,17 +33,17 @@ class _AdmissionRequestThirdScreenState dynamic _selectedIcd; dynamic _selectedDiagnosisType; - String diagnosisError; - String icdError; - String diagnosisTypeError; + String? diagnosisError; + String? icdError; + String? diagnosisTypeError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - AdmissionRequest admissionRequest = routeArgs['admission-data']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; + AdmissionRequest? admissionRequest = routeArgs['admission-data']; final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context); @@ -54,7 +54,7 @@ class _AdmissionRequestThirdScreenState isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBarTitle: TranslationBase.of(context)!.admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -75,13 +75,13 @@ class _AdmissionRequestThirdScreenState crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).admission}", + "${TranslationBase.of(context)!.admission}", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), AppText( - TranslationBase.of(context).request, + TranslationBase.of(context)!.request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), @@ -95,7 +95,7 @@ class _AdmissionRequestThirdScreenState crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).diagnosisDetail, + TranslationBase.of(context)!.diagnosisDetail, color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, @@ -105,7 +105,7 @@ class _AdmissionRequestThirdScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).diagnosis, + hintText: TranslationBase.of(context)!.diagnosis, dropDownText: _selectedDiagnosis != null ? _selectedDiagnosis['nameEn'] : null, @@ -151,7 +151,7 @@ class _AdmissionRequestThirdScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).icd, + hintText: TranslationBase.of(context)!.icd, dropDownText: _selectedIcd != null ? _selectedIcd['description'] : null, @@ -172,7 +172,7 @@ class _AdmissionRequestThirdScreenState : () async { GifLoaderDialogUtils.showMyDialog(context); await model - .getICDCodes(patient.patientMRN) + .getICDCodes(patient!.patientMRN) .then((_) => GifLoaderDialogUtils.hideDialog( context)); @@ -199,7 +199,7 @@ class _AdmissionRequestThirdScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).diagnoseType, + hintText: TranslationBase.of(context)!.diagnoseType, dropDownText: _selectedDiagnosisType != null ? _selectedDiagnosisType['description'] : null, @@ -263,7 +263,7 @@ class _AdmissionRequestThirdScreenState children: [ Expanded( child: AppButton( - title: TranslationBase.of(context).previous, + title: TranslationBase.of(context)!.previous, color: HexColor("#EAEAEA"), fontColor: Colors.black, onPressed: () { @@ -276,7 +276,7 @@ class _AdmissionRequestThirdScreenState ), Expanded( child: AppButton( - title: TranslationBase.of(context).submit, + title: TranslationBase.of(context)!.submit, color: HexColor("#359846"), onPressed: () async { if (_selectedDiagnosis != null && @@ -297,7 +297,7 @@ class _AdmissionRequestThirdScreenState 'isActive': true, } ]; - model.admissionRequestData + model.admissionRequestData! .admissionRequestDiagnoses = admissionRequestDiagnoses; @@ -306,30 +306,30 @@ class _AdmissionRequestThirdScreenState DrAppToastMsg.showErrorToast(model.error); } else { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) + TranslationBase.of(context)! .admissionRequestSuccessMsg); Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE)); } } else { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + TranslationBase.of(context)!.pleaseFill); setState(() { if(_selectedDiagnosis == null){ - diagnosisError = TranslationBase.of(context).fieldRequired; + diagnosisError = TranslationBase.of(context)!.fieldRequired; }else { diagnosisError = null; } if(_selectedIcd == null){ - icdError = TranslationBase.of(context).fieldRequired; + icdError = TranslationBase.of(context)!.fieldRequired; }else { icdError = null; } if(_selectedDiagnosisType == null){ - diagnosisTypeError = TranslationBase.of(context).fieldRequired; + diagnosisTypeError = TranslationBase.of(context)!.fieldRequired; }else { diagnosisTypeError = null; } @@ -355,7 +355,7 @@ class _AdmissionRequestThirdScreenState attributeName: attributeName, attributeValueId: attributeValueId, usingSearch: true, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { okFunction(selectedValue); }, diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 8627d224..50387aa0 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -40,32 +40,32 @@ class _AdmissionRequestSecondScreenState final _complicationsController = TextEditingController(); final _otherProceduresController = TextEditingController(); - DateTime _expectedAdmissionDate; + DateTime? _expectedAdmissionDate; dynamic _selectedFloor; dynamic _selectedWard; dynamic _selectedRoomCategory; dynamic _selectedAdmissionType; - String costError; - String plansError; - String otherInterventionsError; - String expectedDaysError; - String expectedDatesError; - String floorError; - String roomError; - String treatmentsError; - String complicationsError; - String proceduresError; - String admissionTypeError; + String? costError; + String? plansError; + String? otherInterventionsError; + String? expectedDaysError; + String? expectedDatesError; + String? floorError; + String? roomError; + String? treatmentsError; + String? complicationsError; + String? proceduresError; + String? admissionTypeError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - AdmissionRequest admissionRequest = routeArgs['admission-data']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; + AdmissionRequest? admissionRequest = routeArgs['admission-data']; final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context); @@ -76,7 +76,7 @@ class _AdmissionRequestSecondScreenState isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBarTitle: TranslationBase.of(context)!.admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -97,13 +97,13 @@ class _AdmissionRequestSecondScreenState crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).admission}", + "${TranslationBase.of(context)!.admission}", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), AppText( - TranslationBase.of(context).request, + TranslationBase.of(context)!.request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), @@ -118,7 +118,7 @@ class _AdmissionRequestSecondScreenState crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .postPlansEstimatedCost, color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, @@ -130,7 +130,7 @@ class _AdmissionRequestSecondScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: - TranslationBase.of(context).estimatedCost, + TranslationBase.of(context)!.estimatedCost, controller: _estimatedCostController, validationError: costError, inputType: TextInputType.number, @@ -143,7 +143,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).postPlans, + hintText: TranslationBase.of(context)!.postPlans, controller: _postPlansEstimatedCostController, inputType: TextInputType.multiline, validationError: plansError, @@ -154,7 +154,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context)! .otherDepartmentsInterventions, controller: _otherDepartmentsInterventionsController, @@ -167,7 +167,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppText( - TranslationBase.of(context).otherInformation, + TranslationBase.of(context)!.otherInformation, color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, @@ -178,7 +178,7 @@ class _AdmissionRequestSecondScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: - TranslationBase.of(context).expectedDays, + TranslationBase.of(context)!.expectedDays, controller: _expectedDaysController, validationError: expectedDaysError, inputType: TextInputType.number, @@ -192,7 +192,7 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context)! .expectedAdmissionDate, dropDownText: _expectedAdmissionDate != null ? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" @@ -201,6 +201,7 @@ class _AdmissionRequestSecondScreenState isTextFieldHasSuffix: true, validationError: expectedDatesError, suffixIcon: IconButton( + onPressed: null, icon: Icon( Icons.calendar_today, color: Colors.black, @@ -209,7 +210,7 @@ class _AdmissionRequestSecondScreenState if (_expectedAdmissionDate == null) { _expectedAdmissionDate = DateTime.now(); } - _selectDate(context, _expectedAdmissionDate, + _selectDate(context, _expectedAdmissionDate!, (picked) { setState(() { _expectedAdmissionDate = picked; @@ -222,7 +223,7 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).floor, + hintText: TranslationBase.of(context)!.floor, dropDownText: _selectedFloor != null ? _selectedFloor['description'] : null, @@ -272,7 +273,7 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).ward, + hintText: TranslationBase.of(context)!.ward, dropDownText: _selectedWard != null ? _selectedWard['description'] : null, @@ -322,7 +323,7 @@ class _AdmissionRequestSecondScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: - TranslationBase.of(context).roomCategory, + TranslationBase.of(context)!.roomCategory, dropDownText: _selectedRoomCategory != null ? _selectedRoomCategory['description'] : null, @@ -377,7 +378,7 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( hintText: - TranslationBase.of(context).treatmentLine, + TranslationBase.of(context)!.treatmentLine, controller: _treatmentLineController, inputType: TextInputType.multiline, validationError: treatmentsError, @@ -389,7 +390,7 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( hintText: - TranslationBase.of(context).complications, + TranslationBase.of(context)!.complications, controller: _complicationsController, inputType: TextInputType.multiline, validationError: complicationsError, @@ -401,7 +402,7 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( hintText: - TranslationBase.of(context).otherProcedure, + TranslationBase.of(context)!.otherProcedure, controller: _otherProceduresController, inputType: TextInputType.multiline, validationError: proceduresError, @@ -414,7 +415,7 @@ class _AdmissionRequestSecondScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: - TranslationBase.of(context).admissionType, + TranslationBase.of(context)!.admissionType, dropDownText: _selectedAdmissionType != null ? _selectedAdmissionType['nameEn'] : null, @@ -476,7 +477,7 @@ class _AdmissionRequestSecondScreenState children: [ Expanded( child: AppButton( - title: TranslationBase.of(context).previous, + title: TranslationBase.of(context)!.previous, color: HexColor("#EAEAEA"), fontColor: Colors.black, onPressed: () { @@ -489,7 +490,7 @@ class _AdmissionRequestSecondScreenState ), Expanded( child: AppButton( - title: TranslationBase.of(context).next, + title: TranslationBase.of(context)!.next, color: HexColor("#D02127"), onPressed: () async { if (_estimatedCostController.text != "" && @@ -507,38 +508,38 @@ class _AdmissionRequestSecondScreenState _selectedAdmissionType != null) { model.admissionRequestData = admissionRequest; - model.admissionRequestData.estimatedCost = + model.admissionRequestData!.estimatedCost = int.parse(_estimatedCostController.text); - model.admissionRequestData + model.admissionRequestData! .elementsForImprovement = _postPlansEstimatedCostController.text; - model.admissionRequestData.expectedDays = + model.admissionRequestData!.expectedDays = int.parse(_expectedDaysController.text); - model.admissionRequestData.admissionDate = - _expectedAdmissionDate.toIso8601String(); - model.admissionRequestData + model.admissionRequestData!.admissionDate = + _expectedAdmissionDate!.toIso8601String(); + model.admissionRequestData! .otherDepartmentInterventions = _otherDepartmentsInterventionsController.text; - model.admissionRequestData.admissionLocationID = + model.admissionRequestData!.admissionLocationID = _selectedFloor['floorID']; - model.admissionRequestData.wardID = + model.admissionRequestData!.wardID = _selectedWard != null ? _selectedWard['nursingStationID'] : 0; - model.admissionRequestData.roomCategoryID = + model.admissionRequestData!.roomCategoryID = _selectedRoomCategory['categoryID']; - model.admissionRequestData + model.admissionRequestData! .admissionRequestProcedures = []; - model.admissionRequestData.mainLineOfTreatment = + model.admissionRequestData!.mainLineOfTreatment = _treatmentLineController.text; - model.admissionRequestData.complications = + model.admissionRequestData!.complications = _complicationsController.text; - model.admissionRequestData.otherProcedures = + model.admissionRequestData!.otherProcedures = _otherProceduresController.text; - model.admissionRequestData.admissionType = + model.admissionRequestData!.admissionType = _selectedAdmissionType['id']; Navigator.of(context).pushNamed( @@ -551,12 +552,12 @@ class _AdmissionRequestSecondScreenState }); } else { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + TranslationBase.of(context)!.pleaseFill); setState(() { if (_estimatedCostController.text == "") { costError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { costError = null; } @@ -564,21 +565,21 @@ class _AdmissionRequestSecondScreenState if (_postPlansEstimatedCostController.text == "") { plansError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { plansError = null; } if (_expectedDaysController.text == "") { expectedDaysError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { expectedDaysError = null; } if (_expectedAdmissionDate == null) { expectedDatesError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { expectedDatesError = null; } @@ -587,49 +588,49 @@ class _AdmissionRequestSecondScreenState .text == "") { otherInterventionsError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { otherInterventionsError = null; } if (_selectedFloor == null) { floorError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { floorError = null; } if (_selectedRoomCategory == null) { roomError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { roomError = null; } if (_treatmentLineController.text == "") { treatmentsError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { treatmentsError = null; } if (_complicationsController.text == "") { complicationsError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { complicationsError = null; } if (_otherProceduresController.text == "") { proceduresError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { proceduresError = null; } if (_selectedAdmissionType == null) { admissionTypeError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { admissionTypeError = null; } @@ -649,7 +650,7 @@ class _AdmissionRequestSecondScreenState Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async { - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: dateTime, firstDate: DateTime.now(), @@ -668,7 +669,7 @@ class _AdmissionRequestSecondScreenState attributeName: attributeName, attributeValueId: attributeValueId, usingSearch: true, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { okFunction(selectedValue); }, diff --git a/lib/screens/patients/profile/in_patient_profile_screen.dart b/lib/screens/patients/profile/in_patient_profile_screen.dart index 8b1c3b7e..6c743ad0 100644 --- a/lib/screens/patients/profile/in_patient_profile_screen.dart +++ b/lib/screens/patients/profile/in_patient_profile_screen.dart @@ -17,23 +17,23 @@ class InPatientProfileScreen extends StatefulWidget { } class _InPatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { - PatiantInformtion patient; + PatiantInformtion? patient; - bool isFromSearch = false; + bool? isFromSearch = false; - bool isInpatient = false; + bool? isInpatient = false; - bool isDischargedPatient = false; - String patientType; - String arrivalType; - String from; - String to; + bool? isDischargedPatient = false; + String? patientType; + String? arrivalType; + String? from; + String? to; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -56,7 +56,7 @@ class _InPatientProfileScreenState extends Statewith Sin return BaseView( builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, - appBarTitle: TranslationBase.of(context).patientProfile, + appBarTitle: TranslationBase.of(context)!.patientProfile, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), body: SingleChildScrollView( @@ -78,8 +78,8 @@ class _InPatientProfileScreenState extends Statewith Sin arrivalType: arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + nameLine1: TranslationBase.of(context)!.vital, + nameLine2: TranslationBase.of(context)!.signs, route: VITAL_SIGN_DETAILS, isInPatient: true, icon: 'patient/vital_signs.png'), @@ -89,8 +89,8 @@ class _InPatientProfileScreenState extends Statewith Sin arrivalType: arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context)!.lab, + nameLine2: TranslationBase.of(context)!.result, icon: 'patient/lab_results.png'), PatientProfileButton( @@ -99,16 +99,16 @@ class _InPatientProfileScreenState extends Statewith Sin arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context)!.radiology, + nameLine2: TranslationBase.of(context)!.result, icon: 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context)!.patient, + nameLine2: TranslationBase.of(context)!.prescription, icon: 'patient/order_prescription.png'), PatientProfileButton( patient: patient, @@ -116,8 +116,8 @@ class _InPatientProfileScreenState extends Statewith Sin arrivalType: arrivalType, route: PROGRESS_NOTE, isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + nameLine1: TranslationBase.of(context)!.progress, + nameLine2: TranslationBase.of(context)!.note, icon: 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, @@ -134,8 +134,8 @@ class _InPatientProfileScreenState extends Statewith Sin patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context)!.orders, + nameLine2: TranslationBase.of(context)!.procedures, icon: 'patient/Order_Procedures.png'), PatientProfileButton( patient: patient, @@ -164,16 +164,16 @@ class _InPatientProfileScreenState extends Statewith Sin arrivalType: arrivalType, route: REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context)!.referral, + nameLine2: TranslationBase.of(context)!.patient, icon: 'patient/refer_patient.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, + nameLine1: TranslationBase.of(context)!.insurance, + nameLine2: TranslationBase.of(context)!.approvals, icon: 'patient/vital_signs.png'), PatientProfileButton( @@ -191,8 +191,8 @@ class _InPatientProfileScreenState extends Statewith Sin patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context)!.patientSick, + nameLine2: TranslationBase.of(context)!.leave, icon: 'patient/patient_sick_leave.png'), ], ), diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index fcc9746a..488e4832 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -13,10 +13,10 @@ import 'package:hexcolor/hexcolor.dart'; import 'lab_result_chart_and_detials.dart'; class FlowChartPage extends StatelessWidget { - final PatientLabOrders patientLabOrder; - final String filterName; - final PatiantInformtion patient; - final bool isInpatient; + final PatientLabOrders? patientLabOrder; + final String? filterName; + final PatiantInformtion? patient; + final bool? isInpatient; FlowChartPage({this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); @@ -50,7 +50,7 @@ class FlowChartPage extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - TranslationBase.of(context).noDataAvailable, + TranslationBase.of(context)!.noDataAvailable, fontWeight: FontWeight.normal, color: HexColor("#B8382B"), fontSize: SizeConfig.textMultiplier * 2.5, diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 0d059000..07d030e3 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -11,21 +11,21 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LabResultWidget extends StatelessWidget { - final String filterName; - final List patientLabResultList; - final PatientLabOrders patientLabOrder; - final PatiantInformtion patient; - final bool isInpatient; + final String? filterName; + final List? patientLabResultList; + final PatientLabOrders? patientLabOrder; + final PatiantInformtion? patient; + final bool? isInpatient; LabResultWidget( - {Key key, + {Key? key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient, this.isInpatient}) : super(key: key); - ProjectViewModel projectViewModel; + ProjectViewModel? projectViewModel; @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ class LabResultWidget extends StatelessWidget { ); }, child: AppText( - TranslationBase.of(context).showMoreBtn, + TranslationBase.of(context)!.showMoreBtn, textDecoration: TextDecoration.underline, color: Colors.blue, ), @@ -69,7 +69,7 @@ class LabResultWidget extends StatelessWidget { child: Container( child: Center( child: AppText( - TranslationBase.of(context).description, + TranslationBase.of(context)!.description, color: Colors.black, bold: true, ), @@ -80,7 +80,7 @@ class LabResultWidget extends StatelessWidget { child: Container( child: Center( child: AppText( - TranslationBase.of(context).value, + TranslationBase.of(context)!.value, color: Colors.black, bold: true, ), @@ -91,7 +91,7 @@ class LabResultWidget extends StatelessWidget { child: Container( child: Center( child: AppText( - TranslationBase.of(context).range, + TranslationBase.of(context)!.range, color: Colors.black, bold: true, ), @@ -111,7 +111,7 @@ class LabResultWidget extends StatelessWidget { height: 12, ), ...List.generate( - patientLabResultList.length, + patientLabResultList!.length, (index) => Column( children: [ Row( @@ -122,8 +122,8 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - '${patientLabResultList[index].testCode}\n' + - patientLabResultList[index].description, + '${patientLabResultList![index]!.testCode}\n' + + patientLabResultList![index]!.description!, textAlign: TextAlign.center, ), ), @@ -135,9 +135,9 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - patientLabResultList[index].resultValue ??""+ + patientLabResultList![index]!.resultValue ??""+ " " + - "${patientLabResultList[index].uOM ?? ""}", + "${patientLabResultList![index]!.uOM ?? ""}", textAlign: TextAlign.center, ), ), @@ -149,7 +149,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - patientLabResultList[index].referanceRange, + patientLabResultList![index]!.referanceRange, textAlign: TextAlign.center, ), ), @@ -179,7 +179,7 @@ class LabResultWidget extends StatelessWidget { Container( child: Center( child: AppText( - TranslationBase.of(context).description, + TranslationBase.of(context)!.description, color: Colors.black, bold: true, ), @@ -188,7 +188,7 @@ class LabResultWidget extends StatelessWidget { Container( child: Center( child: AppText( - TranslationBase.of(context).value, + TranslationBase.of(context)!.value, color: Colors.black, bold: true, ), @@ -197,7 +197,7 @@ class LabResultWidget extends StatelessWidget { Container( child: Center( child: AppText( - TranslationBase.of(context).range, + TranslationBase.of(context)!.range, color: Colors.black, bold: true, ), @@ -228,7 +228,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - lab.resultValue + " " + lab.uOM, + lab.resultValue! + " " + lab.uOM!, textAlign: TextAlign.center, ), ), diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 697d16d2..15108456 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -9,7 +9,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LabResultDetailsWidget extends StatefulWidget { - final List labResult; + final List? labResult; LabResultDetailsWidget({ this.labResult, @@ -43,7 +43,7 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(8), child: AppText( - TranslationBase.of(context).date, + TranslationBase.of(context)!.date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -56,7 +56,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), child: Container( child: AppText( - TranslationBase.of(context).labResult, + TranslationBase.of(context)!.labResult, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -74,7 +74,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -86,7 +86,7 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; - widget.labResult.forEach((vital) { + widget.labResult!.forEach((vital) { var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index 89860f44..f289aed0 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -7,8 +7,8 @@ import 'package:flutter/material.dart'; import '../../../../core/model/labs/LabOrderResult.dart'; class LineChartCurved extends StatefulWidget { - final String title; - final List labResult; + final String? title; + final List? labResult; LineChartCurved({this.title, this.labResult}); @@ -17,8 +17,8 @@ class LineChartCurved extends StatefulWidget { } class LineChartCurvedState extends State { - bool isShowingMainData; - List xAxixs = List(); + bool? isShowingMainData; + List xAxixs = []; int indexes = 0; @override @@ -29,10 +29,10 @@ class LineChartCurvedState extends State { } getXaxix() { - indexes = widget.labResult.length ~/ 3.5; - for (int index = 0; index < widget.labResult.length; index++) { + indexes = widget.labResult!.length ~/ 3.5; + for (int index = 0; index < widget.labResult!.length; index++) { int mIndex = indexes * index; - if (mIndex < widget.labResult.length) { + if (mIndex < widget.labResult!.length) { xAxixs.add(mIndex); } } @@ -105,16 +105,16 @@ class LineChartCurvedState extends State { rotateAngle:-65, getTitles: (value) { print(value); - DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); - if (widget.labResult.length < 8) { - if (widget.labResult.length > value.toInt()) { + DateTime date = AppDateUtils.convertStringToDate(widget.labResult![value.toInt()].verifiedOnDateTime); + if (widget.labResult!.length < 8) { + if (widget.labResult!.length > value.toInt()) { return '${date.day}/ ${date.year}'; } else return ''; } else { if (value.toInt() == 0) return '${date.day}/ ${date.year}'; - if (value.toInt() == widget.labResult.length - 1) + if (value.toInt() == widget.labResult!.length - 1) return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { return '${date.day}/ ${date.year}'; @@ -159,7 +159,7 @@ class LineChartCurvedState extends State { ), ), minX: 0, - maxX: (widget.labResult.length - 1).toDouble(), + maxX: (widget.labResult!.length - 1).toDouble(), maxY: getMaxY()+2, minY: getMinY(), lineBarsData: getData(), @@ -168,9 +168,9 @@ class LineChartCurvedState extends State { double getMaxY() { double max = 0; - widget.labResult.forEach((element) { + widget.labResult!.forEach((element) { try{ - double resultValueDouble = double.parse(element.resultValue); + double resultValueDouble = double.parse(element.resultValue!); if (resultValueDouble > max) max = resultValueDouble;} catch(e){ print(e); @@ -183,10 +183,10 @@ class LineChartCurvedState extends State { double getMinY() { double min = 0; try{ - min = double.parse(widget.labResult[0].resultValue); + min = double.parse(widget.labResult![0].resultValue!); - widget.labResult.forEach((element) { - double resultValueDouble = double.parse(element.resultValue); + widget.labResult!.forEach((element) { + double resultValueDouble = double.parse(element.resultValue!); if (resultValueDouble < min) min = resultValueDouble; });}catch(e){ print(e); @@ -197,10 +197,10 @@ class LineChartCurvedState extends State { } List getData() { - List spots = List(); - for (int index = 0; index < widget.labResult.length; index++) { + List spots = []; + for (int index = 0; index < widget.labResult!.length; index++) { try{ - var resultValueDouble = double.parse(widget.labResult[index].resultValue); + var resultValueDouble = double.parse(widget.labResult![index].resultValue!); spots.add(FlSpot(index.toDouble(), resultValueDouble)); }catch(e){ print(e); diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index 6026c9e9..aa03855f 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -11,13 +11,13 @@ import 'LineChartCurved.dart'; class LabResultChartAndDetails extends StatelessWidget { LabResultChartAndDetails({ - Key key, - @required this.labResult, - @required this.name, + Key? key, + required this.labResult, + required this.name, }) : super(key: key); final List labResult; - final String name; + final String? name; @override @@ -46,7 +46,7 @@ class LabResultChartAndDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).graphDetails, + TranslationBase.of(context)!.graphDetails, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index dd8ace01..1cd6ceae 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -12,9 +12,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class LabResult extends StatefulWidget { - final LabOrdersResModel labOrders; + final LabOrdersResModel? labOrders; - LabResult({Key key, this.labOrders}); + LabResult({Key? key, this.labOrders}); @override _LabResultState createState() => _LabResultState(); @@ -24,16 +24,16 @@ class _LabResultState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getLabResult(widget.labOrders), + onModelReady: (model) => model.getLabResult(widget.labOrders!), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).labOrders, + appBarTitle: TranslationBase.of(context)!.labOrders, body: model.labResultList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoLabOrders) + error: TranslationBase.of(context)!.errorNoLabOrders) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, - 0, SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth! * 0.05, + 0, SizeConfig.realScreenWidth! * 0.05, 0), child: ListView( children: [ CardWithBgWidgetNew( @@ -43,12 +43,12 @@ class _LabResultState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).orderNo, + TranslationBase.of(context)!.orderNo, fontSize: 2 * SizeConfig.textMultiplier, color: Colors.grey[800], ), AppText( - ' ${widget.labOrders.orderNo}', + ' ${widget.labOrders!.orderNo}', fontSize: 2 * SizeConfig.textMultiplier, color: Colors.grey[800], ), @@ -58,12 +58,12 @@ class _LabResultState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).invoiceNo, + TranslationBase.of(context)!.invoiceNo, fontSize: 2 * SizeConfig.textMultiplier, color: Colors.grey[800], ), AppText( - ' ${widget.labOrders.invoiceNo}', + ' ${widget.labOrders!.invoiceNo}', fontSize: 2 * SizeConfig.textMultiplier, color: Colors.grey[800], ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 1c5104f8..50eee877 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -10,13 +10,13 @@ import 'package:flutter/material.dart'; import 'laboratory_result_widget.dart'; class LaboratoryResultPage extends StatefulWidget { - final PatientLabOrders patientLabOrders; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; + final PatientLabOrders? patientLabOrders; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; LaboratoryResultPage( - {Key key, + {Key? key, this.patientLabOrders, this.patient, this.patientType, @@ -31,10 +31,10 @@ class _LaboratoryResultPageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getLaboratoryResult( - invoiceNo: widget.patientLabOrders.invoiceNo, - clinicID: widget.patientLabOrders.clinicID, - projectID: widget.patientLabOrders.projectID, - orderNo: widget.patientLabOrders.orderNo, + invoiceNo: widget.patientLabOrders!.invoiceNo, + clinicID: widget.patientLabOrders!.clinicID, + projectID: widget.patientLabOrders!.projectID, + orderNo: widget.patientLabOrders!.orderNo, patient: widget.patient, isInpatient: widget.patientType == "1"), builder: (_, model, w) => AppScaffold( @@ -43,13 +43,13 @@ class _LaboratoryResultPageState extends State { patient: widget.patient, patientType: widget.patientType ?? "0", arrivalType: widget.arrivalType ?? "0", - orderNo: widget.patientLabOrders.orderNo, - appointmentDate: widget.patientLabOrders.orderDate, - doctorName: widget.patientLabOrders.doctorName, - branch: widget.patientLabOrders.projectName, - clinic: widget.patientLabOrders.clinicDescription, - profileUrl: widget.patientLabOrders.doctorImageURL, - invoiceNO: widget.patientLabOrders.invoiceNo, + orderNo: widget.patientLabOrders!.orderNo, + appointmentDate: widget.patientLabOrders!.orderDate, + doctorName: widget.patientLabOrders!.doctorName, + branch: widget.patientLabOrders!.projectName, + clinic: widget.patientLabOrders!.clinicDescription, + profileUrl: widget.patientLabOrders!.doctorImageURL, + invoiceNO: widget.patientLabOrders!.invoiceNo, ), baseViewModel: model, body: Scaffold( @@ -60,10 +60,10 @@ class _LaboratoryResultPageState extends State { model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo, + billNo: widget.patientLabOrders!.invoiceNo, details: model .patientLabSpecialResult[index].resultDataHTML, - orderNo: widget.patientLabOrders.orderNo, + orderNo: widget.patientLabOrders!.orderNo, patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: widget.patientType == "1", diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 810f025f..63276442 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -12,16 +12,16 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LaboratoryResultWidget extends StatefulWidget { - final GestureTapCallback onTap; - final String billNo; - final String details; - final String orderNo; - final PatientLabOrders patientLabOrder; - final PatiantInformtion patient; - final bool isInpatient; + final GestureTapCallback? onTap; + final String? billNo; + final String? details; + final String? orderNo; + final PatientLabOrders? patientLabOrder; + final PatiantInformtion? patient; + final bool? isInpatient; const LaboratoryResultWidget( - {Key key, + {Key? key, this.onTap, this.billNo, this.details, @@ -37,16 +37,16 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; - ProjectViewModel projectViewModel; + ProjectViewModel? projectViewModel; @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrder, + patientLabOrder: widget.patientLabOrder!, patient: widget.patient, - isInpatient: widget.isInpatient), + isInpatient: widget.isInpatient!), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Container( @@ -87,7 +87,7 @@ class _LaboratoryResultWidgetState extends State { margin: EdgeInsets.only( left: 10, right: 10), child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .generalResult, bold: true, ))), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index f60e875a..8952f6eb 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -21,15 +21,15 @@ class LabsHomePage extends StatefulWidget { } class _LabsHomePageState extends State { - String patientType; + String? patientType; - String arrivalType; - PatiantInformtion patient; - bool isInpatient; + String? arrivalType; + PatiantInformtion? patient; + bool? isInpatient; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -48,7 +48,7 @@ class _LabsHomePageState extends State { isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, - patient.patientType.toString() ?? '0', + patient!.patientType.toString() ?? '0', patientType, isInpatient: isInpatient, ), @@ -63,49 +63,49 @@ class _LabsHomePageState extends State { height: 12, ), if (model.patientLabOrdersList.isNotEmpty && - patient.patientStatusType != 43) + patient!.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).lab, + TranslationBase.of(context)!.lab, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - TranslationBase.of(context).result, + TranslationBase.of(context)!.result, bold: true, fontSize: 22, ), ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient!.patientStatusType != null && + patient!.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).lab, + TranslationBase.of(context)!.lab, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - TranslationBase.of(context).result, + TranslationBase.of(context)!.result, bold: true, fontSize: 22, ), ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient!.patientStatusType != null && + patient!.patientStatusType == 43) AddNewOrder( onTap: () { Navigator.push( @@ -117,7 +117,7 @@ class _LabsHomePageState extends State { )), ); }, - label: TranslationBase.of(context).applyForNewLabOrder, + label: TranslationBase.of(context)!.applyForNewLabOrder, ), ...List.generate( model.patientLabOrdersList.length, @@ -139,10 +139,10 @@ class _LabsHomePageState extends State { height: 160, decoration: BoxDecoration( color: model.patientLabOrdersList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? Colors.red[900] : !model.patientLabOrdersList[index] - .isInOutPatient + .isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -157,17 +157,17 @@ class _LabsHomePageState extends State { child: Center( child: Text( model.patientLabOrdersList[index] - .isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare + .isLiveCareAppointment! + ? TranslationBase.of(context)! + .liveCare! .toUpperCase() : !model.patientLabOrdersList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel + .isInOutPatient! + ? TranslationBase.of(context)! + .inPatientLabel! .toUpperCase() - : TranslationBase.of(context) - .outpatient + : TranslationBase.of(context)! + .outpatient! .toUpperCase(), style: TextStyle(color: Colors.white), ), @@ -209,7 +209,7 @@ class _LabsHomePageState extends State { ), ), if (model.patientLabOrdersList.isEmpty && - patient.patientStatusType != 43) + patient!.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 1b33aecb..290a8e8b 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -30,13 +30,13 @@ class _AddVerifyMedicalReportState extends State { var event = RobotProvider(); TextEditingController commentController = TextEditingController(); - String commentsError; + String? commentsError; @override void initState() { requestPermissions(); event.controller.stream.listen((p) { - if (p['startPopUp'] == 'true') { + if (p!['startPopUp'] == 'true') { if (this.mounted) { initSpeechState().then((value) => {onVoiceText()}); } @@ -54,8 +54,8 @@ class _AddVerifyMedicalReportState extends State { baseViewModel: model, isShowAppBar: true, appBarTitle: widget.status == MedicalReportStatus.ADD - ? TranslationBase.of(context).medicalReportAdd - : TranslationBase.of(context).medicalReportVerify, + ? TranslationBase.of(context)!.medicalReportAdd + : TranslationBase.of(context)!.medicalReportVerify, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: Column( children: [ @@ -68,7 +68,7 @@ class _AddVerifyMedicalReportState extends State { Stack( children: [ AppTextFieldCustom( - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context)! .sickLeaveComments, controller: commentController, maxLines: 30, @@ -106,8 +106,8 @@ class _AddVerifyMedicalReportState extends State { margin: EdgeInsets.all(16.0), child: AppButton( title: widget.status == MedicalReportStatus.ADD - ? TranslationBase.of(context).medicalReportAdd - : TranslationBase.of(context).medicalReportVerify, + ? TranslationBase.of(context)!.medicalReportAdd + : TranslationBase.of(context)!.medicalReportVerify, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -115,7 +115,7 @@ class _AddVerifyMedicalReportState extends State { setState(() { if (commentController.text == "") { commentsError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { commentsError = null; } @@ -130,7 +130,7 @@ class _AddVerifyMedicalReportState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); - var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; + var lang = TranslationBase.of(AppGlobal.CONTEX)!.locale.languageCode; bool available = await speech.initialize( onStatus: statusListener, onError: errorListener); if (available) { diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index 76ce2951..0e74357b 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -15,10 +15,10 @@ class MedicalReportDetailPage extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; return BaseView( builder: (_, model, w) => AppScaffold( @@ -40,13 +40,13 @@ class MedicalReportDetailPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).medical}", + "${TranslationBase.of(context)!.medical}", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), AppText( - TranslationBase.of(context).report, + TranslationBase.of(context)!.report, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), @@ -72,7 +72,7 @@ class MedicalReportDetailPage extends StatelessWidget { child: Column( children: [ AppText( - TranslationBase.of(context).chiefComplaints, + TranslationBase.of(context)!.chiefComplaints, fontWeight: FontWeight.w700, fontSize: 2.4 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), @@ -100,9 +100,9 @@ class MedicalReportDetailPage extends StatelessWidget { shape: BoxShape.rectangle, border: Border( bottom: BorderSide( - color: Colors.grey[400], width: 2.5), + color: Colors.grey[400]!, width: 2.5), left: BorderSide( - color: Colors.grey[400], width: 2.5), + color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -128,7 +128,7 @@ class MedicalReportDetailPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - '${TranslationBase.of(context).dr}. replace with doctor name', + '${TranslationBase.of(context)!.dr}. replace with doctor name', fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier, color: Colors.black, diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 8dad1bc4..0a0dc449 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -15,10 +15,10 @@ import 'package:provider/provider.dart'; class MedicalReportPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - bool isInpatient = routeArgs['isInpatient']; + String? patientType = routeArgs['patientType']; + bool? isInpatient = routeArgs['isInpatient']; ProjectViewModel projectViewModel = Provider.of(context); //TODO Jammal return AppScaffold( diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index be912a60..c144464f 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -28,24 +28,24 @@ import '../../../../widgets/shared/app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { - final int visitType; + final int? visitType; - const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); + const ProgressNoteScreen({Key? key, this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List notesList; + List? notesList; var filteredNotesList; - bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + bool? isDischargedPatient = false; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -54,7 +54,7 @@ class _ProgressNoteState extends State { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( visitType: widget.visitType, // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo!), projectID: patient.projectId, tokenID: token, patientTypeID: patient.patientType, @@ -72,11 +72,11 @@ class _ProgressNoteState extends State { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); final routeArgs = ModalRoute - .of(context) + .of(context)! .settings .arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String arrivalType = routeArgs['arrivalType']; + PatiantInformtion? patient = routeArgs['patient']; + String? arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( @@ -90,7 +90,7 @@ class _ProgressNoteState extends State { // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileHeaderNewDesignAppBar( patient, - patient.patientType.toString() ?? '0', + patient!.patientType.toString() ?? '0', arrivalType, isInpatient: true, ), @@ -98,13 +98,13 @@ class _ProgressNoteState extends State { model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( error: TranslationBase - .of(context) + .of(context)! .errorNoProgressNote) : Container( color: Colors.grey[200], child: Column( children: [ - if (!isDischargedPatient) + if (!isDischargedPatient!) AddNewOrder( onTap: () { Navigator.push( @@ -121,10 +121,10 @@ class _ProgressNoteState extends State { }, label: widget.visitType == 3 ? TranslationBase - .of(context) + .of(context)! .addNewOrderSheet : TranslationBase - .of(context) + .of(context)! .addProgressNote, ), Expanded( @@ -139,7 +139,7 @@ class _ProgressNoteState extends State { bgColor: model.patientProgressNoteList[index] .status == 1 && - authenticationViewModel.doctorProfile.doctorID != + authenticationViewModel.doctorProfile!.doctorID != model .patientProgressNoteList[ index] @@ -166,14 +166,14 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile.doctorID != + .doctorProfile!.doctorID != model .patientProgressNoteList[ index] .createdBy) AppText( TranslationBase - .of(context) + .of(context)! .notePending, fontWeight: FontWeight.bold, color: Color(0xFFCC9B14), @@ -186,7 +186,7 @@ class _ProgressNoteState extends State { 4) AppText( TranslationBase - .of(context) + .of(context)! .noteCanceled, fontWeight: FontWeight.bold, color: Colors.red.shade700, @@ -199,7 +199,7 @@ class _ProgressNoteState extends State { 2) AppText( TranslationBase - .of(context) + .of(context)! .noteVerified, fontWeight: FontWeight.bold, color: Colors.green[600], @@ -212,7 +212,7 @@ class _ProgressNoteState extends State { .status != 4 && authenticationViewModel - .doctorProfile.doctorID == + .doctorProfile!.doctorID == model .patientProgressNoteList[ index] @@ -263,7 +263,7 @@ class _ProgressNoteState extends State { AppText( TranslationBase .of( - context) + context)! .update, fontSize: 10, color: Colors.white, @@ -290,7 +290,7 @@ class _ProgressNoteState extends State { UpdateNoteReqModel( admissionNo: int .parse(patient - .admissionNo), + .admissionNo!), cancelledNote: false, lineItemNo: model @@ -346,7 +346,7 @@ class _ProgressNoteState extends State { AppText( TranslationBase .of( - context) + context)! .noteVerify, fontSize: 10, color: Colors.white, @@ -366,7 +366,7 @@ class _ProgressNoteState extends State { actionName: TranslationBase .of( - context) + context)! .cancel, confirmFun: () async { GifLoaderDialogUtils @@ -378,7 +378,7 @@ class _ProgressNoteState extends State { UpdateNoteReqModel( admissionNo: int .parse(patient - .admissionNo), + .admissionNo!), cancelledNote: true, lineItemNo: model .patientProgressNoteList[ @@ -471,7 +471,7 @@ class _ProgressNoteState extends State { AppText( TranslationBase .of( - context) + context)! .createdBy, fontSize: 10, ), @@ -578,7 +578,7 @@ class _ProgressNoteState extends State { ); } - showMyDialog({BuildContext context, Function confirmFun, String actionName}) { + showMyDialog({required BuildContext context, Function? confirmFun, String? actionName}) { showDialog( context: context, builder: (ctx) => Center( @@ -606,7 +606,7 @@ class _ProgressNoteState extends State { children: [ AppText( TranslationBase - .of(context) + .of(context)! .noteConfirm, fontWeight: FontWeight.w600, color: Colors.black, @@ -644,7 +644,7 @@ class _ProgressNoteState extends State { FlatButton( child: AppText( TranslationBase - .of(context) + .of(context)! .cancel, fontWeight: FontWeight.w600, color: Colors.black, @@ -656,14 +656,14 @@ class _ProgressNoteState extends State { FlatButton( child: AppText( TranslationBase - .of(context) + .of(context)! .noteConfirm, fontWeight: FontWeight.w600, color: Colors.red.shade700, fontSize: 16, ), //Text("Confirm", ), onPressed: () async { - await confirmFun(); + await confirmFun!(); Navigator.of(context).pop(); }) ], diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 3fde4262..5bae6d20 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -28,14 +28,14 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateNoteOrder extends StatefulWidget { - final NoteModel note; - final PatientViewModel patientModel; - final PatiantInformtion patient; - final int visitType; - final bool isUpdate; + final NoteModel? note; + final PatientViewModel? patientModel; + final PatiantInformtion? patient; + final int? visitType; + final bool? isUpdate; const UpdateNoteOrder( - {Key key, + {Key? key, this.note, this.patientModel, this.patient, @@ -48,12 +48,12 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { - int selectedType; + int? selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; TextEditingController progressNoteController = TextEditingController(); @@ -67,7 +67,7 @@ class _UpdateNoteOrderState extends State { void initState() { requestPermissions(); event.controller.stream.listen((p) { - if (p['startPopUp'] == 'true') { + if (p!['startPopUp'] == 'true') { if (this.mounted) { initSpeechState().then((value) => {onVoiceText()}); } @@ -81,7 +81,7 @@ class _UpdateNoteOrderState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note.notes; + progressNoteController.text = widget.note!.notes!; } return AppScaffold( @@ -97,14 +97,14 @@ class _UpdateNoteOrderState extends State { children: [ BottomSheetTitle( title: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? (widget.isUpdate! + ? TranslationBase.of(context)!.noteUpdate + : TranslationBase.of(context)!.noteAdd)! + + TranslationBase.of(context)!.orderSheet! + : (widget.isUpdate! + ? TranslationBase.of(context)!.noteUpdate + : TranslationBase.of(context)!.noteAdd)! + + TranslationBase.of(context)!.progressNote!, ), SizedBox( height: 10.0, @@ -118,18 +118,18 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context) + ? (widget.isUpdate! + ? TranslationBase.of(context)! .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context) + : TranslationBase.of(context)! + .noteAdd)! + + TranslationBase.of(context)!.orderSheet! + : (widget.isUpdate! + ? TranslationBase.of(context)! .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, + : TranslationBase.of(context)! + .noteAdd)! + + TranslationBase.of(context)!.progressNote!, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -140,7 +140,7 @@ class _UpdateNoteOrderState extends State { validationError: progressNoteController.text.isEmpty && isSubmitted - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), Positioned( @@ -181,7 +181,7 @@ class _UpdateNoteOrderState extends State { Container( margin: EdgeInsets.all(5), child: AppButton( - title: TranslationBase.of(context).clearText, + title: TranslationBase.of(context)!.clearText, onPressed: () { setState(() { progressNoteController.text = ''; @@ -193,14 +193,14 @@ class _UpdateNoteOrderState extends State { margin: EdgeInsets.all(5), child: AppButton( title: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? (widget.isUpdate! + ? TranslationBase.of(context)!.noteUpdate + : TranslationBase.of(context)!.noteAdd)! + + TranslationBase.of(context)!.orderSheet! + : (widget.isUpdate! + ? TranslationBase.of(context)!.noteUpdate + : TranslationBase.of(context)!.noteAdd)! + + TranslationBase.of(context)!.progressNote!, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -213,50 +213,50 @@ class _UpdateNoteOrderState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); + DoctorProfileModel.fromJson(profile as Map); - if (widget.isUpdate) { + if (widget.isUpdate!) { UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient!.admissionNo!), cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, + lineItemNo: widget.note!.lineItemNo, + createdBy: widget.note!.createdBy, notes: progressNoteController.text, verifiedNote: false, - patientTypeID: widget.patient.patientType, + patientTypeID: widget.patient!.patientType, patientOutSA: false, ); - await widget.patientModel + await widget.patientModel! .updatePatientProgressNote(reqModel); } else { CreateNoteModel reqModel = CreateNoteModel( admissionNo: - int.parse(widget.patient.admissionNo), + int.parse(widget.patient!.admissionNo!), createdBy: doctorProfile.doctorID, visitType: widget.visitType, - patientID: widget.patient.patientId, + patientID: widget.patient!.patientId, nursingRemarks: ' ', - patientTypeID: widget.patient.patientType, + patientTypeID: widget.patient!.patientType, patientOutSA: false, notes: progressNoteController.text); - await widget.patientModel + await widget.patientModel! .createPatientProgressNote(reqModel); } - if (widget.patientModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientModel.error); + if (widget.patientModel!.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientModel!.error); } else { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( visitType: widget.visitType, // if equal 5 then this will return progress note admissionNo: - int.parse(widget.patient.admissionNo), - projectID: widget.patient.projectId, - patientTypeID: widget.patient.patientType, + int.parse(widget.patient!.admissionNo!), + projectID: widget.patient!.projectId, + patientTypeID: widget.patient!.patientType, languageID: 2); - await widget.patientModel.getPatientProgressNote( + await widget.patientModel!.getPatientProgressNote( progressNoteRequest.toJson()); } GifLoaderDialogUtils.hideDialog(context); @@ -275,7 +275,7 @@ class _UpdateNoteOrderState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); - var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; + var lang = TranslationBase.of(AppGlobal.CONTEX)!.locale.languageCode; bool available = await speech.initialize( onStatus: statusListener, onError: errorListener); if (available) { diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index ca8be2c0..fea13e7d 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -17,10 +17,10 @@ class InpatientPrescriptionDetailsScreen extends StatefulWidget { class _InpatientPrescriptionDetailsScreenState extends State { bool _showDetails = false; - String error; - TextEditingController answerController; + String? error; + TextEditingController? answerController; bool _isInit = true; - PrescriptionReportForInPatient prescription; + PrescriptionReportForInPatient? prescription; @override void initState() { @@ -31,7 +31,7 @@ class _InpatientPrescriptionDetailsScreenState void didChangeDependencies() { super.didChangeDependencies(); if (_isInit) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; prescription = routeArgs['prescription']; } _isInit = false; @@ -40,7 +40,7 @@ class _InpatientPrescriptionDetailsScreenState @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionInfo, + appBarTitle: TranslationBase.of(context)!.prescriptionInfo, body: CardWithBgWidgetNew( widget: Container( child: ListView( @@ -49,7 +49,7 @@ class _InpatientPrescriptionDetailsScreenState mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - prescription.itemDescription, + prescription!.itemDescription, fontSize: 2.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -84,50 +84,50 @@ class _InpatientPrescriptionDetailsScreenState ), children: [ buildTableRow( - des: '${prescription.direction}', + des: '${prescription!.direction}', key: 'Direction'), buildTableRow( - des: '${prescription.refillID}', + des: '${prescription!.refillID}', key: 'Refill'), buildTableRow( - des: '${prescription.dose}', key: 'Dose'), + des: '${prescription!.dose}', key: 'Dose'), buildTableRow( - des: '${prescription.unitofMeasurement}', + des: '${prescription!.unitofMeasurement}', key: 'UOM'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.startDatetime)}', + '${AppDateUtils.getDate(prescription!.startDatetime)}', key: 'Start Date'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.stopDatetime)}', + '${AppDateUtils.getDate(prescription!.stopDatetime)}', key: 'Stop Date'), buildTableRow( - des: '${prescription.noOfDoses}', + des: '${prescription!.noOfDoses}', key: 'No of Doses'), buildTableRow( - des: '${prescription.route}', key: 'Route'), + des: '${prescription!.route}', key: 'Route'), buildTableRow( - des: '${prescription.comments}', + des: '${prescription!.comments}', key: 'Comments'), buildTableRow( - des: '${prescription.pharmacyRemarks}', + des: '${prescription!.pharmacyRemarks}', key: 'Pharmacy Remarks'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.prescriptionDatetime)}', + '${AppDateUtils.getDate(prescription!.prescriptionDatetime)}', key: 'Prescription Date'), buildTableRow( - des: '${prescription.refillID}', + des: '${prescription!.refillID}', key: 'Status'), buildTableRow( - des: '${prescription.refillID}', + des: '${prescription!.refillID}', key: 'Created By'), buildTableRow( - des: '${prescription.refillID}', + des: '${prescription!.refillID}', key: 'Processed By'), buildTableRow( - des: '${prescription.refillID}', + des: '${prescription!.refillID}', key: 'Authorized By'), ], ), diff --git a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart index 50585143..ee11dac0 100644 --- a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart +++ b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart @@ -5,9 +5,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsItem extends StatefulWidget { - final PrescriptionReport prescriptionReport; + final PrescriptionReport? prescriptionReport; - OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport}); + OutPatientPrescriptionDetailsItem({Key? key, this.prescriptionReport}); @override _OutPatientPrescriptionDetailsItemState createState() => @@ -29,7 +29,7 @@ class _OutPatientPrescriptionDetailsItemState Expanded( flex: 5, child: AppText( - '${widget.prescriptionReport.itemDescription} ', + '${widget.prescriptionReport!.itemDescription} ', fontSize: 2.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -69,17 +69,17 @@ class _OutPatientPrescriptionDetailsItemState children: [ buildTableRow( key: 'Route', - des: widget.prescriptionReport.route), + des: widget.prescriptionReport!.route), buildTableRow( key: 'Frequency Timing', - des: widget.prescriptionReport.frequency), + des: widget.prescriptionReport!.frequency), buildTableRow(key: 'Insurance Covered', des: ''), buildTableRow( key: 'Duration Days', - des: widget.prescriptionReport.days), + des: widget.prescriptionReport!.days), buildTableRow( key: 'IDoctor Remarks', - des: widget.prescriptionReport.remarks), + des: widget.prescriptionReport!.remarks), ], ), Divider( diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index 3b566d81..f019d815 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -1,13 +1,13 @@ class PatientProfileCardModel { - final String nameLine1; - final String nameLine2; + final String? nameLine1; + final String? nameLine2; final dynamic route; final String icon; - final bool isInPatient; + final bool? isInPatient; final bool isDisable; final bool isLoading; - final Function onTap; - final bool isDischargedPatient; + final Function? onTap; + final bool? isDischargedPatient; final bool isSelectInpatient; PatientProfileCardModel( diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index aa2b5276..111a2635 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -25,19 +25,19 @@ class PatientProfileScreen extends StatefulWidget { class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { - PatiantInformtion patient; + PatiantInformtion? patient; - bool isFromSearch = false; + bool? isFromSearch = false; - bool isInpatient = false; + bool? isInpatient = false; - bool isDischargedPatient = false; - bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; - TabController _tabController; + bool? isDischargedPatient = false; + bool? isSearchAndOut = false; + String? patientType; + String? arrivalType; + String? from; + String? to; + late TabController _tabController; int index = 0; int _activeTab = 0; @override @@ -55,7 +55,7 @@ class _PatientProfileScreenState extends State @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -73,7 +73,7 @@ class _PatientProfileScreenState extends State if (routeArgs.containsKey("isSearchAndOut")) { isSearchAndOut = routeArgs['isSearchAndOut']; } - if (isInpatient) + if (isInpatient!) _activeTab = 0; else _activeTab = 1; @@ -85,7 +85,7 @@ class _PatientProfileScreenState extends State return BaseView( builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, - appBarTitle: TranslationBase.of(context).patientProfile, + appBarTitle: TranslationBase.of(context)!.patientProfile, isShowAppBar: false, body: Column( children: [ @@ -99,24 +99,24 @@ class _PatientProfileScreenState extends State arrivalType ?? '0', patientType, isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) + height: (patient!.patientStatusType != null && + patient!.patientStatusType == 43) ? 210 - : isDischargedPatient + : isDischargedPatient! ? 240 : 0, isDischargedPatient:isDischargedPatient ), Container( - height: !isSearchAndOut - ? isDischargedPatient + height: !isSearchAndOut! + ? isDischargedPatient! ? MediaQuery.of(context).size.height * 0.64 : MediaQuery.of(context).size.height * 0.65 : MediaQuery.of(context).size.height * 0.69, child: ListView( children: [ Container( - child: isSearchAndOut + child: isSearchAndOut! ? ProfileGridForSearch( patient: patient, patientType: patientType, @@ -125,7 +125,7 @@ class _PatientProfileScreenState extends State from: from, to: to, ) - : isInpatient + : isInpatient! ? ProfileGridForInPatient( patient: patient, patientType: patientType, @@ -151,8 +151,8 @@ class _PatientProfileScreenState extends State ), ], ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient!.patientStatusType != null && + patient!.patientStatusType == 43) BaseView( onModelReady: (model) async {}, builder: (_, model, w) => Positioned( @@ -162,11 +162,11 @@ class _PatientProfileScreenState extends State child: Row( children: [ Expanded(child: Container()), - if (patient.episodeNo == 0) + if (patient!.episodeNo == 0) AppButton( title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 + "${TranslationBase.of(context)!.createNew}\n${TranslationBase.of(context)!.episode}", + color: patient!.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, fontColor: Colors.white, @@ -181,22 +181,22 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () async { - if (patient.patientStatusType == + if (patient!.patientStatusType == 43) { PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( appointmentNo: - patient.appointmentNo, + patient!.appointmentNo, patientMRN: - patient.patientMRN); + patient!.patientMRN); GifLoaderDialogUtils.showMyDialog( context); await model.postEpisode( postEpisodeReqModel); GifLoaderDialogUtils.hideDialog( context); - patient.episodeNo = + patient!.episodeNo = model.episodeID; Navigator.of(context).pushNamed( CREATE_EPISODE, @@ -206,12 +206,12 @@ class _PatientProfileScreenState extends State } }, ), - if (patient.episodeNo != 0) + if (patient!.episodeNo != 0) AppButton( title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + "${TranslationBase.of(context)!.update}\n${TranslationBase.of(context)!.episode}", color: - patient.patientStatusType == 43 + patient!.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, fontColor: Colors.white, @@ -226,7 +226,7 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () { - if (patient.patientStatusType == + if (patient!.patientStatusType == 43) { Navigator.of(context).pushNamed( UPDATE_EPISODE, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 1df7d236..4bf35d48 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -9,18 +9,18 @@ import '../../../../routes.dart'; // ignore: must_be_immutable class ProfileGridForInPatient extends StatelessWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final double height; - final bool isInpatient; - final bool isDischargedPatient; - final bool isFromSearch; - String from; - String to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final double? height; + final bool? isInpatient; + final bool? isDischargedPatient; + final bool? isFromSearch; + String? from; + String? to; ProfileGridForInPatient( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, @@ -36,86 +36,86 @@ class ProfileGridForInPatient extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, + TranslationBase.of(context)!.vital, + TranslationBase.of(context)!.signs, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, + TranslationBase.of(context)!.lab, + TranslationBase.of(context)!.result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).result, + TranslationBase.of(context)!.radiology, + TranslationBase.of(context)!.result, RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, + TranslationBase.of(context)!.patient, + TranslationBase.of(context)!.prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).progress, - TranslationBase.of(context).note, + TranslationBase.of(context)!.progress, + TranslationBase.of(context)!.note, PROGRESS_NOTE, 'patient/Progress_notes.png', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( - TranslationBase.of(context).order, - TranslationBase.of(context).sheet, + TranslationBase.of(context)!.order, + TranslationBase.of(context)!.sheet, ORDER_NOTE, 'patient/Progress_notes.png', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, + TranslationBase.of(context)!.orders, + TranslationBase.of(context)!.procedures, ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, + TranslationBase.of(context)!.health, + TranslationBase.of(context)!.summary, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).medical, - TranslationBase.of(context).report, + TranslationBase.of(context)!.medical, + TranslationBase.of(context)!.report, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient, isDisable: true), PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context)!.referral, + TranslationBase.of(context)!.patient, REFER_IN_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, - isDisable: isDischargedPatient || isFromSearch, + isDisable: isDischargedPatient! || isFromSearch!, ), PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).approvals, + TranslationBase.of(context)!.insurance, + TranslationBase.of(context)!.approvals, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).discharge, - TranslationBase.of(context).report, + TranslationBase.of(context)!.discharge, + TranslationBase.of(context)!.report, null, 'patient/patient_sick_leave.png', isInPatient: isInpatient, isDisable: true), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context)!.patientSick, + TranslationBase.of(context)!.leave, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 86ccd6d1..f44a912a 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -9,16 +9,16 @@ import '../../../../routes.dart'; // ignore: must_be_immutable class ProfileGridForOther extends StatelessWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final double height; - final bool isInpatient; - String from; - String to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final double? height; + final bool? isInpatient; + String? from; + String? to; ProfileGridForOther( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, @@ -32,83 +32,83 @@ class ProfileGridForOther extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, + TranslationBase.of(context)!.vital, + TranslationBase.of(context)!.signs, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, + TranslationBase.of(context)!.lab, + TranslationBase.of(context)!.result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, + TranslationBase.of(context)!.radiology, + TranslationBase.of(context)!.service, RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription, + TranslationBase.of(context)!.orders, + TranslationBase.of(context)!.prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, + TranslationBase.of(context)!.health, + TranslationBase.of(context)!.summary, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, + TranslationBase.of(context)!.patient, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, + TranslationBase.of(context)!.orders, + TranslationBase.of(context)!.procedures, ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, + TranslationBase.of(context)!.insurance, + TranslationBase.of(context)!.service, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context)!.patientSick, + TranslationBase.of(context)!.leave, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, + TranslationBase.of(context)!.patient, + TranslationBase.of(context)!.ucaf, PATIENT_UCAF_REQUEST, 'patient/ucaf.png', isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + isDisable: patient!.patientStatusType != 43 ? true : false), + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context)!.referral, + TranslationBase.of(context)!.patient, REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + isDisable: patient!.patientStatusType != 43 ? true : false), + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, + TranslationBase.of(context)!.admission, + TranslationBase.of(context)!.request, PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + isDisable: patient!.patientStatusType != 43 ? true : false), ]; return Column( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 9c9f7d36..71cde5ff 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -8,16 +8,16 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; class ProfileGridForSearch extends StatelessWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final double height; - final bool isInpatient; - String from; - String to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final double? height; + final bool? isInpatient; + String? from; + String? to; ProfileGridForSearch( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, @@ -29,83 +29,83 @@ class ProfileGridForSearch extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, + TranslationBase.of(context)!.vital, + TranslationBase.of(context)!.signs, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, + TranslationBase.of(context)!.lab, + TranslationBase.of(context)!.result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, + TranslationBase.of(context)!.radiology, + TranslationBase.of(context)!.service, RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription, + TranslationBase.of(context)!.orders, + TranslationBase.of(context)!.prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, + TranslationBase.of(context)!.health, + TranslationBase.of(context)!.summary, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, + TranslationBase.of(context)!.patient, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, + TranslationBase.of(context)!.orders, + TranslationBase.of(context)!.procedures, ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, + TranslationBase.of(context)!.insurance, + TranslationBase.of(context)!.service, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context)!.patientSick, + TranslationBase.of(context)!.leave, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, + TranslationBase.of(context)!.patient, + TranslationBase.of(context)!.ucaf, PATIENT_UCAF_REQUEST, 'patient/ucaf.png', isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + isDisable: patient!.patientStatusType != 43 ? true : false), + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context)!.referral, + TranslationBase.of(context)!.patient, REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + isDisable: patient!.patientStatusType != 43 ? true : false), + if (patient!.appointmentNo != null && patient!.appointmentNo != 0) PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, + TranslationBase.of(context)!.admission, + TranslationBase.of(context)!.request, PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + isDisable: patient!.patientStatusType != 43 ? true : false), ]; return Column( diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index acc79d19..95bc6c0f 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -12,13 +12,13 @@ import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { - final FinalRadiology finalRadiology; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; + final FinalRadiology? finalRadiology; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; RadiologyDetailsPage( - {Key key, + {Key? key, this.finalRadiology, this.patient, this.patientType, @@ -29,20 +29,20 @@ class RadiologyDetailsPage extends StatelessWidget { return BaseView( onModelReady: (model) => model.getRadImageURL( patient: patient, - projectId: finalRadiology.projectID, - lineItem: finalRadiology.invoiceLineItemNo, - invoiceNo: finalRadiology.invoiceNo), + projectId: finalRadiology!.projectID, + lineItem: finalRadiology!.invoiceLineItemNo, + invoiceNo: finalRadiology!.invoiceNo), builder: (_, model, widget) => AppScaffold( appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, patientType: patientType ?? "0", arrivalType: arrivalType ?? "0", - appointmentDate: finalRadiology.orderDate, - doctorName: finalRadiology.doctorName, - clinic: finalRadiology.clinicDescription, - branch: finalRadiology.projectName, - profileUrl: finalRadiology.doctorImageURL, - invoiceNO: finalRadiology.invoiceNo.toString(), + appointmentDate: finalRadiology!.orderDate, + doctorName: finalRadiology!.doctorName, + clinic: finalRadiology!.clinicDescription, + branch: finalRadiology!.projectName, + profileUrl: finalRadiology!.doctorImageURL, + invoiceNO: finalRadiology!.invoiceNo.toString(), ), isShowAppBar: true, baseViewModel: model, @@ -66,13 +66,13 @@ class RadiologyDetailsPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),), + child: AppText(TranslationBase.of(context)!.generalResult,color: Color(0xff2E303A),), ), Padding( padding: const EdgeInsets.all(8.0), child: AppText( - '${finalRadiology.reportData.trim()}', + '${finalRadiology!.reportData.trim()}', textAlign: TextAlign.start, fontSize: 17, color: Color(0xff575757), @@ -87,7 +87,7 @@ class RadiologyDetailsPage extends StatelessWidget { ], ), ), - bottomSheet: model.radImageURL.isNotEmpty + bottomSheet: model.radImageURL!.isNotEmpty ? Container( height: 80, width: double.maxFinite, @@ -96,12 +96,12 @@ class RadiologyDetailsPage extends StatelessWidget { EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: SecondaryButton( color: Color(0xffD02127), - disabled: finalRadiology.dIAPACSURL == "", + disabled: finalRadiology!.dIAPACSURL == "", textColor: Color(0xffFFFFFF), onTap: () { - launch(model.radImageURL); + launch(model.radImageURL!); }, - label: TranslationBase.of(context).openRad, + label: TranslationBase.of(context)!.openRad, ), ), ) diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 4b8d224e..1c147fa3 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -21,15 +21,15 @@ class RadiologyHomePage extends StatefulWidget { } class _RadiologyHomePageState extends State { - String patientType; - PatiantInformtion patient; - String arrivalType; - bool isInpatient; + String? patientType; + PatiantInformtion? patient; + String? arrivalType; + bool? isInpatient; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -49,7 +49,7 @@ class _RadiologyHomePageState extends State { // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( patient, - patient.patientType.toString() ?? '0', + patient!.patientType.toString() ?? '0', arrivalType, isInpatient: isInpatient, ), @@ -63,49 +63,49 @@ class _RadiologyHomePageState extends State { height: 12, ), if (model.radiologyList.isNotEmpty && - patient.patientStatusType != 43) + patient!.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).radiology, + TranslationBase.of(context)!.radiology, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - TranslationBase.of(context).result, + TranslationBase.of(context)!.result, bold: true, fontSize: 22, ), ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient!.patientStatusType != null && + patient!.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).radiology, + TranslationBase.of(context)!.radiology, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - TranslationBase.of(context).result, + TranslationBase.of(context)!.result, bold: true, fontSize: 22, ), ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient!.patientStatusType != null && + patient!.patientStatusType == 43) AddNewOrder( onTap: () { Navigator.push( @@ -117,7 +117,7 @@ class _RadiologyHomePageState extends State { )), ); }, - label: TranslationBase.of(context).applyForRadiologyOrder, + label: TranslationBase.of(context)!.applyForRadiologyOrder, ), ...List.generate( model.radiologyList.length, @@ -140,9 +140,9 @@ class _RadiologyHomePageState extends State { decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) color: model.radiologyList[index] - .isLiveCareAppodynamicment + .isLiveCareAppodynamicment! ? Colors.red[900] - : !model.radiologyList[index].isInOutPatient + : !model.radiologyList[index].isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -157,17 +157,17 @@ class _RadiologyHomePageState extends State { child: Center( child: Text( model.radiologyList[index] - .isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare + .isLiveCareAppodynamicment! + ? TranslationBase.of(context)! + .liveCare! .toUpperCase() : !model.radiologyList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel + .isInOutPatient! + ? TranslationBase.of(context)! + .inPatientLabel! .toUpperCase() - : TranslationBase.of(context) - .outpatient + : TranslationBase.of(context)! + .outpatient! .toUpperCase(), style: TextStyle(color: Colors.white), ), @@ -207,7 +207,7 @@ class _RadiologyHomePageState extends State { ), )), if (model.radiologyList.isEmpty && - patient.patientStatusType != 43) + patient!.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index e7714074..75b11625 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -8,15 +8,15 @@ import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; class RadiologyReportScreen extends StatelessWidget { - final String reportData; - final String url; + final String? reportData; + final String? url; - RadiologyReportScreen({Key key, this.reportData, this.url}); + RadiologyReportScreen({Key? key, this.reportData, this.url}); @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, + appBarTitle: TranslationBase.of(context)!.radiologyReport, body: SingleChildScrollView( child: Column( children: [ @@ -60,9 +60,9 @@ class RadiologyReportScreen extends StatelessWidget { children: [ // TODO change it secondary button and add loading AppButton( - title: TranslationBase.of(context).openRad, + title: TranslationBase.of(context)!.openRad, onPressed: () async { - launch(url); + launch(url!); }, ), ], diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index f54a18ac..71c4a006 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -20,11 +20,11 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class AddReplayOnReferralPatient extends StatefulWidget { - final PatientReferralViewModel patientReferralViewModel; - final MyReferralPatientModel myReferralInPatientModel; + final PatientReferralViewModel? patientReferralViewModel; + final MyReferralPatientModel? myReferralInPatientModel; const AddReplayOnReferralPatient( - {Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) + {Key? key, this.patientReferralViewModel, this.myReferralInPatientModel}) : super(key: key); @override @@ -78,7 +78,7 @@ class _AddReplayOnReferralPatientState validationError: replayOnReferralController.text.isEmpty && isSubmitted - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), Positioned( @@ -117,7 +117,7 @@ class _AddReplayOnReferralPatientState margin: EdgeInsets.all(5), child: Expanded( child: AppButton( - title: TranslationBase.of(context).clearText, + title: TranslationBase.of(context)!.clearText, onPressed: () { setState(() { replayOnReferralController.text = ''; @@ -137,13 +137,13 @@ class _AddReplayOnReferralPatientState }); if (replayOnReferralController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replay( + await widget.patientReferralViewModel!.replay( replayOnReferralController.text.trim(), - widget.myReferralInPatientModel); - if (widget.patientReferralViewModel.state == + widget.myReferralInPatientModel!); + if (widget.patientReferralViewModel!.state == ViewState.ErrorLocal) { Helpers.showErrorToast( - widget.patientReferralViewModel.error); + widget.patientReferralViewModel!.error); } else { GifLoaderDialogUtils.hideDialog(context); DrAppToastMsg.showSuccesToast( @@ -166,7 +166,7 @@ class _AddReplayOnReferralPatientState onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); - var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; + var lang = TranslationBase.of(AppGlobal.CONTEX)!.locale.languageCode; bool available = await speech.initialize( onStatus: statusListener, onError: errorListener); if (available) { diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 447a3739..1d9fb23f 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -17,11 +17,11 @@ import 'package:hexcolor/hexcolor.dart'; // ignore: must_be_immutable class MyReferralDetailScreen extends StatelessWidget { - PendingReferral pendingReferral; + PendingReferral? pendingReferral; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; pendingReferral = routeArgs['referral']; return BaseView( @@ -31,11 +31,11 @@ class MyReferralDetailScreen extends StatelessWidget { "yyyy-MM-dd"), AppDateUtils.convertStringToDateFormat( DateTime.now().toString(), "yyyy-MM-dd"), - pendingReferral.patientID, - pendingReferral.sourceAppointmentNo), + pendingReferral!.patientID, + pendingReferral!.sourceAppointmentNo), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context)!.referPatient, isShowAppBar: false, body: model.patientArrivalList != null && model.patientArrivalList.length > 0 @@ -64,14 +64,14 @@ class MyReferralDetailScreen extends StatelessWidget { child: AppText( (Helpers.capitalize(model .patientArrivalList[0] - .patientDetails + .patientDetails! .fullName)), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), ), - model.patientArrivalList[0].patientDetails + model.patientArrivalList[0].patientDetails! .gender == 1 ? Icon( @@ -93,7 +93,7 @@ class MyReferralDetailScreen extends StatelessWidget { width: 60, height: 60, child: Image.asset( - pendingReferral.patientDetails.gender == 1 + pendingReferral!.patientDetails!.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -111,21 +111,21 @@ class MyReferralDetailScreen extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ AppText( - pendingReferral.referralStatus != null - ? pendingReferral.referralStatus + pendingReferral!.referralStatus != null + ? pendingReferral!.referralStatus : "", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, - color: pendingReferral + color: pendingReferral! .referralStatus != null - ? pendingReferral + ? pendingReferral! .referralStatus == 'Pending' ? Color(0xffc4aa54) - : pendingReferral + : pendingReferral! .referralStatus == 'Accepted' ? Colors.green[700] @@ -133,7 +133,7 @@ class MyReferralDetailScreen extends StatelessWidget { : Colors.grey[500], ), AppText( - pendingReferral.referredOn + pendingReferral!.referredOn! .split(" ")[0], fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -152,7 +152,7 @@ class MyReferralDetailScreen extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -161,7 +161,7 @@ class MyReferralDetailScreen extends StatelessWidget { color: Color(0XFF575757), ), AppText( - "${pendingReferral.patientID}", + "${pendingReferral!.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * @@ -171,7 +171,7 @@ class MyReferralDetailScreen extends StatelessWidget { ], ), AppText( - pendingReferral.referredOn + pendingReferral!.referredOn! .split(" ")[1], fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -195,7 +195,7 @@ class MyReferralDetailScreen extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .referredFrom, fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -205,13 +205,13 @@ class MyReferralDetailScreen extends StatelessWidget { color: Color(0XFF575757), ), AppText( - pendingReferral - .isReferralDoctorSameBranch + pendingReferral! + .isReferralDoctorSameBranch! ? TranslationBase.of( - context) + context)! .sameBranch : TranslationBase.of( - context) + context)! .otherBranch, fontFamily: 'Poppins', fontWeight: FontWeight.w700, @@ -229,8 +229,8 @@ class MyReferralDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .remarks + + TranslationBase.of(context)! + .remarks! + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -241,7 +241,7 @@ class MyReferralDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - pendingReferral + pendingReferral! .remarksFromSource, fontFamily: 'Poppins', fontWeight: @@ -260,11 +260,11 @@ class MyReferralDetailScreen extends StatelessWidget { Row( children: [ AppText( - pendingReferral.patientDetails + pendingReferral!.patientDetails! .nationalityName != null - ? pendingReferral - .patientDetails + ? pendingReferral! + .patientDetails! .nationalityName : "", fontWeight: FontWeight.bold, @@ -272,7 +272,7 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 1.4 * SizeConfig.textMultiplier, ), - pendingReferral + pendingReferral! .nationalityFlagUrl != null ? ClipRRect( @@ -280,14 +280,14 @@ class MyReferralDetailScreen extends StatelessWidget { BorderRadius.circular( 20.0), child: Image.network( - pendingReferral - .nationalityFlagUrl, + pendingReferral! + .nationalityFlagUrl!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace + StackTrace? stackTrace) { return Text('No Image'); }, @@ -324,8 +324,8 @@ class MyReferralDetailScreen extends StatelessWidget { child: CircleAvatar( radius: 25.0, backgroundImage: NetworkImage( - pendingReferral - .doctorImageUrl), + pendingReferral! + .doctorImageUrl!), backgroundColor: Colors.transparent, ), @@ -342,7 +342,7 @@ class MyReferralDetailScreen extends StatelessWidget { child: Column( children: [ AppText( - pendingReferral + pendingReferral! .referredByDoctorInfo, fontFamily: 'Poppins', fontWeight: FontWeight.w700, @@ -397,7 +397,7 @@ class MyReferralDetailScreen extends StatelessWidget { children: [ Expanded( child: AppButton( - title: TranslationBase.of(context).accept, + title: TranslationBase.of(context)!.accept, color: Color(0xFF4BA821), fontColor: Colors.white, fontSize: 1.6, @@ -405,12 +405,12 @@ class MyReferralDetailScreen extends StatelessWidget { vPadding: 12, onPressed: () async { await model.responseReferral( - pendingReferral, true); + pendingReferral!, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) + TranslationBase.of(context)! .referralSuccessMsgAccept); Navigator.pop(context); Navigator.pop(context); @@ -423,7 +423,7 @@ class MyReferralDetailScreen extends StatelessWidget { ), Expanded( child: AppButton( - title: TranslationBase.of(context).reject, + title: TranslationBase.of(context)!.reject, color: Color(0xFFB9382C), fontColor: Colors.white, fontSize: 1.6, @@ -431,12 +431,12 @@ class MyReferralDetailScreen extends StatelessWidget { vPadding: 12, onPressed: () async { await model.responseReferral( - pendingReferral, true); + pendingReferral!, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) + TranslationBase.of(context)! .referralSuccessMsgReject); Navigator.pop(context); Navigator.pop(context); @@ -473,7 +473,7 @@ class MyReferralDetailScreen extends StatelessWidget { Container( child: Center( child: AppText( - TranslationBase.of(context).patientNoDetailErrMsg, + TranslationBase.of(context)!.patientNoDetailErrMsg, color: HexColor("#B8382B"), fontWeight: FontWeight.bold, fontSize: 16, diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index fcbd11b7..dd06338d 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -19,7 +19,7 @@ class MyReferralInPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context)!.referPatient, body: model.myReferralPatients.isEmpty ? Center( child: Column( @@ -32,7 +32,7 @@ class MyReferralInPatientScreen extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - TranslationBase.of(context).referralEmptyMsg, + TranslationBase.of(context)!.referralEmptyMsg, color: Theme.of(context).errorColor, ), ) @@ -65,7 +65,7 @@ class MyReferralInPatientScreen extends StatelessWidget { patientName: model.myReferralPatients[index].patientName, patientGender: model.myReferralPatients[index].gender, referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), - referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), + referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate!), patientID: "${model.myReferralPatients[index].patientID}", isSameBranch: false, isReferral: true, diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index fe6fd2db..f52fcc3f 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -18,7 +18,7 @@ class MyReferralPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context)!.referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( child: Column( @@ -31,7 +31,7 @@ class MyReferralPatientScreen extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - TranslationBase.of(context).referralEmptyMsg, + TranslationBase.of(context)!.referralEmptyMsg, color: Theme.of(context).errorColor, ), ) @@ -62,12 +62,12 @@ class MyReferralPatientScreen extends StatelessWidget { patientName: model.pendingReferral[index].patientName, patientGender: model - .pendingReferral[index].patientDetails.gender, + .pendingReferral[index].patientDetails!.gender, referredDate: model - .pendingReferral[index].referredOn + .pendingReferral[index].referredOn! .split(" ")[0], referredTime: model - .pendingReferral[index].referredOn + .pendingReferral[index].referredOn! .split(" ")[1], patientID: "${model.pendingReferral[index].patientID}", @@ -77,7 +77,7 @@ class MyReferralPatientScreen extends StatelessWidget { remark: model.pendingReferral[index].remarksFromSource, nationality: model.pendingReferral[index] - .patientDetails.nationalityName, + .patientDetails!.nationalityName, nationalityFlag: model.pendingReferral[index].nationalityFlagUrl, doctorAvatar: diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index de1d5958..ffd4acf4 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -19,26 +19,26 @@ class PatientReferralScreen extends StatefulWidget { class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { - TabController _tabController; + TabController? _tabController; int index=0; @override void initState() { super.initState(); _tabController = TabController(length: 3, vsync: this); - _tabController.addListener(_handleTabSelection); + _tabController!.addListener(_handleTabSelection); } _handleTabSelection() { setState(() { - index = _tabController.index; + index = _tabController!.index; }); } @override void dispose() { super.dispose(); - _tabController.dispose(); + _tabController!.dispose(); } @@ -46,7 +46,7 @@ class _PatientReferralScreen extends State with SingleTic Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).patientsreferral, + appBarTitle: TranslationBase.of(context)!.patientsreferral, body: Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, @@ -92,7 +92,7 @@ class _PatientReferralScreen extends State with SingleTic borderWidth: 0), child: Center( child: AppText( - TranslationBase.of(context).myReferredPatient, + TranslationBase.of(context)!.myReferredPatient, fontSize: SizeConfig.textMultiplier * 1.8, color: index == 0 ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, @@ -119,7 +119,7 @@ class _PatientReferralScreen extends State with SingleTic borderWidth: 0), child: Center( child: AppText( - TranslationBase.of(context).referral, + TranslationBase.of(context)!.referral, fontSize: SizeConfig.textMultiplier * 1.8, color: index == 1 ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, @@ -146,7 +146,7 @@ class _PatientReferralScreen extends State with SingleTic borderWidth: 0), child: Center( child: AppText( - TranslationBase.of(context).discharged, + TranslationBase.of(context)!.discharged, fontSize: SizeConfig.textMultiplier * 1.8, color: index == 2 ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index cc491cf2..e91978c8 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -31,8 +31,8 @@ class PatientMakeInPatientReferralScreen extends StatefulWidget { class _PatientMakeInPatientReferralScreenState extends State { - PatiantInformtion patient; - List referToList; + PatiantInformtion? patient; + List? referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; @@ -41,13 +41,13 @@ class _PatientMakeInPatientReferralScreenState final _remarksController = TextEditingController(); final _extController = TextEditingController(); int _activePriority = 1; - String appointmentDate; + String? appointmentDate; - String branchError; - String hospitalError; - String clinicError; - String doctorError; - String frequencyError; + String? branchError; + String? hospitalError; + String? clinicError; + String? doctorError; + String? frequencyError; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); @@ -56,7 +56,7 @@ class _PatientMakeInPatientReferralScreenState void initState() { requestPermissions(); event.controller.stream.listen((p) { - if (p['startPopUp'] == 'true') { + if (p!['startPopUp'] == 'true') { if (this.mounted) { initSpeechState().then((value) => {onVoiceText()}); } @@ -67,7 +67,7 @@ class _PatientMakeInPatientReferralScreenState onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); - var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; + var lang = TranslationBase.of(AppGlobal.CONTEX)!.locale.languageCode; bool available = await speech.initialize( onStatus: statusListener, onError: errorListener); if (available) { @@ -121,22 +121,22 @@ class _PatientMakeInPatientReferralScreenState @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - bool isInpatient = routeArgs['isInpatient']; - referToList = List(); + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; + bool? isInpatient = routeArgs['isInpatient']; + referToList = []; dynamic sameBranch = { "id": 1, - "name": TranslationBase.of(context).sameBranch + "name": TranslationBase.of(context)!.sameBranch }; dynamic otherBranch = { "id": 2, - "name": TranslationBase.of(context).otherBranch + "name": TranslationBase.of(context)!.otherBranch }; - referToList.add(sameBranch); - referToList.add(otherBranch); + referToList!.add(sameBranch); + referToList!.add(otherBranch); final screenSize = MediaQuery.of(context).size; @@ -144,7 +144,7 @@ class _PatientMakeInPatientReferralScreenState onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context)!.referPatient, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, @@ -166,13 +166,13 @@ class _PatientMakeInPatientReferralScreenState crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).refer}", + "${TranslationBase.of(context)!.refer}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, ), AppText( - "${TranslationBase.of(context).patient}", + "${TranslationBase.of(context)!.patient}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, @@ -187,7 +187,7 @@ class _PatientMakeInPatientReferralScreenState children: [ AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).branch, + hintText: TranslationBase.of(context)!.branch, dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, @@ -199,7 +199,7 @@ class _PatientMakeInPatientReferralScreenState list: referToList, attributeName: 'name', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _referTo = selectedValue; @@ -246,7 +246,7 @@ class _PatientMakeInPatientReferralScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).hospital, + hintText: TranslationBase.of(context)!.hospital, dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null, @@ -254,7 +254,7 @@ class _PatientMakeInPatientReferralScreenState isTextFieldHasSuffix: true, validationError: hospitalError, onClick: model.branchesList != null && - model.branchesList.length > 0 && + model.branchesList!.length > 0 && _referTo != null && _referTo['id'] == 2 ? () { @@ -262,7 +262,7 @@ class _PatientMakeInPatientReferralScreenState list: model.branchesList, attributeName: 'facilityName', attributeValueId: 'facilityId', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() async { _selectedBranch = selectedValue; @@ -298,7 +298,7 @@ class _PatientMakeInPatientReferralScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).clinic, + hintText: TranslationBase.of(context)!.clinic, dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null, @@ -307,7 +307,7 @@ class _PatientMakeInPatientReferralScreenState validationError: clinicError, onClick: _selectedBranch != null && model.clinicsList != null && - model.clinicsList.length > 0 + model.clinicsList!.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( list: model.clinicsList, @@ -315,9 +315,9 @@ class _PatientMakeInPatientReferralScreenState attributeValueId: 'ClinicID', usingSearch: true, hintSearchText: - TranslationBase.of(context) + TranslationBase.of(context)! .clinicSearch, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() async { _selectedDoctor = null; @@ -326,7 +326,7 @@ class _PatientMakeInPatientReferralScreenState context); await model .getClinicDoctors( - patient, + patient!, _selectedClinic['ClinicID'], _selectedBranch['facilityId']) .then((_) => GifLoaderDialogUtils @@ -354,7 +354,7 @@ class _PatientMakeInPatientReferralScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).doctor, + hintText: TranslationBase.of(context)!.doctor, dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null, @@ -371,9 +371,9 @@ class _PatientMakeInPatientReferralScreenState attributeValueId: 'DoctorID', usingSearch: true, hintSearchText: - TranslationBase.of(context) + TranslationBase.of(context)! .doctorSearch, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _selectedDoctor = selectedValue; @@ -403,7 +403,7 @@ class _PatientMakeInPatientReferralScreenState height: 10, ), AppText( - "${TranslationBase.of(context).priority}", + "${TranslationBase.of(context)!.priority}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w600, @@ -416,7 +416,7 @@ class _PatientMakeInPatientReferralScreenState height: 10, ), AppText( - "${TranslationBase.of(context).replayBefore}: ${getPriority()}", + "${TranslationBase.of(context)!.replayBefore}: ${getPriority()}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 1.9, ), @@ -426,7 +426,7 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: - TranslationBase.of(context).referralFrequency, + TranslationBase.of(context)!.referralFrequency, dropDownText: _selectedFrequency != null ? _selectedFrequency['Description'] : null, @@ -439,9 +439,9 @@ class _PatientMakeInPatientReferralScreenState attributeName: 'Description', attributeValueId: 'ParameterCode', usingSearch: true, - hintSearchText: TranslationBase.of(context) + hintSearchText: TranslationBase.of(context)! .selectReferralFrequency, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _selectedFrequency = selectedValue; @@ -461,7 +461,7 @@ class _PatientMakeInPatientReferralScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).ext, + hintText: TranslationBase.of(context)!.ext, controller: _extController, inputType: TextInputType.text, ), @@ -508,7 +508,7 @@ class _PatientMakeInPatientReferralScreenState margin: EdgeInsets.all(5), child: Expanded( child: AppButton( - title: TranslationBase.of(context).clearText, + title: TranslationBase.of(context)!.clearText, onPressed: () { setState(() { _remarksController.text = ''; @@ -518,38 +518,38 @@ class _PatientMakeInPatientReferralScreenState Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: AppButton( - title: TranslationBase.of(context).refer, + title: TranslationBase.of(context)!.refer, fontWeight: FontWeight.w700, color: Color(0XFF359846), onPressed: () async { setState(() { if (_referTo == null) { branchError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { branchError = null; } if (_selectedBranch == null) { hospitalError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { hospitalError = null; } if (_selectedClinic == null) { clinicError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { clinicError = null; } if (_selectedDoctor == null) { doctorError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { doctorError = null; } if (_selectedFrequency == null) { frequencyError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { frequencyError = null; } @@ -562,7 +562,7 @@ class _PatientMakeInPatientReferralScreenState _extController.text == null) return; { await model.makeInPatientReferral( - patient: patient, + patient: patient!, projectID: _selectedBranch['facilityId'], clinicID: _selectedClinic['ClinicID'], doctorID: _selectedDoctor['DoctorID'], @@ -576,7 +576,7 @@ class _PatientMakeInPatientReferralScreenState DrAppToastMsg.showErrorToast(model.error); else { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) + TranslationBase.of(context)! .referralSuccessMsg); Navigator.pop(context); } @@ -596,9 +596,9 @@ class _PatientMakeInPatientReferralScreenState Widget priorityBar(BuildContext _context, Size screenSize) { List _priorities = [ - TranslationBase.of(context).veryUrgent.toUpperCase(), - TranslationBase.of(context).urgent.toUpperCase(), - TranslationBase.of(context).routine.toUpperCase(), + TranslationBase.of(context)!.veryUrgent!.toUpperCase(), + TranslationBase.of(context)!.urgent!.toUpperCase(), + TranslationBase.of(context)!.routine!.toUpperCase(), ]; return Container( height: screenSize.height * 0.070, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 6a25b9a1..f6daea75 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -26,19 +26,19 @@ class PatientMakeReferralScreen extends StatefulWidget { } class _PatientMakeReferralScreenState extends State { - PatiantInformtion patient; - List referToList; + PatiantInformtion? patient; + List? referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; dynamic _selectedDoctor; - DateTime appointmentDate; + DateTime? appointmentDate; final _remarksController = TextEditingController(); - String branchError = null; - String hospitalError = null; - String clinicError = null; - String doctorError = null; + String? branchError = null; + String? hospitalError = null; + String? clinicError = null; + String? doctorError = null; @override void initState() { @@ -49,30 +49,30 @@ class _PatientMakeReferralScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; - referToList = List(); + referToList = []; dynamic sameBranch = { "id": 1, - "name": TranslationBase.of(context).sameBranch + "name": TranslationBase.of(context)!.sameBranch }; dynamic otherBranch = { "id": 2, - "name": TranslationBase.of(context).otherBranch + "name": TranslationBase.of(context)!.otherBranch }; - referToList.add(sameBranch); - referToList.add(otherBranch); + referToList!.add(sameBranch); + referToList!.add(otherBranch); final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getPatientReferral(patient), + onModelReady: (model) => model.getPatientReferral(patient!), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context)!.referPatient, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), @@ -92,13 +92,13 @@ class _PatientMakeReferralScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).refer}", + "${TranslationBase.of(context)!.refer}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, ), AppText( - "${TranslationBase.of(context).patient}", + "${TranslationBase.of(context)!.patient}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, @@ -120,17 +120,17 @@ class _PatientMakeReferralScreenState extends State { patientGender: model .patientReferral[ model.patientReferral.length - 1] - .patientDetails + .patientDetails! .gender, referredDate: model .patientReferral[ model.patientReferral.length - 1] - .referredOn + .referredOn! .split(" ")[0], referredTime: model .patientReferral[ model.patientReferral.length - 1] - .referredOn + .referredOn! .split(" ")[1], patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", @@ -146,7 +146,7 @@ class _PatientMakeReferralScreenState extends State { nationality: model .patientReferral[ model.patientReferral.length - 1] - .patientDetails + .patientDetails! .nationalityName, nationalityFlag: model .patientReferral[ @@ -168,32 +168,32 @@ class _PatientMakeReferralScreenState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: AppButton( - title: TranslationBase.of(context).refer, + title: TranslationBase.of(context)!.refer, fontWeight: FontWeight.w700, color: HexColor("#359846"), onPressed: () { setState(() { if (_referTo == null) { branchError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { branchError = null; } if (_selectedBranch == null) { hospitalError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { hospitalError = null; } if (_selectedClinic == null) { clinicError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { clinicError = null; } if (_selectedDoctor == null) { doctorError = - TranslationBase.of(context).fieldRequired; + TranslationBase.of(context)!.fieldRequired; } else { doctorError = null; } @@ -205,15 +205,15 @@ class _PatientMakeReferralScreenState extends State { _remarksController.text == null) return; model .makeReferral( - patient, - appointmentDate.toIso8601String(), + patient!, + appointmentDate!.toIso8601String(), _selectedBranch['facilityId'], _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text) .then((_) { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).referralSuccessMsg); + TranslationBase.of(context)!.referralSuccessMsg); Navigator.pop(context); }); }, @@ -235,7 +235,7 @@ class _PatientMakeReferralScreenState extends State { children: [ AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).branch, + hintText: TranslationBase.of(context)!.branch, dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, isTextFieldHasSuffix: true, @@ -246,7 +246,7 @@ class _PatientMakeReferralScreenState extends State { list: referToList, attributeName: 'name', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _referTo = selectedValue; @@ -286,7 +286,7 @@ class _PatientMakeReferralScreenState extends State { ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).hospital, + hintText: TranslationBase.of(context)!.hospital, dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null, @@ -294,7 +294,7 @@ class _PatientMakeReferralScreenState extends State { isTextFieldHasSuffix: true, validationError: hospitalError, onClick: model.branchesList != null && - model.branchesList.length > 0 && + model.branchesList!.length > 0 && _referTo != null && _referTo['id'] == 2 ? () { @@ -302,7 +302,7 @@ class _PatientMakeReferralScreenState extends State { list: model.branchesList, attributeName: 'facilityName', attributeValueId: 'facilityId', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() async { _selectedBranch = selectedValue; @@ -334,7 +334,7 @@ class _PatientMakeReferralScreenState extends State { ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).clinic, + hintText: TranslationBase.of(context)!.clinic, dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null, @@ -343,15 +343,15 @@ class _PatientMakeReferralScreenState extends State { validationError: clinicError, onClick: _selectedBranch != null && model.clinicsList != null && - model.clinicsList.length > 0 + model.clinicsList!.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( list: model.clinicsList, attributeName: 'ClinicDescription', attributeValueId: 'ClinicID', usingSearch: true, - hintSearchText: TranslationBase.of(context).clinicSearch, - okText: TranslationBase.of(context).ok, + hintSearchText: TranslationBase.of(context)!.clinicSearch, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() async { _selectedDoctor = null; @@ -359,7 +359,7 @@ class _PatientMakeReferralScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); await model .getClinicDoctors( - patient, + patient!, _selectedClinic['ClinicID'], _selectedBranch['facilityId']) .then((_) => @@ -385,7 +385,7 @@ class _PatientMakeReferralScreenState extends State { ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).doctor, + hintText: TranslationBase.of(context)!.doctor, dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null, enabled: false, @@ -400,8 +400,8 @@ class _PatientMakeReferralScreenState extends State { attributeName: 'Name', attributeValueId: 'DoctorID', usingSearch: true, - hintSearchText: TranslationBase.of(context).doctorSearch, - okText: TranslationBase.of(context).ok, + hintSearchText: TranslationBase.of(context)!.doctorSearch, + okText: TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _selectedDoctor = selectedValue; @@ -432,13 +432,14 @@ class _PatientMakeReferralScreenState extends State { ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).date, + hintText: TranslationBase.of(context)!.date, dropDownText: appointmentDate != null - ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" + ? "${AppDateUtils.convertDateToFormat(appointmentDate!, "yyyy-MM-dd")}" : null, enabled: false, isTextFieldHasSuffix: true, suffixIcon: IconButton( + onPressed: null, icon: Icon( Icons.calendar_today, color: Colors.black, @@ -451,7 +452,7 @@ class _PatientMakeReferralScreenState extends State { height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).dietTypeRemarks, + hintText: TranslationBase.of(context)!.dietTypeRemarks, controller: _remarksController, inputType: TextInputType.multiline, minLines: 4, @@ -465,9 +466,9 @@ class _PatientMakeReferralScreenState extends State { _selectDate(BuildContext context, PatientReferralViewModel model) async { // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://stackoverflow.com/a/63147062/6246772 to customize a date picker - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, - initialDate: appointmentDate, + initialDate: appointmentDate!, firstDate: DateTime.now().add(Duration(hours: 2)), lastDate: DateTime(2040), initialEntryMode: DatePickerEntryMode.calendar, diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index a949036b..fdc5b1a8 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -129,7 +129,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { height: 20, ), AppText( - TranslationBase.of(context).viewProfile, + TranslationBase.of(context)!.viewProfile, fontWeight: FontWeight.w700, fontSize: 1.7 * SizeConfig.textMultiplier, color: Colors.red[700], @@ -177,7 +177,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -197,7 +197,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getTimeHHMMA( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -219,7 +219,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).refClinic}: ", + "${TranslationBase.of(context)!.refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * @@ -244,8 +244,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + + TranslationBase.of(context)! + .frequency! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -288,13 +288,13 @@ class ReferralPatientDetailScreen extends StatelessWidget { BorderRadius.circular(20.0), child: Image.network( referredPatient - .nationalityFlagURL, + .nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -308,7 +308,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + + TranslationBase.of(context)!.priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -332,8 +332,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + + TranslationBase.of(context)! + .maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -380,13 +380,13 @@ class ReferralPatientDetailScreen extends StatelessWidget { borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -412,7 +412,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", + "${TranslationBase.of(context)!.dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * @@ -462,7 +462,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks, + TranslationBase.of(context)!.remarks, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 2.4 * SizeConfig.textMultiplier, @@ -486,7 +486,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( - title: TranslationBase.of(context).replay, + title: TranslationBase.of(context)!.replay, color: Colors.red[700], fontColor: Colors.white, fontWeight: FontWeight.w700, diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index dc2bf798..ce4a7ffe 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -19,7 +19,7 @@ class ReferredPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referredPatient, + appBarTitle: TranslationBase.of(context)!.referredPatient, body: model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 ? Center( @@ -33,7 +33,7 @@ class ReferredPatientScreen extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - TranslationBase.of(context).referralEmptyMsg, + TranslationBase.of(context)!.referralEmptyMsg, color: Theme.of(context).errorColor, ), ) @@ -103,7 +103,7 @@ class ReferredPatientScreen extends StatelessWidget { .getReferredPatientItem(index) .doctorImageURL, referralDoctorName: - "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + "${TranslationBase.of(context)!.dr} ${model.getReferredPatientItem(index).referralDoctorName}", clinicDescription: model .getReferredPatientItem(index) .referralClinicDescription, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index b4e1ddc5..d098628b 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -127,7 +127,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { height: 20, ), AppText( - TranslationBase.of(context).viewProfile, + TranslationBase.of(context)!.viewProfile, fontWeight: FontWeight.w700, fontSize: 1.7 * SizeConfig.textMultiplier, color: Colors.red[700], @@ -176,7 +176,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -217,7 +217,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).refClinic}: ", + "${TranslationBase.of(context)!.refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * @@ -243,8 +243,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + + TranslationBase.of(context)! + .frequency! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -286,13 +286,13 @@ class ReferredPatientDetailScreen extends StatelessWidget { BorderRadius.circular(20.0), child: Image.network( referredPatient - .nationalityFlagURL, + .nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -306,7 +306,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + + TranslationBase.of(context)!.priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -327,8 +327,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + + TranslationBase.of(context)! + .maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -375,13 +375,13 @@ class ReferredPatientDetailScreen extends StatelessWidget { borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -407,7 +407,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", + "${TranslationBase.of(context)!.dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * @@ -457,7 +457,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks, + TranslationBase.of(context)!.remarks, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 2.4 * SizeConfig.textMultiplier, @@ -484,12 +484,12 @@ class ReferredPatientDetailScreen extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -507,7 +507,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).reply, + TranslationBase.of(context)!.reply, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -515,9 +515,9 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( referredPatient - .referredDoctorRemarks.isNotEmpty + .referredDoctorRemarks!.isNotEmpty ? referredPatient.referredDoctorRemarks - : TranslationBase.of(context).notRepliedYet, + : TranslationBase.of(context)!.notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -536,14 +536,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( - title: TranslationBase.of(context).acknowledged, + title: TranslationBase.of(context)!.acknowledged, color: Colors.red[700], fontColor: Colors.white, fontWeight: FontWeight.w700, fontSize: 1.8, hPadding: 8, vPadding: 12, - disabled: referredPatient.referredDoctorRemarks.isNotEmpty + disabled: referredPatient.referredDoctorRemarks!.isNotEmpty ? false : true, onPressed: () async { diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index a30842f8..b4d8bba1 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -26,14 +26,14 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddAssessmentDetails extends StatefulWidget { - final MySelectedAssessment mySelectedAssessment; - final List mySelectedAssessmentList; - final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) + final MySelectedAssessment? mySelectedAssessment; + final List? mySelectedAssessmentList; + final Function(MySelectedAssessment? mySelectedAssessment, bool isUpdate)? addSelectedAssessment; - final PatiantInformtion patientInfo; - final bool isUpdate; + final PatiantInformtion? patientInfo; + final bool? isUpdate; AddAssessmentDetails( - {Key key, + {Key? key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, @@ -58,24 +58,24 @@ class _AddAssessmentDetailsState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - remarkController.text = widget.mySelectedAssessment.remark ?? ""; + remarkController.text = widget.mySelectedAssessment!.remark ?? ""; appointmentIdController.text = - widget.mySelectedAssessment.appointmentId.toString(); - if (widget.isUpdate) { - if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) + widget.mySelectedAssessment!.appointmentId.toString(); + if (widget.isUpdate!) { + if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null) conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr - : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; - if (widget.mySelectedAssessment.selectedDiagnosisType != null) + ? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr! + : widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!; + if (widget.mySelectedAssessment!.selectedDiagnosisType != null) typeController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr - : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; - if (widget.mySelectedAssessment.selectedICD != null) - icdNameController.text = widget.mySelectedAssessment.selectedICD.code; + ? widget.mySelectedAssessment!.selectedDiagnosisType!.nameAr! + : widget.mySelectedAssessment!.selectedDiagnosisType!.nameEn!; + if (widget.mySelectedAssessment!.selectedICD != null) + icdNameController.text = widget.mySelectedAssessment!.selectedICD!.code; } InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {IconData icon, String validationError}) { + {IconData? icon, String? validationError}) { return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), @@ -136,7 +136,7 @@ class _AddAssessmentDetailsState extends State { child: Column( children: [ BottomSheetTitle( - title: TranslationBase.of(context).addAssessmentDetails), + title: TranslationBase.of(context)!.addAssessmentDetails), FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -151,7 +151,7 @@ class _AddAssessmentDetailsState extends State { child: AppTextFieldCustom( // height: 55.0, hintText: - TranslationBase.of(context).appointmentNumber, + TranslationBase.of(context)!.appointmentNumber, isTextFieldHasSuffix: false, enabled: false, controller: appointmentIdController, @@ -165,36 +165,36 @@ class _AddAssessmentDetailsState extends State { onTap: model.listOfICD10 != null ? () { setState(() { - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedICD = null; - icdNameController.text = null; + icdNameController.text = ''; }); } : null, child: widget - .mySelectedAssessment.selectedICD == + .mySelectedAssessment!.selectedICD == null ? CustomAutoCompleteTextField( isShowError: isFormSubmitted && - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedICD == null, child: AutoCompleteTextField< MasterKeyModel>( decoration: TextFieldsUtils .textFieldSelectorDecoration( - TranslationBase.of(context) + TranslationBase.of(context)! .nameOrICD, null, true, suffixIcon: Icons.search), itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedICD = item; icdNameController.text = '${item.code.trim()}/${item.description}'; }), - key: key, + key: key as GlobalKey>, suggestions: model.listOfICD10, itemBuilder: (context, suggestion) => new Padding( @@ -224,13 +224,13 @@ class _AddAssessmentDetailsState extends State { onClick: model.listOfICD10 != null ? () { setState(() { - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedICD = null; - icdNameController.text = null; + icdNameController.text = ''; }); } : null, - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context)! .nameOrICD, maxLines: 2, minLines: 1, @@ -238,6 +238,7 @@ class _AddAssessmentDetailsState extends State { enabled: true, isTextFieldHasSuffix: true, suffixIcon: IconButton( + onPressed: null, icon: Icon( Icons.search, color: Colors.grey.shade600, @@ -252,24 +253,24 @@ class _AddAssessmentDetailsState extends State { ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisCondition, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (MasterKeyModel selectedValue) { setState(() { - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedDiagnosisCondition = selectedValue; conditionController .text = projectViewModel .isArabic ? widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameAr + .mySelectedAssessment! + .selectedDiagnosisCondition! + .nameAr! : widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameEn; + .mySelectedAssessment! + .selectedDiagnosisCondition! + .nameEn!; }); }, ); @@ -282,7 +283,7 @@ class _AddAssessmentDetailsState extends State { ); } : null, - hintText: TranslationBase.of(context).condition, + hintText: TranslationBase.of(context)!.condition, maxLines: 2, minLines: 1, controller: conditionController, @@ -290,10 +291,10 @@ class _AddAssessmentDetailsState extends State { enabled: false, hasBorder: true, validationError: isFormSubmitted && - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedDiagnosisCondition == null - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), SizedBox( @@ -304,17 +305,17 @@ class _AddAssessmentDetailsState extends State { ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisType, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context)!.ok, okFunction: (MasterKeyModel selectedValue) { setState(() { - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedDiagnosisType = selectedValue; typeController.text = projectViewModel.isArabic - ? selectedValue.nameAr - : selectedValue.nameEn; + ? selectedValue.nameAr! + : selectedValue.nameEn!; }); }, ); @@ -327,7 +328,7 @@ class _AddAssessmentDetailsState extends State { ); } : null, - hintText: TranslationBase.of(context).dType, + hintText: TranslationBase.of(context)!.dType, maxLines: 2, minLines: 1, enabled: false, @@ -335,10 +336,10 @@ class _AddAssessmentDetailsState extends State { controller: typeController, hasBorder: true, validationError: isFormSubmitted && - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedDiagnosisType == null - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), SizedBox( @@ -347,13 +348,13 @@ class _AddAssessmentDetailsState extends State { Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: AppTextFieldCustom( - hintText: TranslationBase.of(context).remarks, + hintText: TranslationBase.of(context)!.remarks, maxLines: 18, minLines: 5, inputType: TextInputType.multiline, controller: remarkController, onChanged: (value) { - widget.mySelectedAssessment.remark = + widget.mySelectedAssessment!.remark = remarkController.text; }, ), @@ -389,7 +390,7 @@ class _AddAssessmentDetailsState extends State { child: AppButton( fontWeight: FontWeight.w700, color: Colors.green, - title: (widget.isUpdate + title: (widget.isUpdate! ? 'Update Assessment Details' : 'Add Assessment Details'), loading: model.state == ViewState.BusyLocal, @@ -397,19 +398,19 @@ class _AddAssessmentDetailsState extends State { setState(() { isFormSubmitted = true; }); - widget.mySelectedAssessment.remark = + widget.mySelectedAssessment!.remark = remarkController.text; - widget.mySelectedAssessment.appointmentId = + widget.mySelectedAssessment!.appointmentId = int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment + if (widget.mySelectedAssessment! .selectedDiagnosisCondition != null && - widget.mySelectedAssessment + widget.mySelectedAssessment! .selectedDiagnosisType != null && - widget.mySelectedAssessment.selectedICD != null) { + widget.mySelectedAssessment!.selectedICD != null) { await submitAssessment( - isUpdate: widget.isUpdate, + isUpdate: widget.isUpdate!, model: model, mySelectedAssessment: widget.mySelectedAssessment); @@ -431,35 +432,35 @@ class _AddAssessmentDetailsState extends State { } submitAssessment( - {SOAPViewModel model, - MySelectedAssessment mySelectedAssessment, + {required SOAPViewModel model, + MySelectedAssessment? mySelectedAssessment, bool isUpdate = false}) async { if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: mySelectedAssessment.remark, + patientMRN: widget.patientInfo!.patientMRN, + episodeID: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, + remarks: mySelectedAssessment!.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code, + conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, + icdcode10Id: mySelectedAssessment.selectedICD!.code, prevIcdCode10ID: mySelectedAssessment.icdCode10ID); await model.patchAssessment(patchAssessmentReqModel); } else { PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo!.patientMRN, + episodeId: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, icdCodeDetails: [ new IcdCodeDetails( - remarks: mySelectedAssessment.remark, + remarks: mySelectedAssessment!.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code) + conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, + icdcode10Id: mySelectedAssessment.selectedICD!.code) ]); await model.postAssessment(postAssessmentRequestModel); @@ -470,12 +471,12 @@ class _AddAssessmentDetailsState extends State { } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile as Map); + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; if (!isUpdate) { - widget.addSelectedAssessment(mySelectedAssessment, isUpdate); + widget.addSelectedAssessment!(mySelectedAssessment, isUpdate); } Navigator.of(context).pop(); } diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 4f48ff27..e711fbb4 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -25,13 +25,13 @@ import 'add_assessment_details.dart'; // ignore: must_be_immutable class UpdateAssessmentPage extends StatefulWidget { - final Function changePageViewIndex; - List mySelectedAssessmentList; - final PatiantInformtion patientInfo; - final Function changeLoadingState; - final int currentIndex; + final Function? changePageViewIndex; + List? mySelectedAssessmentList; + final PatiantInformtion? patientInfo; + final Function? changeLoadingState; + final int? currentIndex; UpdateAssessmentPage( - {Key key, + {Key? key, this.changePageViewIndex, this.mySelectedAssessmentList, this.patientInfo, @@ -49,13 +49,13 @@ class _UpdateAssessmentPageState extends State { return BaseView( onModelReady: (model) async { - widget.mySelectedAssessmentList.clear(); + widget.mySelectedAssessmentList!.clear(); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), + patientMRN: widget.patientInfo!.patientMRN, + episodeID: widget.patientInfo!.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: widget.patientInfo.appointmentNo); + appointmentNo: widget.patientInfo!.appointmentNo); await model.getPatientAssessment(getAssessmentReqModel); if (model.patientAssessmentList.isNotEmpty) { if (model.listOfDiagnosisCondition.length == 0) { @@ -96,12 +96,12 @@ class _UpdateAssessmentPageState extends State { createdOn: element.createdOn, icdCode10ID: element.icdCode10ID); - widget.mySelectedAssessmentList.add(temMySelectedAssessment); + widget.mySelectedAssessmentList!.add(temMySelectedAssessment); } }); } - widget.changeLoadingState(false); + widget.changeLoadingState!(false); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, @@ -124,7 +124,7 @@ class _UpdateAssessmentPageState extends State { SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).assessment + headerTitle: TranslationBase.of(context)!.assessment , onTap: () { setState(() { @@ -138,7 +138,7 @@ class _UpdateAssessmentPageState extends State { Column( children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addAssessment}",onTap: () { + SOAPOpenItems(label: "${TranslationBase.of(context)!.addAssessment}",onTap: () { openAssessmentDialog(context, isUpdate: false, model: model); },), @@ -147,7 +147,7 @@ class _UpdateAssessmentPageState extends State { height: 20, ), Column( - children: widget.mySelectedAssessmentList + children: widget.mySelectedAssessmentList! .map((assessment) { return Container( margin: EdgeInsets.only( @@ -175,7 +175,7 @@ class _UpdateAssessmentPageState extends State { ), new TextSpan( text: assessment - .selectedICD.code + .selectedICD!.code .trim() .toUpperCase() ?? "", @@ -199,7 +199,7 @@ class _UpdateAssessmentPageState extends State { children: [ new TextSpan( text: assessment - .selectedICD.description + .selectedICD!.description .toString(), ), ], @@ -216,7 +216,7 @@ class _UpdateAssessmentPageState extends State { children: [ new TextSpan( text: TranslationBase.of( - context) + context)! .appointmentNo, style: new TextStyle( color: Color(0xFF575757), @@ -246,8 +246,8 @@ class _UpdateAssessmentPageState extends State { children: [ new TextSpan( text: TranslationBase.of( - context) - .condition + + context)! + .condition! + " : ", style: new TextStyle( color: Color(0xFF575757), @@ -257,10 +257,10 @@ class _UpdateAssessmentPageState extends State { text: projectViewModel .isArabic ? assessment - .selectedDiagnosisCondition + .selectedDiagnosisCondition! .nameAr : assessment - .selectedDiagnosisCondition + .selectedDiagnosisCondition! .nameEn, style: new TextStyle( fontSize: 14, @@ -280,8 +280,8 @@ class _UpdateAssessmentPageState extends State { children: [ new TextSpan( text: TranslationBase.of( - context) - .dType + + context)! + .dType! + ' : ', style: new TextStyle( color: Color(0xFF575757), @@ -291,10 +291,10 @@ class _UpdateAssessmentPageState extends State { text: projectViewModel .isArabic ? assessment - .selectedDiagnosisType + .selectedDiagnosisType! .nameAr : assessment - .selectedDiagnosisType + .selectedDiagnosisType! .nameEn, style: new TextStyle( fontSize: 14, @@ -316,8 +316,8 @@ class _UpdateAssessmentPageState extends State { children: [ new TextSpan( text: TranslationBase.of( - context) - .doc + + context)! + .doc! + ' : ', style: new TextStyle( color: Color(0xFF575757), @@ -352,8 +352,8 @@ class _UpdateAssessmentPageState extends State { assessment.remark != '') ? TranslationBase.of( - context) - .remarks + + context)! + .remarks! + " : " : '', @@ -393,7 +393,7 @@ class _UpdateAssessmentPageState extends State { .getDayMonthYearDateFormatted( DateTime.parse( assessment - .createdOn)) + .createdOn!)) : AppDateUtils .getDayMonthYearDateFormatted( DateTime.now()), @@ -405,7 +405,7 @@ class _UpdateAssessmentPageState extends State { ? AppDateUtils.getHour( DateTime.parse( assessment - .createdOn)) + .createdOn!)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight @@ -479,14 +479,14 @@ class _UpdateAssessmentPageState extends State { Expanded( child: AppButton( title: TranslationBase - .of(context) + .of(context)! .previous, color: Colors.grey[300], fontColor: Colors.black, fontWeight: FontWeight.w600, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - widget.changePageViewIndex(1); + widget.changePageViewIndex!(1); }, ) , @@ -495,20 +495,20 @@ class _UpdateAssessmentPageState extends State { Expanded( child: AppButton( title: TranslationBase - .of(context) + .of(context)! .next, fontWeight: FontWeight.w600, color: Colors.red[700], disabled: model.state == ViewState.BusyLocal, onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { + if (widget.mySelectedAssessmentList!.isEmpty) { Helpers.showErrorToast( TranslationBase - .of(context) + .of(context)! .assessmentErrorMsg); } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); + widget.changePageViewIndex!(3); + widget.changeLoadingState!(true); } }, ), @@ -528,10 +528,10 @@ class _UpdateAssessmentPageState extends State { } openAssessmentDialog(BuildContext context, - {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { + {MySelectedAssessment? assessment, bool? isUpdate, SOAPViewModel? model}) { if (assessment == null) { assessment = MySelectedAssessment( - remark: '', appointmentId: widget.patientInfo.appointmentNo); + remark: '', appointmentId: widget.patientInfo!.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -546,7 +546,7 @@ class _UpdateAssessmentPageState extends State { addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { - widget.mySelectedAssessmentList.add(mySelectedAssessment); + widget.mySelectedAssessmentList!.add(mySelectedAssessment); }); }); }); diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index d98e17be..04949f28 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -14,9 +14,9 @@ import 'package:hexcolor/hexcolor.dart'; import 'examinations_list_search_widget.dart'; class AddExaminationPage extends StatefulWidget { - final List mySelectedExamination; - final Function addSelectedExamination; - final Function(MasterKeyModel) removeExamination; + final List? mySelectedExamination; + final Function? addSelectedExamination; + final Function(MasterKeyModel)? removeExamination; AddExaminationPage( {this.mySelectedExamination, @@ -53,7 +53,7 @@ class _AddExaminationPageState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).addExamination}", + "${TranslationBase.of(context)!.addExamination}", fontSize: SizeConfig.textMultiplier * 3.3, color: Colors.black, fontWeight: FontWeight.w700, @@ -95,12 +95,12 @@ class _AddExaminationPageState extends State { isServiceSelected(master), removeHistory: (history) { setState(() { - widget.removeExamination(history); + widget.removeExamination!(history); }); }, addHistory: (selectedExamination) { setState(() { - widget.mySelectedExamination + widget.mySelectedExamination! .add(selectedExamination); }); }, @@ -135,11 +135,11 @@ class _AddExaminationPageState extends State { child: Center( child: AppButton( title: - "${TranslationBase.of(context).addExamination}", + "${TranslationBase.of(context)!.addExamination}", padding: 10, color: Color(0xFF359846), onPressed: () { - widget.addSelectedExamination(); + widget.addSelectedExamination!(); }, ), ), @@ -155,10 +155,10 @@ class _AddExaminationPageState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = widget.mySelectedExamination.where( + Iterable exam = widget.mySelectedExamination!.where( (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + masterKey.id == element.selectedExamination!.id && + masterKey.typeId == element.selectedExamination!.typeId); if (exam.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index e990be79..c37ca5ca 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -13,12 +13,12 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class AddExaminationWidget extends StatefulWidget { - MasterKeyModel item; - final Function(MasterKeyModel) removeHistory; - final Function(MySelectedExamination) addHistory; - final bool Function(MasterKeyModel) isServiceSelected; - bool isExpand; - final Function expandClick; + MasterKeyModel? item; + final Function(MasterKeyModel?)? removeHistory; + final Function(MySelectedExamination)? addHistory; + final bool Function(MasterKeyModel?)? isServiceSelected; + bool? isExpand; + final Function? expandClick; AddExaminationWidget({ this.item, @@ -57,28 +57,28 @@ class _AddExaminationWidgetState extends State { child: CheckboxListTile( title: AppText( projectViewModel.isArabic - ? widget.item.nameAr != null && widget.item.nameAr != "" - ? widget.item.nameAr - : widget.item.nameEn - : widget.item.nameEn, + ? widget.item!.nameAr != null && widget.item!.nameAr != "" + ? widget.item!.nameAr + : widget.item!.nameEn + : widget.item!.nameEn, fontWeight: FontWeight.normal, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.0, ), - value: widget.isServiceSelected(widget.item), + value: widget.isServiceSelected!(widget.item), activeColor: HexColor("#D02127"), onChanged: (newValue) { setState(() { - if (widget.isServiceSelected(widget.item)) { - widget.removeHistory(widget.item); - widget.expandClick(); + if (widget.isServiceSelected!(widget.item)) { + widget.removeHistory!(widget.item); + widget.expandClick!(); } else { examination.isNormal = status == 1; examination.isAbnormal = status == 2; examination.notExamined = status == 3; examination.remark = remarksController.text; - widget.addHistory(examination); - widget.expandClick(); + widget.addHistory!(examination); + widget.expandClick!(); } }); }, @@ -89,8 +89,8 @@ class _AddExaminationWidgetState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 8), child: InkWell( - onTap: widget.expandClick, - child: Icon(widget.isExpand + onTap: widget.expandClick as void Function()?, + child: Icon(widget.isExpand! ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), ), @@ -104,7 +104,7 @@ class _AddExaminationWidgetState extends State { Container( margin: EdgeInsets.only(bottom: 8), child: AppText( - TranslationBase.of(context).status, + TranslationBase.of(context)!.status, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, @@ -145,7 +145,7 @@ class _AddExaminationWidgetState extends State { ), ), AppText( - TranslationBase.of(context).normal, + TranslationBase.of(context)!.normal, fontWeight: FontWeight.normal, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, @@ -185,7 +185,7 @@ class _AddExaminationWidgetState extends State { ), ), AppText( - TranslationBase.of(context).abnormal, + TranslationBase.of(context)!.abnormal, fontWeight: FontWeight.normal, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, @@ -226,7 +226,7 @@ class _AddExaminationWidgetState extends State { ), Expanded( child: AppText( - TranslationBase.of(context).notExamined, + TranslationBase.of(context)!.notExamined, fontWeight: FontWeight.normal, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, @@ -239,7 +239,7 @@ class _AddExaminationWidgetState extends State { Container( margin: EdgeInsets.only(top: 8), child: AppTextFieldCustom( - hintText: TranslationBase.of(context).remarks, + hintText: TranslationBase.of(context)!.remarks, controller: remarksController, minLines: 2, maxLines: 4, diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index d40faea5..fb530bfe 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -29,11 +29,11 @@ class ExaminationItemCard extends StatelessWidget { child: Container( child: AppText( projectViewModel.isArabic - ? examination.selectedExamination.nameAr != null && - examination.selectedExamination.nameAr != "" - ? examination.selectedExamination.nameAr - : examination.selectedExamination.nameEn - : examination.selectedExamination.nameEn, + ? examination.selectedExamination!.nameAr != null && + examination.selectedExamination!.nameAr != "" + ? examination.selectedExamination!.nameAr + : examination.selectedExamination!.nameEn + : examination.selectedExamination!.nameEn, fontWeight: FontWeight.w600, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -43,14 +43,14 @@ class ExaminationItemCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).remove, + TranslationBase.of(context)!.remove, fontWeight: FontWeight.w600, fontFamily: 'Poppins', color: Colors.red.shade800, fontSize: SizeConfig.textMultiplier * 1.8, ), InkWell( - onTap: removeExamination, + onTap: removeExamination as void Function()?, child: Icon( Icons.clear, size: 20, @@ -62,15 +62,15 @@ class ExaminationItemCard extends StatelessWidget { ], ), AppText( - !examination.isNormal - ? examination.isAbnormal - ? TranslationBase.of(context).abnormal - : TranslationBase.of(context).notExamined - : TranslationBase.of(context).normal, + !examination.isNormal! + ? examination.isAbnormal! + ? TranslationBase.of(context)!.abnormal + : TranslationBase.of(context)!.notExamined + : TranslationBase.of(context)!.normal, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - color: !examination.isNormal - ? examination.isAbnormal + color: !examination.isNormal! + ? examination.isAbnormal! ? Colors.red.shade800 : Colors.grey.shade800 : Colors.green.shade800, diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index 36b65d4c..847cb02c 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -8,10 +8,10 @@ import 'package:flutter/material.dart'; import 'add_examination_widget.dart'; class ExaminationsListSearchWidget extends StatefulWidget { - final Function(MasterKeyModel) removeHistory; - final Function(MySelectedExamination) addHistory; - final bool Function(MasterKeyModel) isServiceSelected; - final List masterList; + final Function(MasterKeyModel)? removeHistory; + final Function(MySelectedExamination)? addHistory; + final bool Function(MasterKeyModel)? isServiceSelected; + final List? masterList; ExaminationsListSearchWidget( {this.removeHistory, @@ -27,12 +27,12 @@ class ExaminationsListSearchWidget extends StatefulWidget { class _ExaminationsListSearchWidgetState extends State { int expandedIndex = -1; - List items = List(); + List items = []; TextEditingController filteredSearchController = TextEditingController(); @override void initState() { - items.addAll(widget.masterList); + items.addAll(widget.masterList!); super.initState(); } @@ -42,7 +42,7 @@ class _ExaminationsListSearchWidgetState children: [ AppTextFieldCustom( height: MediaQuery.of(context).size.height * 0.080, - hintText: TranslationBase.of(context).searchExamination, + hintText: TranslationBase.of(context)!.searchExamination, isTextFieldHasSuffix: true, hasBorder: false, controller: filteredSearchController, @@ -50,6 +50,7 @@ class _ExaminationsListSearchWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: null, icon: Icon( Icons.search, color: Colors.black, @@ -81,13 +82,13 @@ class _ExaminationsListSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); - dummySearchList.addAll(widget.masterList); + List dummySearchList = []; + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || - item.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || + item.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -99,7 +100,7 @@ class _ExaminationsListSearchWidgetState } else { setState(() { items.clear(); - items.addAll(widget.masterList); + items.addAll(widget.masterList!); }); } } diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 8fdfffc2..9a9cd1f1 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -25,14 +25,14 @@ import 'add_examination_page.dart'; import 'examination_item_card.dart'; class UpdateObjectivePage extends StatefulWidget { - final Function changePageViewIndex; - final Function changeLoadingState; - final int currentIndex; - final List mySelectedExamination; - final PatiantInformtion patientInfo; + final Function? changePageViewIndex; + final Function? changeLoadingState; + final int? currentIndex; + final List? mySelectedExamination; + final PatiantInformtion? patientInfo; UpdateObjectivePage( - {Key key, + {Key? key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo, @@ -62,12 +62,12 @@ class _UpdateObjectivePageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - widget.mySelectedExamination.clear(); + widget.mySelectedExamination!.clear(); GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); + patientMRN: widget.patientInfo!.patientMRN, + episodeID: widget.patientInfo!.episodeNo.toString(), + appointmentNo: widget.patientInfo!.appointmentNo); await model.getPatientPhysicalExam(getPhysicalExamReqModel); if (model.patientPhysicalExamList.isNotEmpty) { @@ -88,11 +88,11 @@ class _UpdateObjectivePageState extends State { notExamined: element.notExamined, isNew: element.isNew, isAbnormal: element.isAbnormal); - widget.mySelectedExamination.add(tempEam); + widget.mySelectedExamination!.add(tempEam); }); } - widget.changeLoadingState(false); + widget.changeLoadingState!(false); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, @@ -109,7 +109,7 @@ class _UpdateObjectivePageState extends State { changePageViewIndex: widget.changePageViewIndex), ExpandableSOAPWidget( headerTitle: - TranslationBase.of(context).physicalSystemExamination, + TranslationBase.of(context)!.physicalSystemExamination, onTap: () { setState(() { isSysExaminationExpand = !isSysExaminationExpand; @@ -117,12 +117,12 @@ class _UpdateObjectivePageState extends State { }, child: Column( children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addExamination}",onTap: () { + SOAPOpenItems(label: "${TranslationBase.of(context)!.addExamination}",onTap: () { openExaminationList(context); },), Column( children: - widget.mySelectedExamination.map((examination) { + widget.mySelectedExamination!.map((examination) { return ExaminationItemCard(examination, () { removeExamination( examination.selectedExamination); @@ -169,12 +169,12 @@ class _UpdateObjectivePageState extends State { children: [ Expanded( child: AppButton( - title: TranslationBase.of(context).previous, + title: TranslationBase.of(context)!.previous, color: Colors.grey[300], fontColor: Colors.black, fontWeight: FontWeight.w600, onPressed: () { - widget.changePageViewIndex(0); + widget.changePageViewIndex!(0); }, ) , @@ -183,7 +183,7 @@ class _UpdateObjectivePageState extends State { Expanded( child: AppButton( title: TranslationBase - .of(context) + .of(context)! .next, fontWeight: FontWeight.w600, color: Colors.red[700], @@ -209,41 +209,41 @@ class _UpdateObjectivePageState extends State { } submitUpdateObjectivePage(SOAPViewModel model) async { - if (widget.mySelectedExamination.isNotEmpty) { + if (widget.mySelectedExamination!.isNotEmpty) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile as Map); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); - widget.mySelectedExamination.forEach((exam) { + widget.mySelectedExamination!.forEach((exam) { if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM! .add(ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo!.patientMRN, + episodeId: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, remarks: exam.remark ?? '', createdBy: exam.createdBy ?? doctorProfile.doctorID, createdOn: DateTime.now().toIso8601String(), editedBy: doctorProfile.doctorID, editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, + examId: exam.selectedExamination!.id, + examType: exam.selectedExamination!.typeId, isAbnormal: exam.isAbnormal, isNormal: exam.isNormal, notExamined: exam.notExamined, - examinationType: exam.isNormal + examinationType: exam.isNormal! ? 1 - : exam.isAbnormal + : exam.isAbnormal! ? 2 : 3, - examinationTypeName: exam.isNormal + examinationTypeName: exam.isNormal! ? "Normal" - : exam.isAbnormal + : exam.isAbnormal! ? 'AbNormal' : "Not Examined", isNew: exam.isNew)); @@ -258,24 +258,24 @@ class _UpdateObjectivePageState extends State { if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else { - widget.changeLoadingState(true); + widget.changeLoadingState!(true); - widget.changePageViewIndex(2); + widget.changePageViewIndex!(2); } } else { - Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context)!.examinationErrorMsg); } } - removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.mySelectedExamination + removeExamination(MasterKeyModel? masterKey) { + Iterable history = widget.mySelectedExamination! .where((element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + masterKey!.id == element.selectedExamination!.id && + masterKey.typeId == element.selectedExamination!.typeId); if (history.length > 0) setState(() { - widget.mySelectedExamination.remove(history.first); + widget.mySelectedExamination!.remove(history.first); }); } @@ -312,12 +312,12 @@ class _UpdateObjectivePageState extends State { } class AddExaminationDailog extends StatefulWidget { - final List mySelectedExamination; - final Function addSelectedExamination; - final Function(MasterKeyModel) removeExamination; + final List? mySelectedExamination; + final Function? addSelectedExamination; + final Function(MasterKeyModel)? removeExamination; const AddExaminationDailog( - {Key key, + {Key? key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) @@ -353,7 +353,7 @@ class _AddExaminationDailogState extends State { height: 16, ), AppText( - TranslationBase.of(context).physicalSystemExamination, + TranslationBase.of(context)!.physicalSystemExamination, fontWeight: FontWeight.bold, fontSize: 16, ), diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 87ea1e4d..8860029c 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -22,15 +22,15 @@ import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; class UpdatePlanPage extends StatefulWidget { - final Function changePageViewIndex; - final PatiantInformtion patientInfo; - final Function changeLoadingState; + final Function? changePageViewIndex; + final PatiantInformtion? patientInfo; + final Function? changeLoadingState; - final int currentIndex; - GetPatientProgressNoteResModel patientProgressNote; + final int? currentIndex; + GetPatientProgressNoteResModel? patientProgressNote; UpdatePlanPage( - {Key key, + {Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, @@ -64,7 +64,7 @@ class _UpdatePlanPageState extends State { @override void initState() { super.initState(); - if(widget.patientProgressNote.planNote !=null ){ + if(widget.patientProgressNote!.planNote !=null ){ setState(() { isAddProgress = false; }); @@ -78,24 +78,24 @@ class _UpdatePlanPageState extends State { onModelReady: (model) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( - appointmentNo: widget.patientInfo.appointmentNo, - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); + appointmentNo: widget.patientInfo!.appointmentNo, + patientMRN: widget.patientInfo!.patientMRN, + episodeID: widget.patientInfo!.episodeNo.toString(), editedBy: '', doctorID: ''); await model.getPatientProgressNote(getGetProgressNoteReqModel); if (model.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers .parseHtmlString(model.patientProgressNoteList[0].planNote); - widget.patientProgressNote.planNote = progressNoteController.text; - widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; - widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; - widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; - widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; + widget.patientProgressNote!.planNote = progressNoteController.text; + widget.patientProgressNote!.createdByName = model.patientProgressNoteList[0].createdByName; + widget.patientProgressNote!.createdOn = model.patientProgressNoteList[0].createdOn; + widget.patientProgressNote!.editedOn = model.patientProgressNoteList[0].editedOn; + widget.patientProgressNote!.editedByName = model.patientProgressNoteList[0].editedByName; setState(() { isAddProgress = false; }); } - widget.changeLoadingState(false); + widget.changeLoadingState!(false); }, builder: (_, model, w) => AppScaffold( backgroundColor: Theme @@ -114,7 +114,7 @@ class _UpdatePlanPageState extends State { SizedBox(height: 10,), ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).progressNote + headerTitle: TranslationBase.of(context)!.progressNote , onTap: () { setState(() { @@ -134,20 +134,20 @@ class _UpdatePlanPageState extends State { EdgeInsets.only(left: 10, right: 10, top: 15), child: AppTextFieldCustom( - hintText: TranslationBase.of(context).progressNote, + hintText: TranslationBase.of(context)!.progressNote, controller: progressNoteController, minLines: 2, maxLines: 4, inputType: TextInputType.multiline, onChanged: (value){ - widget.patientProgressNote.planNote = value; + widget.patientProgressNote!.planNote = value; }, ), ), SizedBox( height: 9, ), - if ( widget.patientProgressNote.planNote != null&& !isAddProgress) + if ( widget.patientProgressNote!.planNote != null&& !isAddProgress) Container( margin: EdgeInsets.only(left: 5, right: 5, ), @@ -164,12 +164,12 @@ class _UpdatePlanPageState extends State { Row( children: [ AppText('Appointment No: ',fontSize: 12,), - AppText(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), + AppText(widget.patientProgressNote!.appointmentNo as String???'',fontWeight: FontWeight.w600,), ], ), AppText( - widget.patientProgressNote.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + widget.patientProgressNote!.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote!.createdOn!)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w600, fontSize: 14, @@ -188,11 +188,11 @@ class _UpdatePlanPageState extends State { AppText('Condition: ', fontSize: 12,), AppText( - widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600), + widget.patientProgressNote!.mName??'',fontWeight: FontWeight.w600), ], ), AppText( - widget.patientProgressNote.createdOn !=null?AppDateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getHour(DateTime.now()), + widget.patientProgressNote!.createdOn !=null?AppDateUtils.getHour(DateTime.parse(widget.patientProgressNote!.createdOn!)):AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, ) @@ -214,7 +214,7 @@ class _UpdatePlanPageState extends State { onTap: (){ setState(() { isAddProgress = true; - widget.changePageViewIndex(3,isChangeState:false); + widget.changePageViewIndex!(3,isChangeState:false); }); }, child: Icon(DoctorApp.edit,size: 18,)) @@ -263,14 +263,14 @@ class _UpdatePlanPageState extends State { Expanded( child: AppButton( title: TranslationBase - .of(context) + .of(context)! .previous, color: Colors.grey[300], fontColor: Colors.black, fontWeight: FontWeight.w600, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - widget.changePageViewIndex(2); + widget.changePageViewIndex!(2); }, ) , @@ -279,7 +279,7 @@ class _UpdatePlanPageState extends State { Expanded( child: AppButton( title: TranslationBase - .of(context) + .of(context)! .next, fontWeight: FontWeight.w600, color: Colors.red[700], @@ -291,17 +291,17 @@ class _UpdatePlanPageState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); + DoctorProfileModel.fromJson(profile as Map); setState(() { - widget.patientProgressNote.createdByName = - widget.patientProgressNote + widget.patientProgressNote!.createdByName = + widget.patientProgressNote! .createdByName ?? doctorProfile.doctorName; - widget.patientProgressNote.editedByName = + widget.patientProgressNote!.editedByName = doctorProfile.doctorName; - widget.patientProgressNote.createdOn = + widget.patientProgressNote!.createdOn = DateTime.now().toString(); - widget.patientProgressNote.planNote = + widget.patientProgressNote!.planNote = progressNoteController.text; isAddProgress = !isAddProgress; }); @@ -310,7 +310,7 @@ class _UpdatePlanPageState extends State { Navigator.of(context).pop(); } } else { - Helpers.showErrorToast(TranslationBase.of(context) + Helpers.showErrorToast(TranslationBase.of(context)! .progressNoteErrorMsg); } }, @@ -333,10 +333,10 @@ class _UpdatePlanPageState extends State { submitPlan(SOAPViewModel model) async { if (progressNoteController.text.isNotEmpty) { PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - planNote: widget.patientProgressNote.planNote, doctorID: '', editedBy: ''); + patientMRN: widget.patientInfo!.patientMRN, + episodeId: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, + planNote: widget.patientProgressNote!.planNote, doctorID: '', editedBy: ''); if(model.patientProgressNoteList.isEmpty){ await model.postProgressNote(postProgressNoteRequestModel); @@ -344,7 +344,7 @@ class _UpdatePlanPageState extends State { }else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile as Map); postProgressNoteRequestModel.editedBy =doctorProfile.doctorID; await model.patchProgressNote(postProgressNoteRequestModel); @@ -353,10 +353,10 @@ class _UpdatePlanPageState extends State { if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else { - widget.changePageViewIndex(4,isChangeState:false); + widget.changePageViewIndex!(4,isChangeState:false); } } else { - Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context)!.progressNoteErrorMsg); } } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 31a501ce..e963d4f0 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -3,14 +3,14 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class SOAPOpenItems extends StatelessWidget { - final Function onTap; - final String label; + final Function? onTap; + final String? label; - const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key); + const SOAPOpenItems({Key? key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Container( padding: EdgeInsets.symmetric( vertical: 8, horizontal: 8.0), @@ -40,7 +40,7 @@ class SOAPOpenItems extends StatelessWidget { fontWeight: FontWeight.w600, ), AppText( - "${TranslationBase.of(context).searchHere}", + "${TranslationBase.of(context)!.searchHere}", fontSize:13, color: Colors.grey.shade700, ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index 85614b6d..6f60f1f0 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -5,12 +5,12 @@ import 'package:flutter/material.dart'; class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ - Key key, + Key? key, this.currentIndex, this.changePageViewIndex, }) : super(key: key); - final int currentIndex; - final Function changePageViewIndex; + final int? currentIndex; + final Function? changePageViewIndex; @override Widget build(BuildContext context) { @@ -20,11 +20,11 @@ class SOAPStepHeader extends StatelessWidget { children: [ SizedBox(height: 15,), AppText( - TranslationBase.of(context).createNew, + TranslationBase.of(context)!.createNew, fontSize: 14, fontWeight: FontWeight.w500, ), - AppText(TranslationBase.of(context).episode, + AppText(TranslationBase.of(context)!.episode, fontSize: 26, fontWeight: FontWeight.bold, ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index 8f5ecf93..a2ab614a 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; class BottomSheetTitle extends StatelessWidget { const BottomSheetTitle({ - Key key, this.title, + Key? key, this.title, }) : super(key: key); - final String title; + final String? title; @override Widget build(BuildContext context) { return Container( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index d4666428..34192ded 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -6,14 +6,14 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; class ExpandableSOAPWidget extends StatelessWidget { - final bool isExpanded; - final Widget child; - final Function onTap; + final bool? isExpanded; + final Widget? child; + final Function? onTap; final headerTitle; final bool isRequired; const ExpandableSOAPWidget( - {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) + {Key? key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) : super(key: key); @override @@ -31,16 +31,16 @@ class ExpandableSOAPWidget extends StatelessWidget { ), child: HeaderBodyExpandableNotifier( headerWidget: InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Row( children: [ AppText(headerTitle, - variant: isExpanded ? "bodyText" : '', + variant: isExpanded! ? "bodyText" : '', fontSize: 15, color: Colors.black), if(isRequired) @@ -52,9 +52,9 @@ class ExpandableSOAPWidget extends StatelessWidget { ), ), InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Icon( - isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline), + isExpanded! ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline), ) ], ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart index c5c2e8ca..7d82b87c 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart @@ -7,11 +7,11 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class StepsWidget extends StatelessWidget { - final int index; - final Function changeCurrentTab; + final int? index; + final Function? changeCurrentTab; final double height; - StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0}); + StepsWidget({Key? key, this.index, this.changeCurrentTab, this.height = 0.0}); @override Widget build(BuildContext context) { @@ -44,7 +44,7 @@ class StepsWidget extends StatelessWidget { top: 10, left: 0, child: InkWell( - onTap: () => changeCurrentTab(0), + onTap: () => changeCurrentTab!(0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -54,14 +54,14 @@ class StepsWidget extends StatelessWidget { decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 0 + : index! > 0 ? null : Border.all( color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) - : index > 0 + : index! > 0 ? Color(0xFF359846) : Color(0xFFCCCCCC), ), @@ -98,7 +98,7 @@ class StepsWidget extends StatelessWidget { .size .width * 0.25, child: InkWell( - onTap: () => index >= 1 ? changeCurrentTab(1) : null, + onTap: () => index! >= 1 ? changeCurrentTab!(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -108,14 +108,14 @@ class StepsWidget extends StatelessWidget { decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 + : index! > 2 ? null : Border.all( color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) - : index > 1 + : index! > 1 ? Color(0xFF359846) : Color(0xFFCCCCCC), ), @@ -155,7 +155,7 @@ class StepsWidget extends StatelessWidget { .width * 0.50, child: InkWell( onTap: () { - if (index >= 3) changeCurrentTab(2); + if (index! >= 3) changeCurrentTab!(2); }, child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -166,14 +166,14 @@ class StepsWidget extends StatelessWidget { decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 + : index! > 2 ? null : Border.all( color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) - : index > 2 + : index! > 2 ? Color(0xFF359846) : Color(0xFFCCCCCC), ), @@ -209,7 +209,7 @@ class StepsWidget extends StatelessWidget { top: 10, right: 0, child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(4) : null, + onTap: () => index! >= 3 ? changeCurrentTab!(4) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ @@ -219,14 +219,14 @@ class StepsWidget extends StatelessWidget { decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 3 + : index! > 3 ? null : Border.all( color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) - : index > 3 + : index! > 3 ? Color(0xFF359846) : Color(0xFFCCCCCC), ), @@ -287,7 +287,7 @@ class StepsWidget extends StatelessWidget { top: 10, right: 0, child: InkWell( - onTap: () => changeCurrentTab(0), + onTap: () => changeCurrentTab!(0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -297,14 +297,14 @@ class StepsWidget extends StatelessWidget { decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 0 + : index! > 0 ? null : Border.all( color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) - : index > 0 + : index! > 0 ? Color(0xFF359846) : Color(0xFFCCCCCC), ), @@ -340,7 +340,7 @@ class StepsWidget extends StatelessWidget { .size .width * 0.28, child: InkWell( - onTap: () => index >= 2 ? changeCurrentTab(1) : null, + onTap: () => index! >= 2 ? changeCurrentTab!(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -350,14 +350,14 @@ class StepsWidget extends StatelessWidget { decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 + : index! > 2 ? null : Border.all( color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) - : index > 1 + : index! > 1 ? Color(0xFF359846) : Color(0xFFCCCCCC), ), @@ -393,7 +393,7 @@ class StepsWidget extends StatelessWidget { .size .width * 0.52, child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(2) : null, + onTap: () => index! >= 3 ? changeCurrentTab!(2) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -403,14 +403,14 @@ class StepsWidget extends StatelessWidget { decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 + : index! > 2 ? null : Border.all( color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) - : index > 2 + : index! > 2 ? Color(0xFFCC9B14) : Color(0xFFCCCCCC), ), @@ -448,7 +448,7 @@ class StepsWidget extends StatelessWidget { top: 10, left: 0, child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(4) : null, + onTap: () => index! >= 3 ? changeCurrentTab!(4) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ @@ -458,14 +458,14 @@ class StepsWidget extends StatelessWidget { decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 3 + : index! > 3 ? null : Border.all( color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) - : index > 3 + : index! > 3 ? Color(0xFFCC9B14) : Color(0xFFCCCCCC), ), @@ -506,13 +506,13 @@ class StepsWidget extends StatelessWidget { class StatusLabel extends StatelessWidget { const StatusLabel({ - Key key, + Key? key, this.stepId, this.selectedStepId, }) : super(key: key); - final int stepId; - final int selectedStepId; + final int? stepId; + final int? selectedStepId; @override Widget build(BuildContext context) { @@ -522,7 +522,7 @@ class StatusLabel extends StatelessWidget { decoration: BoxDecoration( color: stepId == selectedStepId ? Color(0xFFF1E9D3) - : stepId < selectedStepId + : stepId! < selectedStepId! ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC), borderRadius: BorderRadius.all( @@ -533,7 +533,7 @@ class StatusLabel extends StatelessWidget { child: AppText( stepId == selectedStepId ? "inProgress" - : stepId < selectedStepId + : stepId! < selectedStepId! ? "Completed" : " Locked ", fontWeight: FontWeight.bold, @@ -541,7 +541,7 @@ class StatusLabel extends StatelessWidget { fontSize: 10, color: stepId == selectedStepId ? Color(0xFFCC9B14) - : stepId < selectedStepId + : stepId! < selectedStepId! ? Color(0xFF359846) : Color(0xFF969696), ), diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index fc7329e5..a01b21c5 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -16,10 +16,10 @@ import 'package:hexcolor/hexcolor.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart'; class AddAllergies extends StatefulWidget { - final Function addAllergiesFun; - final List myAllergiesList; + final Function? addAllergiesFun; + final List? myAllergiesList; - const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) + const AddAllergies({Key? key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key); @override @@ -27,17 +27,17 @@ class AddAllergies extends StatefulWidget { } class _AddAllergiesState extends State { - List allergiesList; - List allergySeverityList; + List? allergiesList; + List? allergySeverityList; TextEditingController remarkController = TextEditingController(); TextEditingController severityController = TextEditingController(); TextEditingController allergyController = TextEditingController(); - List myAllergiesListLocal; + late List myAllergiesListLocal; @override initState() { super.initState(); - myAllergiesListLocal = [...widget.myAllergiesList]; + myAllergiesListLocal = [...widget.myAllergiesList!]; } GlobalKey key = new GlobalKey>(); @@ -45,7 +45,7 @@ class _AddAllergiesState extends State { InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {IconData icon}) { + {IconData? icon}) { return InputDecoration( contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), focusedBorder: OutlineInputBorder( @@ -91,7 +91,7 @@ class _AddAllergiesState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle( - title: TranslationBase.of(context).addAllergies, + title: TranslationBase.of(context)!.addAllergies, ), SizedBox( height: 10, @@ -119,7 +119,7 @@ class _AddAllergiesState extends State { addAllergyLocally(mySelectedAllergy); }, addSelectedAllergy: () => widget - .addAllergiesFun(myAllergiesListLocal), + .addAllergiesFun!(myAllergiesListLocal), isServiceSelected: (master) => isServiceSelected(master), getServiceSelectedAllergy: (master) => @@ -156,11 +156,11 @@ class _AddAllergiesState extends State { child: Center( child: AppButton( title: - TranslationBase.of(context).addAllergies, + TranslationBase.of(context)!.addAllergies, padding: 10, color: Color(0xFF359846), onPressed: () { - widget.addAllergiesFun(myAllergiesListLocal); + widget.addAllergiesFun!(myAllergiesListLocal); }, ), ), @@ -179,9 +179,9 @@ class _AddAllergiesState extends State { isServiceSelected(MasterKeyModel masterKey) { Iterable allergy = myAllergiesListLocal.where( (element) => - masterKey.id == element.selectedAllergy.id && - masterKey.typeId == element.selectedAllergy.typeId && - element.isChecked); + masterKey.id == element.selectedAllergy!.id && + masterKey.typeId == element.selectedAllergy!.typeId && + element.isChecked!); if (allergy.length > 0) { return true; } @@ -190,15 +190,15 @@ class _AddAllergiesState extends State { removeAllergyFromLocalList(MasterKeyModel masterKey) { myAllergiesListLocal - .removeWhere((element) => element.selectedAllergy.id == masterKey.id); + .removeWhere((element) => element.selectedAllergy!.id == masterKey.id); } - MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { + MySelectedAllergy? getSelectedAllergy(MasterKeyModel masterKey) { Iterable allergy = myAllergiesListLocal.where( (element) => - masterKey.id == element.selectedAllergy.id && - masterKey.typeId == element.selectedAllergy.typeId && - element.isChecked); + masterKey.id == element.selectedAllergy!.id && + masterKey.typeId == element.selectedAllergy!.typeId && + element.isChecked!); if (allergy.length > 0) { return allergy.first; } @@ -208,7 +208,7 @@ class _AddAllergiesState extends State { addAllergyLocally(MySelectedAllergy mySelectedAllergy) { if (mySelectedAllergy.selectedAllergy == null) { Helpers.showErrorToast(TranslationBase - .of(context) + .of(context)! .requiredMsg); } else { setState(() { @@ -216,8 +216,8 @@ class _AddAllergiesState extends State { // ignore: missing_return myAllergiesListLocal .where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id) + mySelectedAllergy.selectedAllergy!.id == + element.selectedAllergy!.id) .toList(); if (allergy.isEmpty) { diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 6f7439e6..6f0ffb7d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -14,9 +14,9 @@ import 'add_allergies.dart'; // ignore: must_be_immutable class UpdateAllergiesWidget extends StatefulWidget { - List myAllergiesList; + List? myAllergiesList; - UpdateAllergiesWidget({Key key, this.myAllergiesList}); + UpdateAllergiesWidget({Key? key, this.myAllergiesList}); @override _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); @@ -36,7 +36,7 @@ class _UpdateAllergiesWidgetState extends State { children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { + SOAPOpenItems(label: "${TranslationBase.of(context)!.addAllergies}",onTap: () { openAllergiesList(context, changeAllState); },), SizedBox( @@ -46,7 +46,7 @@ class _UpdateAllergiesWidgetState extends State { margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( - children: widget.myAllergiesList.map((selectedAllergy) { + children: widget.myAllergiesList!.map((selectedAllergy) { return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, @@ -64,22 +64,22 @@ class _UpdateAllergiesWidgetState extends State { children: [ AppText( projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn + ? selectedAllergy.selectedAllergy!.nameAr + : selectedAllergy.selectedAllergy!.nameEn! .toUpperCase(), - textDecoration: selectedAllergy.isChecked + textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, bold: true, color: Color(0xFF2B353E)), AppText( projectViewModel.isArabic - ? selectedAllergy.selectedAllergySeverity + ? selectedAllergy.selectedAllergySeverity! .nameAr - : selectedAllergy.selectedAllergySeverity - .nameEn + : selectedAllergy.selectedAllergySeverity! + .nameEn! .toUpperCase(), - textDecoration: selectedAllergy.isChecked + textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, color: Color(0xFFCC9B14)), @@ -91,13 +91,13 @@ class _UpdateAllergiesWidgetState extends State { .width * 0.5, ), - if (selectedAllergy.isChecked) + if (selectedAllergy.isChecked!) InkWell( child: Row( children: [Container( child: AppText( TranslationBase - .of(context) + .of(context)! .remove, fontSize: 15, variant: "bodyText", @@ -146,10 +146,10 @@ class _UpdateAllergiesWidgetState extends State { removeAllergy(MySelectedAllergy mySelectedAllergy) { List allergy = // ignore: missing_return - widget.myAllergiesList.where((element) => - mySelectedAllergy.selectedAllergySeverity.id == - element.selectedAllergySeverity.id && - mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id + widget.myAllergiesList!.where((element) => + mySelectedAllergy.selectedAllergySeverity!.id == + element.selectedAllergySeverity!.id && + mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id ).toList(); if (allergy.length > 0) { @@ -180,15 +180,15 @@ class _UpdateAllergiesWidgetState extends State { }); if (isAllDataFilled) { mySelectedAllergy.forEach((element) { - if (!widget.myAllergiesList.contains(element.selectedAllergySeverity.id)) { - widget.myAllergiesList.add(element); + if (!widget.myAllergiesList!.contains(element.selectedAllergySeverity!.id)) { + widget.myAllergiesList!.add(element); } }); changeParentState(); Navigator.of(context).pop(); } else { Helpers.showErrorToast(TranslationBase - .of(context) + .of(context)! .requiredMsg); } }); diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 0e5e6ec1..5ec461ae 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -7,11 +7,11 @@ import '../medication/update_medication_widget.dart'; class UpdateChiefComplaints extends StatelessWidget { const UpdateChiefComplaints({ - Key key, - @required this.formKey, - @required this.complaintsController, - @required this.illnessController, - @required this.medicationController, + Key? key, + required this.formKey, + required this.complaintsController, + required this.illnessController, + required this.medicationController, this.complaintsControllerError, this.illnessControllerError, this.medicationControllerError, @@ -21,9 +21,9 @@ class UpdateChiefComplaints extends StatelessWidget { final TextEditingController complaintsController; final TextEditingController illnessController; final TextEditingController medicationController; - final String complaintsControllerError; - final String illnessControllerError; - final String medicationControllerError; + final String? complaintsControllerError; + final String? illnessControllerError; + final String? medicationControllerError; @override Widget build(BuildContext context) { @@ -35,7 +35,7 @@ class UpdateChiefComplaints extends StatelessWidget { ), //TODO handel error cases AppTextFieldCustom( - hintText: TranslationBase.of(context).addChiefComplaints, + hintText: TranslationBase.of(context)!.addChiefComplaints, controller: complaintsController, maxLines: 25, minLines: 7, @@ -51,7 +51,7 @@ class UpdateChiefComplaints extends StatelessWidget { AppTextFieldCustom( hintText: TranslationBase - .of(context) + .of(context)! .historyOfPresentIllness, controller: illnessController, inputType: TextInputType.multiline, @@ -74,7 +74,7 @@ class UpdateChiefComplaints extends StatelessWidget { ), AppTextFieldCustom( hintText: TranslationBase - .of(context) + .of(context)! .currentMedications, controller: medicationController, maxLines: 25, diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index 1da8db17..dfb01408 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -15,14 +15,14 @@ import '../../shared_soap_widgets/bottom_sheet_title.dart'; import 'priority_bar.dart'; class AddHistoryDialog extends StatefulWidget { - final Function changePageViewIndex; - final PageController controller; - final List myHistoryList; - final Function addSelectedHistories; - final Function (MasterKeyModel) removeHistory; + final Function? changePageViewIndex; + final PageController? controller; + final List? myHistoryList; + final Function? addSelectedHistories; + final Function (MasterKeyModel)? removeHistory; const AddHistoryDialog( - {Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) + {Key? key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) : super(key: key); @override @@ -56,12 +56,12 @@ class _AddHistoryDialogState extends State { child: Container( child: Column( children: [ - BottomSheetTitle(title:TranslationBase.of(context).addHistory), + BottomSheetTitle(title:TranslationBase.of(context)!.addHistory), SizedBox( height: 10, ), PriorityBar(onTap: (activePriority) async { - widget.changePageViewIndex(activePriority); + widget.changePageViewIndex!(activePriority); }), SizedBox( height: 20, @@ -85,7 +85,7 @@ class _AddHistoryDialogState extends State { masterList: model.historyFamilyList, removeHistory: (history){ setState(() { - widget.removeHistory(history); + widget.removeHistory!(history); }); }, addHistory: (history){ @@ -95,7 +95,7 @@ class _AddHistoryDialogState extends State { }); }, addSelectedHistories: (){ - widget.addSelectedHistories(); + widget.addSelectedHistories!(); }, isServiceSelected: (master) =>isServiceSelected(master), ), @@ -107,7 +107,7 @@ class _AddHistoryDialogState extends State { masterList: model.mergeHistorySurgicalWithHistorySportList, removeHistory: (history){ setState(() { - widget.removeHistory(history); + widget.removeHistory!(history); }); }, addHistory: (history){ @@ -117,7 +117,7 @@ class _AddHistoryDialogState extends State { }); }, addSelectedHistories: (){ - widget.addSelectedHistories(); + widget.addSelectedHistories!(); }, isServiceSelected: (master) =>isServiceSelected(master), ), @@ -129,7 +129,7 @@ class _AddHistoryDialogState extends State { masterList: model.historyMedicalList, removeHistory: (history){ setState(() { - widget.removeHistory(history); + widget.removeHistory!(history); }); }, addHistory: (history){ @@ -139,7 +139,7 @@ class _AddHistoryDialogState extends State { }); }, addSelectedHistories: (){ - widget.addSelectedHistories(); + widget.addSelectedHistories!(); }, isServiceSelected: (master) => isServiceSelected(master), @@ -175,11 +175,11 @@ class _AddHistoryDialogState extends State { child: Center( child: AppButton( title: - TranslationBase.of(context).addSelectedHistories, + TranslationBase.of(context)!.addSelectedHistories, padding: 10, color: Color(0xFF359846), onPressed: () { - widget.addSelectedHistories(); + widget.addSelectedHistories!(); }, ), ), @@ -196,11 +196,11 @@ class _AddHistoryDialogState extends State { } createAndAddHistory(MasterKeyModel history) { - List myhistory = widget.myHistoryList.where((element) => + List myhistory = widget.myHistoryList!.where((element) => history.id == - element.selectedHistory.id && + element.selectedHistory!.id && history.typeId == - element.selectedHistory.typeId + element.selectedHistory!.typeId ).toList(); if (myhistory.isEmpty) { @@ -209,7 +209,7 @@ class _AddHistoryDialogState extends State { remark: history.remarks ?? "", selectedHistory: history, isChecked: true); - widget.myHistoryList.add(mySelectedHistory); + widget.myHistoryList!.add(mySelectedHistory); }); } else { myhistory.first.isChecked = true; @@ -219,11 +219,11 @@ class _AddHistoryDialogState extends State { isServiceSelected(MasterKeyModel masterKey) { Iterable history = widget - .myHistoryList + .myHistoryList! .where((element) => - masterKey.id == element.selectedHistory.id && - masterKey.typeId == element.selectedHistory.typeId && - element.isChecked); + masterKey.id == element.selectedHistory!.id && + masterKey.typeId == element.selectedHistory!.typeId && + element.isChecked!); if (history.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index ac6ec2c5..30e2a89d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -5,9 +5,9 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class PriorityBar extends StatefulWidget { - final Function onTap; + final Function? onTap; - const PriorityBar({Key key, this.onTap}) : super(key: key); + const PriorityBar({Key? key, this.onTap}) : super(key: key); @override _PriorityBarState createState() => _PriorityBarState(); @@ -81,7 +81,7 @@ class _PriorityBarState extends State { ), ), onTap: () { - widget.onTap(_priorities.indexOf(item)); + widget.onTap!(_priorities.indexOf(item)); setState(() { _activePriority = _priorities.indexOf(item); diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index f114702d..7e6f3894 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -12,9 +12,9 @@ import '../../shared_soap_widgets/SOAP_open_items.dart'; import 'add_history_dialog.dart'; class UpdateHistoryWidget extends StatefulWidget { - final List myHistoryList; + final List? myHistoryList; - const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); + const UpdateHistoryWidget({Key? key, this.myHistoryList}) : super(key: key); @override _UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState(); @@ -22,10 +22,10 @@ class UpdateHistoryWidget extends StatefulWidget { class _UpdateHistoryWidgetState extends State with TickerProviderStateMixin { - PageController _controller; + PageController? _controller; changePageViewIndex(pageIndex) { - _controller.jumpToPage(pageIndex); + _controller!.jumpToPage(pageIndex); } @override @@ -41,7 +41,7 @@ class _UpdateHistoryWidgetState extends State return Column( children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addHistory}",onTap: () { + SOAPOpenItems(label: "${TranslationBase.of(context)!.addHistory}",onTap: () { openHistoryList(context); },), @@ -52,7 +52,7 @@ class _UpdateHistoryWidgetState extends State margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( - children: widget.myHistoryList.map((myHistory) { + children: widget.myHistoryList!.map((myHistory) { return Column( children: [ Row( @@ -61,10 +61,10 @@ class _UpdateHistoryWidgetState extends State Container( child: AppText( projectViewModel.isArabic - ? myHistory.selectedHistory.nameAr - : myHistory.selectedHistory.nameEn, + ? myHistory.selectedHistory!.nameAr + : myHistory.selectedHistory!.nameEn, fontSize: 15, - textDecoration: myHistory.isChecked + textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, color: Colors.black), @@ -73,18 +73,18 @@ class _UpdateHistoryWidgetState extends State .size .width * 0.5, ), - if (myHistory.isChecked) + if (myHistory.isChecked!) InkWell( child: Row( children: [ Container( child: AppText( TranslationBase - .of(context) + .of(context)! .remove, fontSize: 15, variant: "bodyText", - textDecoration: myHistory.isChecked + textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, color: HexColor("#B8382C"),), @@ -112,14 +112,14 @@ class _UpdateHistoryWidgetState extends State ); } - removeHistory(MasterKeyModel historyKey) { + removeHistory(MasterKeyModel? historyKey) { List history = // ignore: missing_return - widget.myHistoryList.where((element) => - historyKey.id == - element.selectedHistory.id && + widget.myHistoryList!.where((element) => + historyKey!.id == + element.selectedHistory!.id && historyKey.typeId == - element.selectedHistory.typeId + element.selectedHistory!.typeId ).toList(); diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 69475926..2fa17bbf 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -22,10 +22,10 @@ import '../../shared_soap_widgets/bottom_sheet_title.dart'; // ignore: must_be_immutable class AddMedication extends StatefulWidget { - final Function addMedicationFun; - TextEditingController medicationController; + final Function? addMedicationFun; + TextEditingController? medicationController; - AddMedication({Key key, this.addMedicationFun, this.medicationController}) + AddMedication({Key? key, this.addMedicationFun, this.medicationController}) : super(key: key); @override @@ -33,16 +33,16 @@ class AddMedication extends StatefulWidget { } class _AddMedicationState extends State { - MasterKeyModel _selectedMedicationDose; - MasterKeyModel _selectedMedicationStrength; - MasterKeyModel _selectedMedicationRoute; - MasterKeyModel _selectedMedicationFrequency; + MasterKeyModel? _selectedMedicationDose; + MasterKeyModel? _selectedMedicationStrength; + MasterKeyModel? _selectedMedicationRoute; + MasterKeyModel? _selectedMedicationFrequency; TextEditingController doseController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); - GetMedicationResponseModel _selectedMedication; + GetMedicationResponseModel? _selectedMedication; GlobalKey key = new GlobalKey>(); @@ -81,7 +81,7 @@ class _AddMedicationState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle( - title: TranslationBase.of(context).addMedication, + title: TranslationBase.of(context)!.addMedication, ), SizedBox( height: 10, @@ -120,7 +120,7 @@ class _AddMedicationState extends State { decoration: TextFieldsUtils .textFieldSelectorDecoration( TranslationBase.of( - context) + context)! .searchMedicineNameHere, null, true, @@ -128,28 +128,28 @@ class _AddMedicationState extends State { itemSubmitted: (item) => setState( () => _selectedMedication = item), - key: key, + key: key as GlobalKey>, suggestions: model.allMedicationList, itemBuilder: (context, suggestion) => new Padding( child: AppText(suggestion - .description + + .description! + '/' + suggestion - .genericName), + .genericName!), padding: EdgeInsets.all(8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => - suggestion.genericName.toLowerCase().startsWith( + suggestion.genericName!.toLowerCase().startsWith( input.toLowerCase()) || - suggestion.description + suggestion.description! .toLowerCase() .startsWith(input .toLowerCase()) || - suggestion.keywords + suggestion.keywords! .toLowerCase() .startsWith( input.toLowerCase()), @@ -158,15 +158,16 @@ class _AddMedicationState extends State { : AppTextFieldCustom( hintText: _selectedMedication != null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : TranslationBase.of(context) + ? _selectedMedication! + .description! + + (' (${_selectedMedication!.genericName} )') + : TranslationBase.of(context)! .searchMedicineNameHere, minLines: 2, maxLines: 2, isTextFieldHasSuffix: true, suffixIcon: IconButton( + onPressed: null, icon: Icon( Icons.search, color: Colors.grey.shade600, @@ -186,7 +187,7 @@ class _AddMedicationState extends State { MasterKeyDailog( list: model.medicationDoseTimeList, okText: - TranslationBase.of(context).ok, + TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _selectedMedicationDose = @@ -195,10 +196,10 @@ class _AddMedicationState extends State { doseController .text = projectViewModel .isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; + ? _selectedMedicationDose! + .nameAr! + : _selectedMedicationDose! + .nameEn!; }); }, ); @@ -212,14 +213,14 @@ class _AddMedicationState extends State { } : null, hintText: - TranslationBase.of(context).doseTime, + TranslationBase.of(context)!.doseTime, maxLines: 2, minLines: 2, isTextFieldHasSuffix: true, controller: doseController, validationError: isFormSubmitted && _selectedMedicationDose == null - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), SizedBox( @@ -234,7 +235,7 @@ class _AddMedicationState extends State { MasterKeyDailog( list: model.medicationStrengthList, okText: - TranslationBase.of(context).ok, + TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _selectedMedicationStrength = @@ -243,10 +244,10 @@ class _AddMedicationState extends State { strengthController .text = projectViewModel .isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; + ? _selectedMedicationStrength! + .nameAr! + : _selectedMedicationStrength! + .nameEn!; }); }, ); @@ -260,13 +261,13 @@ class _AddMedicationState extends State { } : null, hintText: - TranslationBase.of(context).strength, + TranslationBase.of(context)!.strength, maxLines: 2, minLines: 2, controller: strengthController, validationError: isFormSubmitted && _selectedMedicationStrength == null - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), SizedBox( @@ -284,7 +285,7 @@ class _AddMedicationState extends State { MasterKeyDailog( list: model.medicationRouteList, okText: - TranslationBase.of(context).ok, + TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _selectedMedicationRoute = @@ -293,10 +294,10 @@ class _AddMedicationState extends State { routeController .text = projectViewModel .isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; + ? _selectedMedicationRoute! + .nameAr! + : _selectedMedicationRoute! + .nameEn!; }); }, ); @@ -309,13 +310,13 @@ class _AddMedicationState extends State { ); } : null, - hintText: TranslationBase.of(context).route, + hintText: TranslationBase.of(context)!.route, maxLines: 2, minLines: 2, controller: routeController, validationError: isFormSubmitted && _selectedMedicationRoute == null - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), SizedBox( @@ -331,7 +332,7 @@ class _AddMedicationState extends State { MasterKeyDailog( list: model.medicationFrequencyList, okText: - TranslationBase.of(context).ok, + TranslationBase.of(context)!.ok, okFunction: (selectedValue) { setState(() { _selectedMedicationFrequency = @@ -340,10 +341,10 @@ class _AddMedicationState extends State { frequencyController .text = projectViewModel .isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; + ? _selectedMedicationFrequency! + .nameAr! + : _selectedMedicationFrequency! + .nameEn!; }); }, ); @@ -357,7 +358,7 @@ class _AddMedicationState extends State { } : null, hintText: - TranslationBase.of(context).frequency, + TranslationBase.of(context)!.frequency, enabled: false, maxLines: 2, minLines: 2, @@ -365,7 +366,7 @@ class _AddMedicationState extends State { controller: frequencyController, validationError: isFormSubmitted && _selectedMedicationFrequency == null - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context)!.emptyMessage : null, ), SizedBox( @@ -401,8 +402,8 @@ class _AddMedicationState extends State { widthFactor: .80, child: Center( child: AppButton( - title: TranslationBase.of(context) - .addMedication + title: TranslationBase.of(context)! + .addMedication! .toUpperCase(), color: Color(0xFF359846), onPressed: () { @@ -414,9 +415,9 @@ class _AddMedicationState extends State { _selectedMedicationStrength != null && _selectedMedicationRoute != null && _selectedMedicationFrequency != null) { - widget.medicationController.text = widget - .medicationController.text + - '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + widget.medicationController!.text = widget + .medicationController!.text + + '${_selectedMedication!.description} (${TranslationBase.of(context)!.doseTime} ) ${doseController.text} (${TranslationBase.of(context)!.strength}) ${strengthController.text} (${TranslationBase.of(context)!.route}) ${routeController.text} (${TranslationBase.of(context)!.frequency}) ${frequencyController.text} \n \n'; Navigator.of(context).pop(); } }, diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index 7372e7ee..d9e22f26 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -6,10 +6,10 @@ import '../../shared_soap_widgets/SOAP_open_items.dart'; import 'add_medication.dart'; class UpdateMedicationWidget extends StatefulWidget { - final TextEditingController medicationController; + final TextEditingController? medicationController; UpdateMedicationWidget({ - Key key, + Key? key, this.medicationController, }); @@ -23,7 +23,7 @@ class _UpdateMedicationWidgetState extends State { return Column( children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addMedication}",onTap: () { + SOAPOpenItems(label: "${TranslationBase.of(context)!.addMedication}",onTap: () { openMedicationList(context); },), diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index b0db0414..b77ec29e 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -28,15 +28,15 @@ import 'cheif_complaints/update_Chief_complaints.dart'; import 'history/update_history_widget.dart'; class UpdateSubjectivePage extends StatefulWidget { - final Function changePageViewIndex; - final Function changeLoadingState; - final List myAllergiesList; - final List myHistoryList; - final PatiantInformtion patientInfo; - final int currentIndex; + final Function? changePageViewIndex; + final Function? changeLoadingState; + final List? myAllergiesList; + final List? myHistoryList; + final PatiantInformtion? patientInfo; + final int? currentIndex; UpdateSubjectivePage( - {Key key, + {Key? key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList, @@ -53,17 +53,17 @@ class _UpdateSubjectivePageState extends State { TextEditingController illnessController = TextEditingController(); TextEditingController complaintsController = TextEditingController(); TextEditingController medicationController = TextEditingController(); - String complaintsControllerError = ''; - String medicationControllerError = ''; - String illnessControllerError = ''; + String? complaintsControllerError = ''; + String? medicationControllerError = ''; + String? illnessControllerError = ''; final formKey = GlobalKey(); getHistory(SOAPViewModel model) async { - widget.changeLoadingState(true); + widget.changeLoadingState!(true); GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo!.patientMRN, + episodeID: widget.patientInfo!.episodeNo.toString(), + appointmentNo: widget.patientInfo!.appointmentNo, doctorID: '', editedBy: ''); @@ -96,7 +96,7 @@ class _UpdateSubjectivePageState extends State { isChecked: element.isChecked, remark: element.remarks); - widget.myHistoryList.add(mySelectedHistory); + widget.myHistoryList!.add(mySelectedHistory); } } if (element.historyType == @@ -111,7 +111,7 @@ class _UpdateSubjectivePageState extends State { isChecked: element.isChecked, remark: element.remarks); - widget.myHistoryList.add(mySelectedHistory); + widget.myHistoryList!.add(mySelectedHistory); } } if (element.historyType == @@ -126,7 +126,7 @@ class _UpdateSubjectivePageState extends State { isChecked: element.isChecked, remark: element.remarks); - widget.myHistoryList.add(mySelectedHistory); + widget.myHistoryList!.add(mySelectedHistory); } } if (element.historyType == @@ -141,7 +141,7 @@ class _UpdateSubjectivePageState extends State { isChecked: element.isChecked, remark: element.remarks); - widget.myHistoryList.add(mySelectedHistory); + widget.myHistoryList!.add(mySelectedHistory); } } }); @@ -150,9 +150,9 @@ class _UpdateSubjectivePageState extends State { getAllergies(SOAPViewModel model) async { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo!.patientMRN, + episodeId: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); @@ -186,7 +186,7 @@ class _UpdateSubjectivePageState extends State { remark: element.remarks, selectedAllergySeverity: selectedAllergySeverity); if (selectedAllergy != null && selectedAllergySeverity != null) - widget.myAllergiesList.add(mySelectedAllergy); + widget.myAllergiesList!.add(mySelectedAllergy); }); } } @@ -195,29 +195,29 @@ class _UpdateSubjectivePageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - widget.myAllergiesList.clear(); - widget.myHistoryList.clear(); + widget.myAllergiesList!.clear(); + widget.myHistoryList!.clear(); GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( - patientMRN: widget.patientInfo.patientMRN, - appointmentNo: widget.patientInfo.appointmentNo, - episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo, + patientMRN: widget.patientInfo!.patientMRN, + appointmentNo: widget.patientInfo!.appointmentNo, + episodeId: widget.patientInfo!.episodeNo, + episodeID: widget.patientInfo!.episodeNo, doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; complaintsController.text = Helpers.parseHtmlString( model.patientChiefComplaintList[0].chiefComplaint); - illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; + illnessController.text = model.patientChiefComplaintList[0].hopi!; + medicationController.text =!model.patientChiefComplaintList[0].currentMedication!.isNotEmpty ? model.patientChiefComplaintList[0].currentMedication! + '\n \n':model.patientChiefComplaintList[0].currentMedication!; } await getHistory(model); await getAllergies(model); - widget.changeLoadingState(false); + widget.changeLoadingState!(false); }, builder: (_, model, w) => AppScaffold( @@ -237,7 +237,7 @@ class _UpdateSubjectivePageState extends State { SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context) + headerTitle: TranslationBase.of(context)! .chiefComplaints , onTap: () { @@ -263,7 +263,7 @@ class _UpdateSubjectivePageState extends State { ExpandableSOAPWidget( headerTitle: TranslationBase - .of(context) + .of(context)! .histories, isRequired: false, onTap: () { @@ -285,7 +285,7 @@ class _UpdateSubjectivePageState extends State { ExpandableSOAPWidget( headerTitle: TranslationBase - .of(context) + .of(context)! .allergiesSoap , isRequired: false, @@ -336,7 +336,7 @@ class _UpdateSubjectivePageState extends State { child: Center( child: AppButton( title: TranslationBase - .of(context) + .of(context)! .next, fontWeight: FontWeight.w600, color:Colors.red[700], @@ -359,11 +359,11 @@ class _UpdateSubjectivePageState extends State { ); } - addSubjectiveInfo({SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { - formKey.currentState.save(); - formKey.currentState.validate(); + addSubjectiveInfo({SOAPViewModel? model, + List? myAllergiesList, + List? myHistoryList}) async { + formKey.currentState!.save(); + formKey.currentState!.validate(); complaintsControllerError = ''; medicationControllerError = ''; @@ -372,52 +372,52 @@ class _UpdateSubjectivePageState extends State { illnessController.text.isNotEmpty && complaintsController.text.length > 25) { await postChiefComplaint(model: model); - if (model.state == ViewState.ErrorLocal) { + if (model!.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } - if (myHistoryList.length != 0) { + if (myHistoryList!.length != 0) { await postHistories(model: model, myHistoryList: myHistoryList); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } } - if (myAllergiesList.length != 0) { + if (myAllergiesList!.length != 0) { await postAllergy(myAllergiesList: myAllergiesList, model: model); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } } - widget.changeLoadingState(true); + widget.changeLoadingState!(true); - widget.changePageViewIndex(1); + widget.changePageViewIndex!(1); } else { setState(() { if (complaintsController.text.isEmpty) { complaintsControllerError = TranslationBase - .of(context) + .of(context)! .emptyMessage; } else if (complaintsController.text.length < 25) { complaintsControllerError = TranslationBase - .of(context) + .of(context)! .chiefComplaintLength; } if (illnessController.text.isEmpty) { illnessControllerError = TranslationBase - .of(context) + .of(context)! .emptyMessage; } if (medicationController.text.isEmpty) { medicationControllerError = TranslationBase - .of(context) + .of(context)! .emptyMessage; } }); Helpers.showErrorToast(TranslationBase - .of(context) + .of(context)! .chiefComplaintErrorMsg); } @@ -425,25 +425,25 @@ class _UpdateSubjectivePageState extends State { } postAllergy( - {List myAllergiesList, SOAPViewModel model}) async { + {List? myAllergiesList, required SOAPViewModel model}) async { PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - widget.myAllergiesList.forEach((allergy) { + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile as Map); + widget.myAllergiesList!.forEach((allergy) { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add( ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, + allergyDiseaseId: allergy.selectedAllergy!.id, + allergyDiseaseType: allergy.selectedAllergy!.typeId, + patientMRN: widget.patientInfo!.patientMRN, + episodeId: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, + severity: allergy.selectedAllergySeverity!.id, remarks: allergy.remark, createdBy: allergy.createdBy??doctorProfile.doctorID, createdOn: DateTime.now().toIso8601String(), @@ -459,9 +459,9 @@ class _UpdateSubjectivePageState extends State { } GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo!.patientMRN, + episodeId: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); @@ -472,19 +472,19 @@ class _UpdateSubjectivePageState extends State { } postHistories( - {List myHistoryList, SOAPViewModel model}) async { + {List? myHistoryList, required SOAPViewModel model}) async { PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); - widget.myHistoryList.forEach((history) { + widget.myHistoryList!.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( + patientMRN: widget.patientInfo!.patientMRN, + episodeId: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, remarks: "", - historyId: history.selectedHistory.id, - historyType: history.selectedHistory.typeId, + historyId: history.selectedHistory!.id, + historyType: history.selectedHistory!.typeId, isChecked: history.isChecked, )); }); @@ -502,14 +502,14 @@ class _UpdateSubjectivePageState extends State { } } - postChiefComplaint({SOAPViewModel model}) async { - formKey.currentState.save(); - if(formKey.currentState.validate()){ + postChiefComplaint({SOAPViewModel? model}) async { + formKey.currentState!.save(); + if(formKey.currentState!.validate()){ PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo!.patientMRN, + episodeID: widget.patientInfo!.episodeNo, + appointmentNo: widget.patientInfo!.appointmentNo, chiefComplaint: complaintsController.text, currentMedication: medicationController.text, hopi: illnessController.text, @@ -518,7 +518,7 @@ class _UpdateSubjectivePageState extends State { doctorID: '', numberOfWeeks: 0); - if (model.patientChiefComplaintList.isEmpty) { + if (model!.patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); } else { diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index d9af7457..1bd235eb 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -17,9 +17,9 @@ import 'objective/update_objective_page.dart'; import 'plan/update_plan_page.dart'; class UpdateSoapIndex extends StatefulWidget { - final bool isUpdate; + final bool? isUpdate; - const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); + const UpdateSoapIndex({Key? key, this.isUpdate}) : super(key: key); @override _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); @@ -27,12 +27,12 @@ class UpdateSoapIndex extends StatefulWidget { class _UpdateSoapIndexState extends State with TickerProviderStateMixin { - PageController _controller; + PageController? _controller; int _currentIndex = 0; - List myAllergiesList = List(); - List myHistoryList = List(); - List mySelectedExamination = List(); - List mySelectedAssessment = List(); + List myAllergiesList = []; + List myHistoryList = []; + List mySelectedExamination = []; + List mySelectedAssessment = []; GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); @@ -40,7 +40,7 @@ class _UpdateSoapIndexState extends State changePageViewIndex(pageIndex,{isChangeState = true}) { if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); - _controller.jumpToPage(pageIndex); + _controller!.jumpToPage(pageIndex); setState(() { _currentIndex = pageIndex; }); @@ -63,8 +63,8 @@ class _UpdateSoapIndexState extends State @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; return BaseView( builder: (_, model, w) => AppScaffold( isLoading: _isLoading, diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 564c8c2c..d8a05ca0 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -6,14 +6,14 @@ import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; class LineChartCurved extends StatelessWidget { - final String title; - final List timeSeries; - final int indexes; + final String? title; + final List? timeSeries; + final int? indexes; LineChartCurved({this.title, this.timeSeries, this.indexes}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; // DateFormat format = DateFormat("yyyy-MM-dd"); DateFormat yearFormat = DateFormat("yyyy/MMM"); @@ -78,20 +78,20 @@ class LineChartCurved extends StatelessWidget { } getXaxix() { - for (int index = 0; index < timeSeries.length; index++) { - int mIndex = indexes * index; - if (mIndex < timeSeries.length) { + for (int index = 0; index < timeSeries!.length; index++) { + int mIndex = indexes! * index; + if (mIndex < timeSeries!.length) { xAxixs.add(mIndex); } } } getYaxix() { - int indexess = (timeSeries.length * 0.30).toInt(); - for (int index = 0; index < timeSeries.length; index++) { + 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); + if (mIndex < timeSeries!.length) { + yAxixs.add(timeSeries![mIndex].sales); } } } @@ -118,9 +118,9 @@ class LineChartCurved extends StatelessWidget { //rotateAngle:-65, margin: 22, getTitles: (value) { - if (timeSeries.length < 15) { - if (timeSeries.length > value.toInt()) { - DateTime dateTime = timeSeries[value.toInt()].time; + if (timeSeries!.length < 15) { + if (timeSeries!.length > value.toInt()) { + DateTime dateTime = timeSeries![value.toInt()].time; if (isDatesSameYear) { return monthFormat.format(dateTime); } else { @@ -131,9 +131,9 @@ class LineChartCurved extends StatelessWidget { } } else { if (value.toInt() == 0 || - value.toInt() == timeSeries.length - 1 || + value.toInt() == timeSeries!.length - 1 || xAxixs.contains(value.toInt())) { - DateTime dateTime = timeSeries[value.toInt()].time; + DateTime dateTime = timeSeries![value.toInt()].time; if (isDatesSameYear) { return monthFormat.format(dateTime); } else { @@ -204,7 +204,7 @@ class LineChartCurved extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries.length - 1).toDouble(), + maxX: (timeSeries!.length - 1).toDouble(), maxY: getMaxY() + 0.3, minY: getMinY(), lineBarsData: getData(context), @@ -213,8 +213,8 @@ class LineChartCurved extends StatelessWidget { double getMaxY() { double max = 0; - timeSeries.forEach((element) { - double resultValueDouble = element.sales; + timeSeries!.forEach((element) { + double resultValueDouble = element.sales!; if (resultValueDouble > max) max = resultValueDouble; }); @@ -222,28 +222,28 @@ class LineChartCurved extends StatelessWidget { } double getMinY() { - double min = timeSeries[0].sales; - timeSeries.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble < min) min = resultValueDouble; + double? min = timeSeries![0].sales; + timeSeries!.forEach((element) { + double resultValueDouble = element.sales!; + if (resultValueDouble < min!) min = resultValueDouble; }); - int value = min.toInt(); + int value = min!.toInt(); return value.toDouble(); } List getData(context) { - List spots = List(); + List spots = []; isDatesSameYear = true; int previousDateYear = 0; - for (int index = 0; index < timeSeries.length; index++) { - spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + for (int index = 0; index < timeSeries!.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries![index].sales!)); if (isDatesSameYear == false || (previousDateYear != 0 && - previousDateYear != timeSeries[index].time.year)) { + previousDateYear != timeSeries![index].time.year)) { isDatesSameYear = false; } - previousDateYear = timeSeries[index].time.year; + previousDateYear = timeSeries![index].time.year; } final LineChartBarData lineChartBarData1 = LineChartBarData( diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 1c387c9a..7c18333e 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -6,17 +6,17 @@ import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; class LineChartCurvedBloodPressure extends StatelessWidget { - final String title; - final List timeSeries1; - final List timeSeries2; - final int indexes; + final String? title; + final List? timeSeries1; + final List? timeSeries2; + final int? indexes; final bool isOX; LineChartCurvedBloodPressure( {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; @override Widget build(BuildContext context) { @@ -80,7 +80,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Theme.of(context).primaryColor), ), SizedBox(width: 5,), - AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) + AppText(isOX? "SAO2":TranslationBase.of(context)!.systolicLng) ], ), SizedBox(width: 15,), @@ -94,7 +94,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Colors.red), ), SizedBox(width: 5,), - AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) + AppText(isOX? "FIO2":TranslationBase.of(context)!.diastolicLng,) ], ), ], @@ -106,9 +106,9 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } getXaxix() { - for (int index = 0; index < timeSeries1.length; index++) { - int mIndex = indexes * index; - if (mIndex < timeSeries1.length) { + for (int index = 0; index < timeSeries1!.length; index++) { + int mIndex = indexes! * index; + if (mIndex < timeSeries1!.length) { xAxixs.add(mIndex); } } @@ -136,18 +136,18 @@ class LineChartCurvedBloodPressure extends StatelessWidget { //rotateAngle:-65, margin: 22, getTitles: (value) { - if (timeSeries1.length < 15) { - if (timeSeries1.length > value.toInt()) { - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (timeSeries1!.length < 15) { + if (timeSeries1!.length > value.toInt()) { + return '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}'; } else return ''; } else { if (value.toInt() == 0) - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; - if (value.toInt() == timeSeries1.length - 1) - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + return '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}'; + if (value.toInt() == timeSeries1!.length - 1) + return '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}'; if (xAxixs.contains(value.toInt())) { - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + return '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}'; } } return ''; @@ -185,7 +185,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries1.length - 1).toDouble(), + maxX: (timeSeries1!.length - 1).toDouble(), maxY: getMaxY() + 0.3, minY: getMinY(), lineBarsData: getData(context), @@ -194,12 +194,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { double getMaxY() { double max = 0; - timeSeries1.forEach((element) { - double resultValueDouble = element.sales; + timeSeries1!.forEach((element) { + double resultValueDouble = element.sales!; if (resultValueDouble > max) max = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; + timeSeries2!.forEach((element) { + double resultValueDouble = element.sales!; if (resultValueDouble > max) max = resultValueDouble; }); @@ -207,30 +207,30 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } double getMinY() { - double min = timeSeries1[0].sales; - timeSeries1.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble < min) min = resultValueDouble; + double? min = timeSeries1![0].sales; + timeSeries1!.forEach((element) { + double resultValueDouble = element.sales!; + if (resultValueDouble < min!) min = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble < min) min = resultValueDouble; + timeSeries2!.forEach((element) { + double resultValueDouble = element.sales!; + if (resultValueDouble < min!) min = resultValueDouble; }); - int value = min.toInt(); + int value = min!.toInt(); return value.toDouble(); } List getData(context) { - List spots = List(); - for (int index = 0; index < timeSeries1.length; index++) { - spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + List spots = []; + for (int index = 0; index < timeSeries1!.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!)); } - List spots2 = List(); - for (int index = 0; index < timeSeries2.length; index++) { - spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + List spots2 = []; + for (int index = 0; index < timeSeries2!.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2![index].sales!)); } final LineChartBarData lineChartBarData1 = LineChartBarData( @@ -260,7 +260,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ); - List lineChartData = List(); + List lineChartData = []; if(spots.isNotEmpty){ lineChartData.add(lineChartBarData1); } diff --git a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart index 0bf2197b..4b5cf132 100644 --- a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart @@ -14,16 +14,16 @@ import 'package:hexcolor/hexcolor.dart'; class PatientVitalSignScreen extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String from = routeArgs['from']; - String to = routeArgs['to']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? from = routeArgs['from']; + String? to = routeArgs['to']; return BaseView( - onModelReady: (model) => model.getPatientVitalSign(patient), + onModelReady: (model) => model.getPatientVitalSign(patient!), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).vitalSign, + appBarTitle: TranslationBase.of(context)!.vitalSign, body: model.patientVitalSigns != null ? SingleChildScrollView( child: Container( @@ -45,7 +45,7 @@ class PatientVitalSignScreen extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).weight} :", + "${TranslationBase.of(context)!.weight} :", fontSize: SizeConfig.textMultiplier * 2, color: Colors.black, fontWeight: FontWeight.bold, @@ -54,7 +54,7 @@ class PatientVitalSignScreen extends StatelessWidget { width: 8, ), AppText( - "${model.patientVitalSigns.weightKg} ${TranslationBase.of(context).kg}", + "${model.patientVitalSigns!.weightKg} ${TranslationBase.of(context)!.kg}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -64,7 +64,7 @@ class PatientVitalSignScreen extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).idealBodyWeight} :", + "${TranslationBase.of(context)!.idealBodyWeight} :", fontSize: SizeConfig.textMultiplier * 2, color: Colors.black, fontWeight: FontWeight.bold, @@ -73,7 +73,7 @@ class PatientVitalSignScreen extends StatelessWidget { width: 8, ), AppText( - "${model.patientVitalSigns.idealBodyWeightLbs} ${TranslationBase.of(context).kg}", + "${model.patientVitalSigns!.idealBodyWeightLbs} ${TranslationBase.of(context)!.kg}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -91,7 +91,7 @@ class PatientVitalSignScreen extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).height} :", + "${TranslationBase.of(context)!.height} :", fontSize: SizeConfig.textMultiplier * 2, color: Colors.black, fontWeight: FontWeight.bold, @@ -100,7 +100,7 @@ class PatientVitalSignScreen extends StatelessWidget { width: 8, ), AppText( - "${model.patientVitalSigns.heightCm} ${TranslationBase.of(context).cm}", + "${model.patientVitalSigns!.heightCm} ${TranslationBase.of(context)!.cm}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -137,7 +137,7 @@ class PatientVitalSignScreen extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).headCircum} :", + "${TranslationBase.of(context)!.headCircum} :", fontSize: SizeConfig.textMultiplier * 2, color: Colors.black, fontWeight: FontWeight.bold, @@ -146,7 +146,7 @@ class PatientVitalSignScreen extends StatelessWidget { width: 8, ), AppText( - "${model.patientVitalSigns.headCircumCm} ${TranslationBase.of(context).cm}", + "${model.patientVitalSigns!.headCircumCm} ${TranslationBase.of(context)!.cm}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -164,7 +164,7 @@ class PatientVitalSignScreen extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).leanBodyWeight} :", + "${TranslationBase.of(context)!.leanBodyWeight} :", fontSize: SizeConfig.textMultiplier * 2, color: Colors.black, fontWeight: FontWeight.bold, @@ -173,7 +173,7 @@ class PatientVitalSignScreen extends StatelessWidget { width: 8, ), AppText( - "${model.patientVitalSigns.leanBodyWeightLbs} ${TranslationBase.of(context).kg}", + "${model.patientVitalSigns!.leanBodyWeightLbs} ${TranslationBase.of(context)!.kg}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -191,7 +191,7 @@ class PatientVitalSignScreen extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).bodyMassIndex} :", + "${TranslationBase.of(context)!.bodyMassIndex} :", fontSize: SizeConfig.textMultiplier * 2, color: Colors.black, fontWeight: FontWeight.bold, @@ -200,7 +200,7 @@ class PatientVitalSignScreen extends StatelessWidget { width: 8, ), AppText( - "${model.patientVitalSigns.bodyMassIndex}", + "${model.patientVitalSigns!.bodyMassIndex}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -214,7 +214,7 @@ class PatientVitalSignScreen extends StatelessWidget { padding: EdgeInsets.symmetric( vertical: 2, horizontal: 8), child: AppText( - "${model.getBMI(model.patientVitalSigns.bodyMassIndex)}", + "${model.getBMI(model.patientVitalSigns!.bodyMassIndex)}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.white, @@ -359,7 +359,7 @@ class PatientVitalSignScreen extends StatelessWidget { ) : Center( child: AppText( - "${TranslationBase.of(context).vitalSignEmptyMsg}", + "${TranslationBase.of(context)!.vitalSignEmptyMsg}", fontSize: SizeConfig.textMultiplier * 2.5, color: HexColor("#B8382B"), fontWeight: FontWeight.normal, @@ -372,7 +372,7 @@ class PatientVitalSignScreen extends StatelessWidget { class TemperatureWidget extends StatefulWidget { final VitalSignsViewModel model; - final VitalSignData vitalSign; + final VitalSignData? vitalSign; TemperatureWidget(this.model, this.vitalSign); @@ -393,7 +393,7 @@ class _TemperatureWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${TranslationBase.of(context).temperature}", + "${TranslationBase.of(context)!.temperature}", fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.black, fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, @@ -421,7 +421,7 @@ class _TemperatureWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).temperature} (C):", + "${TranslationBase.of(context)!.temperature} (C):", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -432,7 +432,7 @@ class _TemperatureWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.temperatureCelcius}", + "${widget.vitalSign!.temperatureCelcius}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -447,7 +447,7 @@ class _TemperatureWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).temperature} (F):", + "${TranslationBase.of(context)!.temperature} (F):", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -458,7 +458,7 @@ class _TemperatureWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.temperatureCelcius * (9 / 5) + 32}", + "${widget.vitalSign!.temperatureCelcius * (9 / 5) + 32}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -478,7 +478,7 @@ class _TemperatureWidgetState extends State { Row( children: [ AppText( - "${TranslationBase.of(context).method} :", + "${TranslationBase.of(context)!.method} :", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -487,7 +487,7 @@ class _TemperatureWidgetState extends State { width: 8, ), AppText( - "${widget.model.getTempratureMethod(widget.vitalSign.temperatureCelciusMethod)}", + "${widget.model.getTempratureMethod(widget.vitalSign!.temperatureCelciusMethod)}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -506,7 +506,7 @@ class _TemperatureWidgetState extends State { } class PulseWidget extends StatefulWidget { - final VitalSignData vitalSign; + final VitalSignData? vitalSign; PulseWidget(this.vitalSign); @@ -527,7 +527,7 @@ class _PulseWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${TranslationBase.of(context).pulse}", + "${TranslationBase.of(context)!.pulse}", fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.black, fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, @@ -556,7 +556,7 @@ class _PulseWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).pulseBeats}", + "${TranslationBase.of(context)!.pulseBeats}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -567,7 +567,7 @@ class _PulseWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.pulseBeatPerMinute}", + "${widget.vitalSign!.pulseBeatPerMinute}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -582,7 +582,7 @@ class _PulseWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).rhythm}", + "${TranslationBase.of(context)!.rhythm}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -593,7 +593,7 @@ class _PulseWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.pulseRhythm}", + "${widget.vitalSign!.pulseRhythm}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -614,7 +614,7 @@ class _PulseWidgetState extends State { } class RespirationWidget extends StatefulWidget { - final VitalSignData vitalSign; + final VitalSignData? vitalSign; RespirationWidget(this.vitalSign); @@ -635,7 +635,7 @@ class _RespirationWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${TranslationBase.of(context).respiration}", + "${TranslationBase.of(context)!.respiration}", fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.black, fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, @@ -663,7 +663,7 @@ class _RespirationWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).respBeats}", + "${TranslationBase.of(context)!.respBeats}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -674,7 +674,7 @@ class _RespirationWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.respirationBeatPerMinute}", + "${widget.vitalSign!.respirationBeatPerMinute}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -689,7 +689,7 @@ class _RespirationWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).patternOfRespiration}", + "${TranslationBase.of(context)!.patternOfRespiration}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -700,7 +700,7 @@ class _RespirationWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.respirationPattern}", + "${widget.vitalSign!.respirationPattern}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -721,7 +721,7 @@ class _RespirationWidgetState extends State { } class BloodPressureWidget extends StatefulWidget { - final VitalSignData vitalSign; + final VitalSignData? vitalSign; BloodPressureWidget(this.vitalSign); @@ -742,7 +742,7 @@ class _BloodPressureWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${TranslationBase.of(context).bloodPressure}", + "${TranslationBase.of(context)!.bloodPressure}", fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.black, fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, @@ -770,7 +770,7 @@ class _BloodPressureWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).bloodPressureDiastoleAndSystole}", + "${TranslationBase.of(context)!.bloodPressureDiastoleAndSystole}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -781,7 +781,7 @@ class _BloodPressureWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.bloodPressureHigher}, ${widget.vitalSign.bloodPressureLower}", + "${widget.vitalSign!.bloodPressureHigher}, ${widget.vitalSign!.bloodPressureLower}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -796,7 +796,7 @@ class _BloodPressureWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).cuffLocation}", + "${TranslationBase.of(context)!.cuffLocation}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -807,7 +807,7 @@ class _BloodPressureWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.bloodPressureCuffLocation}", + "${widget.vitalSign!.bloodPressureCuffLocation}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -831,7 +831,7 @@ class _BloodPressureWidgetState extends State { children: [ Expanded( child: AppText( - "${TranslationBase.of(context).patientPosition}", + "${TranslationBase.of(context)!.patientPosition}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -842,7 +842,7 @@ class _BloodPressureWidgetState extends State { ), Expanded( child: AppText( - "${widget.vitalSign.bloodPressurePatientPosition}", + "${widget.vitalSign!.bloodPressurePatientPosition}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -855,7 +855,7 @@ class _BloodPressureWidgetState extends State { child: Row( children: [ AppText( - "${TranslationBase.of(context).cuffSize}", + "${TranslationBase.of(context)!.cuffSize}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -864,7 +864,7 @@ class _BloodPressureWidgetState extends State { width: 8, ), AppText( - "${widget.vitalSign.bloodPressureCuffSize}", + "${widget.vitalSign!.bloodPressureCuffSize}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -884,7 +884,7 @@ class _BloodPressureWidgetState extends State { } class OxygenationWidget extends StatefulWidget { - final VitalSignData vitalSign; + final VitalSignData? vitalSign; OxygenationWidget(this.vitalSign); @@ -905,7 +905,7 @@ class _OxygenationWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${TranslationBase.of(context).oxygenation}", + "${TranslationBase.of(context)!.oxygenation}", fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.black, fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, @@ -930,7 +930,7 @@ class _OxygenationWidgetState extends State { Row( children: [ AppText( - "${TranslationBase.of(context).sao2}", + "${TranslationBase.of(context)!.sao2}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -939,7 +939,7 @@ class _OxygenationWidgetState extends State { width: 8, ), AppText( - "${widget.vitalSign.sao2}", + "${widget.vitalSign!.sao2}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -949,7 +949,7 @@ class _OxygenationWidgetState extends State { Row( children: [ AppText( - "${TranslationBase.of(context).fio2}", + "${TranslationBase.of(context)!.fio2}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -958,7 +958,7 @@ class _OxygenationWidgetState extends State { width: 8, ), AppText( - "${widget.vitalSign.fio2}", + "${widget.vitalSign!.fio2}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -977,7 +977,7 @@ class _OxygenationWidgetState extends State { } class PainScaleWidget extends StatefulWidget { - final VitalSignData vitalSign; + final VitalSignData? vitalSign; PainScaleWidget(this.vitalSign); @@ -998,7 +998,7 @@ class _PainScaleWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${TranslationBase.of(context).painScale}", + "${TranslationBase.of(context)!.painScale}", fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.black, fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, @@ -1024,7 +1024,7 @@ class _PainScaleWidgetState extends State { child: Row( children: [ AppText( - "${TranslationBase.of(context).painScale}", + "${TranslationBase.of(context)!.painScale}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -1033,7 +1033,7 @@ class _PainScaleWidgetState extends State { width: 8, ), AppText( - "${widget.vitalSign.painScore}", + "${widget.vitalSign!.painScore}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -1045,7 +1045,7 @@ class _PainScaleWidgetState extends State { child: Row( children: [ AppText( - "${TranslationBase.of(context).painManagement}", + "${TranslationBase.of(context)!.painManagement}", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.w700, @@ -1054,7 +1054,7 @@ class _PainScaleWidgetState extends State { width: 8, ), AppText( - "${widget.vitalSign.isPainManagementDone}", + "${widget.vitalSign!.isPainManagementDone}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart index 146a8ddb..2daa4c4f 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; class VitalSignDetailPainScale extends StatelessWidget { - final List vitalList; + final List? vitalList; VitalSignDetailPainScale(this.vitalList); @@ -22,7 +22,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Column( children: [ ...List.generate( - vitalList.length, + vitalList!.length, (index) => Container( margin: EdgeInsets.all(5), color: Colors.white, @@ -34,7 +34,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - TranslationBase.of(context).description, + TranslationBase.of(context)!.description, color: Colors.black, bold: true, ), @@ -45,7 +45,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - TranslationBase.of(context).value, + TranslationBase.of(context)!.value, color: Colors.black, bold: true, ), @@ -56,7 +56,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - TranslationBase.of(context).date, + TranslationBase.of(context)!.date, color: Colors.black, bold: true, ), @@ -91,7 +91,7 @@ class VitalSignDetailPainScale extends StatelessWidget { Expanded( child: Container( child: AppText( - TranslationBase.of(context).painScale, + TranslationBase.of(context)!.painScale, fontSize: SizeConfig.textMultiplier * 1.5, color: Color(0XFF28353E), fontWeight: FontWeight.w600, @@ -102,7 +102,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - "${vitalList[index].painScoreDesc ?? "-"}", + "${vitalList![index].painScoreDesc ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.3, @@ -129,7 +129,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - "${vitalList[index].painLocation ?? "-"}", + "${vitalList![index].painLocation ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.3, @@ -155,7 +155,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - "${vitalList[index].painCharacter ?? "-"}", + "${vitalList![index].painCharacter ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.3, @@ -181,7 +181,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - "${vitalList[index].painDuration ?? "-"}", + "${vitalList![index].painDuration ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.3, @@ -196,7 +196,7 @@ class VitalSignDetailPainScale extends StatelessWidget { Expanded( child: Container( child: AppText( - TranslationBase.of(context).painManagement, + TranslationBase.of(context)!.painManagement, fontSize: SizeConfig.textMultiplier * 1.5, color: Color(0XFF28353E), fontWeight: FontWeight.w600, @@ -207,7 +207,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - "${vitalList[index].isPainManagementDone ?? "-"}", + "${vitalList![index].isPainManagementDone ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.3, @@ -233,7 +233,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - "${vitalList[index].painFrequency ?? "-"}", + "${vitalList![index].painFrequency ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.3, @@ -251,7 +251,7 @@ class VitalSignDetailPainScale extends StatelessWidget { padding: EdgeInsets.all(8), child: Center( child: AppText( - "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", + "${AppDateUtils.convertDateFromServerFormat(vitalList![index].createdOn, "E , dd MMM, yyyy hh:mm a")}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.6, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index 1e593af7..3e58abdd 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -9,15 +9,15 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class VitalSignBloodPressureWidget extends StatefulWidget { - final List vitalList; - final String title1; - final String title2; - final String title3; - final String viewKey1; - final String viewKey2; + final List? vitalList; + final String? title1; + final String? title2; + final String? title3; + final String? viewKey1; + final String? viewKey2; VitalSignBloodPressureWidget( - {Key key, + {Key? key, this.vitalList, this.title1, this.title2, @@ -60,7 +60,7 @@ class _VitalSignDetailsWidgetState extends State { ), ),*/ child: AppText( - TranslationBase.of(context).date, + TranslationBase.of(context)!.date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, @@ -123,7 +123,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -151,8 +151,8 @@ class _VitalSignDetailsWidgetState extends State { height: 60), ), ]));*/ - widget.vitalList.forEach((vital) { - var data = vital.toJson()[widget.viewKey1]; + widget.vitalList!.forEach((vital) { + var data = vital.toJson()[widget.viewKey1!]; DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) @@ -176,7 +176,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(10), color: Colors.white, child: AppText( - '${vital.toJson()[widget.viewKey1]}', + '${vital.toJson()[widget.viewKey1!]}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, @@ -190,7 +190,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(10), color: Colors.white, child: AppText( - '${vital.toJson()[widget.viewKey2]}', + '${vital.toJson()[widget.viewKey2!]}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index a6f36784..fbfdf07e 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -14,8 +14,8 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class VitalSignDetailsScreen extends StatelessWidget { - int appointmentNo; - int projectID; + int? appointmentNo; + int? projectID; bool isNotOneAppointment; VitalSignDetailsScreen( @@ -23,25 +23,25 @@ class VitalSignDetailsScreen extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - String from = routeArgs['from']; - String to = routeArgs['to']; - bool isInpatient = routeArgs['isInpatient']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; + String? from = routeArgs['from']; + String? to = routeArgs['to']; + bool? isInpatient = routeArgs['isInpatient']; String imageBasePath = 'assets/images/'; String assetBasePath = "${imageBasePath}patient/vital_signs/"; return BaseView( onModelReady: (model) => - model.getPatientVitalSignHistory(patient, from, to, isInpatient), + model.getPatientVitalSignHistory(patient, from, to, isInpatient!), builder: (_, mode, widget) => AppScaffold( baseViewModel: mode, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).vitalSign, + appBarTitle: TranslationBase.of(context)!.vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( children: [ @@ -56,13 +56,13 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails.firstName}'s", + "${patient!.firstName ?? patient.patientDetails!.firstName}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), AppText( - TranslationBase.of(context).vitalSign, + TranslationBase.of(context)!.vitalSign, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), @@ -89,7 +89,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", + "${TranslationBase.of(context)!.yourBodyMassIndex} ${mode.bodyMax}", color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, @@ -115,7 +115,7 @@ class VitalSignDetailsScreen extends StatelessWidget { height: 4, ), AppText( - "${TranslationBase.of(context).bmiUnderWeight}", + "${TranslationBase.of(context)!.bmiUnderWeight}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.15, @@ -155,7 +155,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ), Container( child: AppText( - "${TranslationBase.of(context).normal}", + "${TranslationBase.of(context)!.normal}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * @@ -196,7 +196,7 @@ class VitalSignDetailsScreen extends StatelessWidget { height: 4, ), AppText( - "${TranslationBase.of(context).bmiOverWeight}", + "${TranslationBase.of(context)!.bmiOverWeight}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.155, @@ -235,7 +235,7 @@ class VitalSignDetailsScreen extends StatelessWidget { height: 4, ), AppText( - "${TranslationBase.of(context).bmiObese}", + "${TranslationBase.of(context)!.bmiObese}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.15, @@ -276,7 +276,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FittedBox( fit: BoxFit.fitWidth, child: AppText( - "${TranslationBase.of(context).bmiObeseExtreme}", + "${TranslationBase.of(context)!.bmiObeseExtreme}", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * @@ -331,7 +331,7 @@ class VitalSignDetailsScreen extends StatelessWidget { .Height, pageTitle: TranslationBase.of( - context) + context)! .height, vitalList: mode .patientVitalSignsHistory, @@ -344,12 +344,12 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context) + des: TranslationBase.of(context)! .height, imagePath: "${assetBasePath}height.png", lastVal: mode.heightCm, - unit: TranslationBase.of(context) + unit: TranslationBase.of(context)! .cm, ), ), @@ -365,7 +365,7 @@ class VitalSignDetailsScreen extends StatelessWidget { .Weight, pageTitle: TranslationBase.of( - context) + context)! .weight, vitalList: mode .patientVitalSignsHistory, @@ -377,12 +377,12 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) + des: TranslationBase.of(context)! .weight, imagePath: "${assetBasePath}weight.png", unit: - TranslationBase.of(context).kg, + TranslationBase.of(context)!.kg, lastVal: mode.weightKg, ), ), @@ -397,7 +397,7 @@ class VitalSignDetailsScreen extends StatelessWidget { .Temperature, pageTitle: TranslationBase.of( - context) + context)! .temperature, vitalList: mode .patientVitalSignsHistory, @@ -410,12 +410,12 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context) + des: TranslationBase.of(context)! .temperature, imagePath: "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context) + unit: TranslationBase.of(context)! .tempC, ), ), @@ -431,7 +431,7 @@ class VitalSignDetailsScreen extends StatelessWidget { .heart, pageTitle: TranslationBase.of( - context) + context)! .heart, vitalList: mode .patientVitalSignsHistory, @@ -443,13 +443,13 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) + des: TranslationBase.of(context)! .heart, imagePath: "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, unit: - TranslationBase.of(context).bpm, + TranslationBase.of(context)!.bpm, ), ), InkWell( @@ -463,7 +463,7 @@ class VitalSignDetailsScreen extends StatelessWidget { .Respiration, pageTitle: TranslationBase.of( - context) + context)! .respirationRate, vitalList: mode .patientVitalSignsHistory, @@ -475,13 +475,13 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) + des: TranslationBase.of(context)! .respirationRate, imagePath: "${assetBasePath}respiration_rate.png", lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context) + unit: TranslationBase.of(context)! .respirationSigns, ), ), @@ -496,7 +496,7 @@ class VitalSignDetailsScreen extends StatelessWidget { .BloodPressure, pageTitle: TranslationBase.of( - context) + context)! .bloodPressure, vitalList: mode .patientVitalSignsHistory, @@ -508,12 +508,12 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) + des: TranslationBase.of(context)! .bloodPressure, imagePath: "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, - unit: TranslationBase.of(context) + unit: TranslationBase.of(context)! .sysDias, ), ), @@ -528,7 +528,7 @@ class VitalSignDetailsScreen extends StatelessWidget { .Oxygenation, pageTitle: TranslationBase.of( - context) + context)! .oxygenation, vitalList: mode .patientVitalSignsHistory, @@ -540,7 +540,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) + des: TranslationBase.of(context)! .oxygenation, imagePath: "${assetBasePath}oxg.png", @@ -559,7 +559,7 @@ class VitalSignDetailsScreen extends StatelessWidget { .PainScale, pageTitle: TranslationBase.of( - context) + context)! .painScale, vitalList: mode .patientVitalSignsHistory, @@ -571,12 +571,12 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) + des: TranslationBase.of(context)! .painScale, imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: TranslationBase.of(context).severe, + unit: TranslationBase.of(context)!.severe, ), ), ], @@ -603,7 +603,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - TranslationBase.of(context).vitalSignEmptyMsg, + TranslationBase.of(context)!.vitalSignEmptyMsg, fontWeight: FontWeight.normal, color: HexColor("#B8382B"), fontSize: SizeConfig.textMultiplier * 2.5, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index cec53580..3defb4c1 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -9,13 +9,13 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class VitalSignDetailsWidget extends StatefulWidget { - final List vitalList; - final String title1; - final String title2; - final String viewKey; + final List? vitalList; + final String? title1; + final String? title2; + final String? viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, this.vitalList, this.title1, this.title2, this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -52,7 +52,7 @@ class _VitalSignDetailsWidgetState extends State { ), ),*/ child: AppText( - TranslationBase.of(context).date, + TranslationBase.of(context)!.date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, @@ -93,7 +93,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -108,8 +108,8 @@ class _VitalSignDetailsWidgetState extends State { /* tableRow.add(TableRow(children: [ ]));*/ - widget.vitalList.forEach((vital) { - var data = vital.toJson()[widget.viewKey]; + widget.vitalList!.forEach((vital) { + var data = vital.toJson()[widget.viewKey!]; DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) @@ -133,7 +133,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${vital.toJson()[widget.viewKey]}', + '${vital.toJson()[widget.viewKey!]}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index 20d5b439..e6312805 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -5,21 +5,21 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; class VitalSignItem extends StatelessWidget { - final String des; + final String? des; final String lastVal; - final String unit; + final String? unit; final String imagePath; - final double height; - final double width; + final double? height; + final double? width; const VitalSignItem( - {Key key, - @required this.des, + {Key? key, + required this.des, this.lastVal = 'N/A', this.unit = '', this.height, this.width, - @required this.imagePath}) + required this.imagePath}) : super(key: key); @override diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 343d0590..622a54e0 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -14,12 +14,12 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { - final vitalSignDetails pageKey; - final String pageTitle; - List VSchart; - PatiantInformtion patient; - String patientType; - String arrivalType; + final vitalSignDetails? pageKey; + final String? pageTitle; + late List VSchart; + PatiantInformtion? patient; + String? patientType; + String? arrivalType; VitalSignItemDetailsScreen( {this.vitalList, @@ -29,7 +29,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { this.patientType, this.arrivalType}); - final List vitalList; + final List? vitalList; @override Widget build(BuildContext context) { @@ -202,13 +202,13 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails.firstName}'s", + "${patient!.firstName ?? patient!.patientDetails!.firstName}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, ), AppText( - TranslationBase.of(context).vitalSign, + TranslationBase.of(context)!.vitalSign, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, @@ -221,7 +221,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { shrinkWrap: true, physics: NeverScrollableScrollPhysics(), children: VSchart.map((chartInfo) { - var vitalListTemp = vitalList.where( + var vitalListTemp = vitalList!.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index ef8049ce..6fff0b1f 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -11,19 +11,19 @@ import 'LineChartCurved.dart'; class VitalSingChartAndDetials extends StatelessWidget { VitalSingChartAndDetials({ - Key key, - @required this.vitalList, - @required this.name, - @required this.viewKey, - @required this.title1, - @required this.title2, + Key? key, + required this.vitalList, + required this.name, + required this.viewKey, + required this.title1, + required this.title2, }) : super(key: key); - final List vitalList; - final String name; - final String viewKey; - final String title1; - final String title2; + final List? vitalList; + final String? name; + final String? viewKey; + final String? title1; + final String? title2; List timeSeriesData = []; @override @@ -58,7 +58,7 @@ class VitalSingChartAndDetials extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).graphDetails, + TranslationBase.of(context)!.graphDetails, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, @@ -91,24 +91,24 @@ class VitalSingChartAndDetials extends StatelessWidget { width: double.infinity, height: MediaQuery.of(context).size.height, child: Center( - child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), + child: AppText(TranslationBase.of(context)!.vitalSignDetailEmpty), ), ); } generateData() { - if (vitalList.length > 0) { - vitalList.reversed.toList().forEach( + if (vitalList!.length > 0) { + vitalList!.reversed.toList().forEach( (element) { DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); - if (element.toJson()[viewKey] != null && - element.toJson()[viewKey]?.toInt() != 0) + if (element.toJson()[viewKey!] != null && + element.toJson()[viewKey!]?.toInt() != 0) timeSeriesData.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.toJson()[viewKey].toDouble(), + element.toJson()[viewKey!].toDouble(), ), ); }, diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index d0416539..50b09c78 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -11,23 +11,23 @@ import 'LineChartCurvedBloodPressure.dart'; class VitalSingChartBloodPressure extends StatelessWidget { VitalSingChartBloodPressure({ - Key key, - @required this.vitalList, - @required this.name, - @required this.viewKey1, - @required this.viewKey2, - @required this.title1, - @required this.title2, - @required this.title3, + Key? key, + required this.vitalList, + required this.name, + required this.viewKey1, + required this.viewKey2, + required this.title1, + required this.title2, + required this.title3, }) : super(key: key); - final List vitalList; - final String name; + final List? vitalList; + final String? name; final String viewKey1; final String viewKey2; - final String title1; - final String title2; - final String title3; + final String? title1; + final String? title2; + final String? title3; List timeSeriesData1 = []; List timeSeriesData2 = []; @@ -63,7 +63,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).graphDetails, + TranslationBase.of(context)!.graphDetails, fontSize: SizeConfig.textMultiplier * 2.3, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -106,14 +106,14 @@ class VitalSingChartBloodPressure extends StatelessWidget { width: double.infinity, height: MediaQuery.of(context).size.height, child: Center( - child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), + child: AppText(TranslationBase.of(context)!.vitalSignDetailEmpty), ), ); } generateData() { - if (vitalList.length > 0) { - vitalList.reversed.toList().forEach( + if (vitalList!.length > 0) { + vitalList!.reversed.toList().forEach( (element) { DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index a3c6e589..402ba483 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -31,7 +31,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; addPrescriptionForm(context, PrescriptionViewModel model, - PatiantInformtion patient, prescription) { + PatiantInformtion? patient, prescription) { showModalBottomSheet( isScrollControlled: true, context: context, @@ -41,24 +41,24 @@ addPrescriptionForm(context, PrescriptionViewModel model, } postProcedure( - {String duration, - String doseTimeIn, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model, - DateTime doseTime, - String doseUnit, - String icdCode, - PatiantInformtion patient, - String patientType}) async { + {required String duration, + required String doseTimeIn, + required String dose, + required String drugId, + String? strength, + required String route, + required String frequency, + String? indication, + String? instruction, + required PrescriptionViewModel model, + required DateTime doseTime, + required String doseUnit, + String? icdCode, + required PatiantInformtion patient, + String? patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List sss = List(); + List sss = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; @@ -93,7 +93,7 @@ postProcedure( class PrescriptionFormWidget extends StatefulWidget { final PrescriptionViewModel model; - PatiantInformtion patient; + PatiantInformtion? patient; List prescriptionList; PrescriptionFormWidget(this.model, this.patient, this.prescriptionList); @@ -102,7 +102,7 @@ class PrescriptionFormWidget extends StatefulWidget { } class _PrescriptionFormWidgetState extends State { - int selectedType; + int? selectedType; TextEditingController durationController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); @@ -114,10 +114,10 @@ class _PrescriptionFormWidgetState extends State { bool visbiltySearch = true; final myController = TextEditingController(); - DateTime selectedDate; + DateTime? selectedDate; dynamic selectedDrug; - int strengthChar; - GetMedicationResponseModel _selectedMedication; + late int strengthChar; + GetMedicationResponseModel? _selectedMedication; GlobalKey key = new GlobalKey>(); @@ -131,7 +131,7 @@ class _PrescriptionFormWidgetState extends State { final GlobalKey formKey = GlobalKey(); final double spaceBetweenTextFileds = 12; - List referToList; + List? referToList; dynamic type; dynamic strength; dynamic route; @@ -144,7 +144,7 @@ class _PrescriptionFormWidgetState extends State { dynamic box; dynamic x; - List indicationList; + List? indicationList; String routeInatial = 'By Mouth'; //PatiantInformtion patient; @@ -152,9 +152,9 @@ class _PrescriptionFormWidgetState extends State { void initState() { super.initState(); selectedType = 1; - referToList = List(); + referToList = []; - indicationList = List(); + indicationList = []; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; @@ -170,19 +170,19 @@ class _PrescriptionFormWidgetState extends State { dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; - indicationList.add(indication1); - indicationList.add(indication2); - indicationList.add(indication3); - indicationList.add(indication4); - indicationList.add(indication5); - indicationList.add(indication6); - indicationList.add(indication7); - indicationList.add(indication8); - indicationList.add(indication9); - indicationList.add(indication10); + indicationList!.add(indication1); + indicationList!.add(indication2); + indicationList!.add(indication3); + indicationList!.add(indication4); + indicationList!.add(indication5); + indicationList!.add(indication6); + indicationList!.add(indication7); + indicationList!.add(indication8); + indicationList!.add(indication9); + indicationList!.add(indication10); } - setSelectedType(int val) { + setSelectedType(int? val) { setState(() { selectedType = val; }); @@ -203,11 +203,11 @@ class _PrescriptionFormWidgetState extends State { return element.icdCode10ID; }); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient.patientMRN, - episodeID: widget.patient.episodeNo.toString(), + patientMRN: widget.patient!.patientMRN, + episodeID: widget.patient!.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: widget.patient.appointmentNo); + appointmentNo: widget.patient!.appointmentNo); //await model.getMedicationList(); if (model.medicationStrengthList.length == 0) { await model.getMedicationStrength(); @@ -263,7 +263,7 @@ class _PrescriptionFormWidgetState extends State { MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .newPrescriptionOrder, fontWeight: FontWeight.w700, fontSize: 20, @@ -306,7 +306,7 @@ class _PrescriptionFormWidgetState extends State { visbiltySearch = true; }, borderColor: Colors.white, - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context)! .searchMedicineNameHere, controller: myController, onSaved: (value) {}, @@ -334,7 +334,7 @@ class _PrescriptionFormWidgetState extends State { // TODO change it secondary button and add loading AppButton( title: TranslationBase.of( - context) + context)! .search, onPressed: () async { await searchMedicine( @@ -389,7 +389,7 @@ class _PrescriptionFormWidgetState extends State { _selectedMedication = model.allMedicationList[ index]; - uom = _selectedMedication + uom = _selectedMedication! .uom; }, ); @@ -417,7 +417,7 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .orderType, fontWeight: FontWeight.w600, ), @@ -426,7 +426,7 @@ class _PrescriptionFormWidgetState extends State { Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (value) { + onChanged: (dynamic value) { setSelectedType(value); }, ), @@ -471,7 +471,7 @@ class _PrescriptionFormWidgetState extends State { DrAppToastMsg .showErrorToast( TranslationBase.of( - context) + context)! .only5DigitsAllowedForStrength, ); } @@ -512,7 +512,7 @@ class _PrescriptionFormWidgetState extends State { attributeValueId: 'parameterCode', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { @@ -542,11 +542,11 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( 'Select', - model.itemMedicineListUnit + model.itemMedicineListUnit! .length == 1 ? units = model - .itemMedicineListUnit[0] + .itemMedicineListUnit![0] [ 'description'] : units != @@ -584,7 +584,7 @@ class _PrescriptionFormWidgetState extends State { 'parameterCode', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { @@ -617,12 +617,12 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of( - context) + context)! .route, - model.itemMedicineListRoute + model.itemMedicineListRoute! .length == 1 - ? model.itemMedicineListRoute[ + ? model.itemMedicineListRoute![ 0] ['description'] : route != null @@ -656,7 +656,7 @@ class _PrescriptionFormWidgetState extends State { 'parameterCode', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { @@ -681,7 +681,7 @@ class _PrescriptionFormWidgetState extends State { duration[ 'id'], itemCode: - _selectedMedication + _selectedMedication! .itemId, strength: double.parse( @@ -708,12 +708,12 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of( - context) + context)! .frequency, - model.itemMedicineList + model.itemMedicineList! .length == 1 - ? model.itemMedicineList[ + ? model.itemMedicineList![ 0] ['description'] : frequency != null @@ -748,7 +748,7 @@ class _PrescriptionFormWidgetState extends State { 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { @@ -774,7 +774,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of( - context) + context)! .doseTime, doseTime != null ? doseTime['nameEn'] @@ -877,7 +877,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of( - context) + context)! .date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" @@ -914,7 +914,7 @@ class _PrescriptionFormWidgetState extends State { 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { @@ -937,7 +937,7 @@ class _PrescriptionFormWidgetState extends State { duration[ 'id'], itemCode: - _selectedMedication + _selectedMedication! .itemId, strength: double.parse( strengthController @@ -967,7 +967,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of( - context) + context)! .duration, duration != null ? duration['nameEn'] @@ -996,7 +996,7 @@ class _PrescriptionFormWidgetState extends State { attributeValueId: 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { @@ -1049,7 +1049,7 @@ class _PrescriptionFormWidgetState extends State { attributeValueId: 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { @@ -1074,12 +1074,12 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of( - context) + context)! .boxQuantity, box != null ? TranslationBase.of( - context) - .boxQuantity + + context)! + .boxQuantity! + ": " + model .boxQuintity @@ -1105,7 +1105,7 @@ class _PrescriptionFormWidgetState extends State { maxLines: 6, minLines: 4, hintText: - TranslationBase.of(context) + TranslationBase.of(context)! .instruction, controller: instructionController, //keyboardType: TextInputType.number, @@ -1122,11 +1122,11 @@ class _PrescriptionFormWidgetState extends State { AppButton( color: Color(0xff359846), title: TranslationBase.of( - context) + context)! .addMedication, fontWeight: FontWeight.w600, onPressed: () { - formKey.currentState.save(); + formKey.currentState!.save(); // Navigator.pop(context); // openDrugToDrug(); if (frequency == null || @@ -1138,16 +1138,16 @@ class _PrescriptionFormWidgetState extends State { selectedDate == null) { DrAppToastMsg.showErrorToast( TranslationBase.of( - context) + context)! .pleaseFillAllFields); return; } - if (_selectedMedication + if (_selectedMedication! .isNarcotic == true) { DrAppToastMsg.showErrorToast( TranslationBase.of( - context) + context)! .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; @@ -1170,7 +1170,7 @@ class _PrescriptionFormWidgetState extends State { return; } - if (formKey.currentState + if (formKey.currentState! .validate()) { Navigator.pop(context); openDrugToDrug(model); @@ -1294,7 +1294,7 @@ class _PrescriptionFormWidgetState extends State { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -1309,8 +1309,8 @@ class _PrescriptionFormWidgetState extends State { } InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -1351,7 +1351,7 @@ class _PrescriptionFormWidgetState extends State { InputDecoration textFieldSelectorDecorationStreangrh( String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -1396,7 +1396,7 @@ class _PrescriptionFormWidgetState extends State { context: context, builder: (context) { return Container( - height: SizeConfig.realScreenHeight * .8, + height: SizeConfig.realScreenHeight! * .8, width: SizeConfig.realScreenWidth, child: SingleChildScrollView( child: Column( @@ -1409,7 +1409,7 @@ class _PrescriptionFormWidgetState extends State { Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), child: AppButton( - title: TranslationBase.of(context).addMedication, + title: TranslationBase.of(context)!.addMedication, onPressed: () { Navigator.pop(context); @@ -1432,7 +1432,7 @@ class _PrescriptionFormWidgetState extends State { doseUnit: model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), - patient: widget.patient, + patient: widget.patient!, doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), @@ -1442,11 +1442,11 @@ class _PrescriptionFormWidgetState extends State { route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: _selectedMedication.itemId.toString(), + drugId: _selectedMedication!.itemId.toString(), strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, - doseTime: selectedDate, + doseTime: selectedDate!, ); // postProcedure( @@ -1502,7 +1502,7 @@ class _PrescriptionFormWidgetState extends State { List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { - prescriptionList[0].entityList.forEach((element) { + prescriptionList[0].entityList!.forEach((element) { if (element.mediSpanGPICode != null) { prescriptionDetails.add({ 'DrugId': element.mediSpanGPICode, @@ -1518,23 +1518,23 @@ class _PrescriptionFormWidgetState extends State { } }); } - if (_selectedMedication.mediSpanGPICode != null) { + if (_selectedMedication!.mediSpanGPICode != null) { prescriptionDetails.add({ - 'DrugId': _selectedMedication.mediSpanGPICode, - 'DrugName': _selectedMedication.description, + 'DrugId': _selectedMedication!.mediSpanGPICode, + 'DrugName': _selectedMedication!.description, 'Dose': strengthController.text, - 'DoseType': model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'].toString() + 'DoseType': model.itemMedicineListUnit!.length == 1 + ? model.itemMedicineListUnit![0]['parameterCode'].toString() : units['parameterCode'].toString(), - 'Unit': model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['description'] + 'Unit': model.itemMedicineListUnit!.length == 1 + ? model.itemMedicineListUnit![0]['description'] : units['description'], - 'FrequencyType': model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'].toString() + 'FrequencyType': model.itemMedicineList!.length == 1 + ? model.itemMedicineList![0]['parameterCode'].toString() : frequency['parameterCode'].toString(), 'Duration': duration['id'].toString(), - 'RouteID': model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'].toString() + 'RouteID': model.itemMedicineListRoute!.length == 1 + ? model.itemMedicineListRoute![0]['parameterCode'].toString() : route['parameterCode'].toString(), 'IsScreen': true }); @@ -1550,7 +1550,7 @@ class _PrescriptionFormWidgetState extends State { // return; // } if (myController.text.length < 3) { - Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + Helpers.showErrorToast(TranslationBase.of(context)!.moreThan3Letter); return; } diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 15abfeb6..439f8b10 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -15,9 +15,9 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; class DrugToDrug extends StatefulWidget { - final PatiantInformtion patient; + final PatiantInformtion? patient; final prescription; - final List listAssessment; + final List? listAssessment; DrugToDrug(this.patient, this.prescription, this.listAssessment); @override _DrugToDrug createState() => _DrugToDrug(); @@ -56,16 +56,16 @@ class _DrugToDrug extends State { ? BaseView( onModelReady: (model3) => model3.getDrugToDrug( model.patientVitalSigns, - widget.listAssessment, + widget.listAssessment!, model2.patientAllergiesList, - widget.patient, + widget.patient!, widget.prescription), builder: (BuildContext context, PrescriptionViewModel model3, Widget child) => NetworkBaseView( baseViewModel: model3, child: Container( - height: SizeConfig.realScreenHeight * .4, + height: SizeConfig.realScreenHeight! * .4, child: new ListView.builder( itemCount: expandableList.length, itemBuilder: (context, i) { @@ -75,7 +75,7 @@ class _DrugToDrug extends State { ' ' + '(' + getDrugInfo(expandableList[i]['level'], - model3) + model3)! .length .toString() + ')', @@ -83,7 +83,7 @@ class _DrugToDrug extends State { fontWeight: FontWeight.bold, ), children: getDrugInfo( - expandableList[i]['level'], model3) + expandableList[i]['level'], model3)! .map((item) { return Container( padding: EdgeInsets.all(10), @@ -94,7 +94,7 @@ class _DrugToDrug extends State { }).toList()); })))) : Container( - height: SizeConfig.realScreenHeight * .45, + height: SizeConfig.realScreenHeight! * .45, child: Center( child: CircularProgressIndicator( valueColor: AlwaysStoppedAnimation(Colors.black), @@ -109,7 +109,7 @@ class _DrugToDrug extends State { } getRequestedData() async { - await model.getPatientVitalSign(widget.patient); + await model.getPatientVitalSign(widget.patient!); await model2.getPatientAllergy(generalGetReqForSOAP); await model2.getMasterLookup(MasterKeysService.DiagnosisType); if (model.state == ViewState.Idle && model2.state == ViewState.Idle) { @@ -119,7 +119,7 @@ class _DrugToDrug extends State { } } - List getDrugInfo(level, model3) { + List? getDrugInfo(level, model3) { return model3.drugToDrug.where((i) => i['Severity'] == level).toList(); } } diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart index 623cee90..5460034e 100644 --- a/lib/screens/prescription/prescription_details_page.dart +++ b/lib/screens/prescription/prescription_details_page.dart @@ -6,15 +6,15 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class PrescriptionDetailsPage extends StatelessWidget { - final PrescriptionReport prescriptionReport; + final PrescriptionReport? prescriptionReport; - PrescriptionDetailsPage({Key key, this.prescriptionReport}); + PrescriptionDetailsPage({Key? key, this.prescriptionReport}); @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + appBarTitle: TranslationBase.of(context)!.prescriptions, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -28,14 +28,14 @@ class PrescriptionDetailsPage extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Row( children: [ ClipRRect( borderRadius: BorderRadius.all(Radius.circular(5)), child: Image.network( - prescriptionReport.imageSRCUrl, + prescriptionReport!.imageSRCUrl!, fit: BoxFit.cover, width: 60, height: 70, @@ -46,9 +46,9 @@ class PrescriptionDetailsPage extends StatelessWidget { padding: const EdgeInsets.all(8.0), child: Center( child: AppText( - prescriptionReport.itemDescription.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN), + prescriptionReport!.itemDescription!.isNotEmpty + ? prescriptionReport!.itemDescription + : prescriptionReport!.itemDescriptionN), ), ), ) @@ -71,7 +71,7 @@ class PrescriptionDetailsPage extends StatelessWidget { width: double.infinity, child: Center( child: AppText( - TranslationBase.of(context).route, + TranslationBase.of(context)!.route, fontSize: 14, ))), Container( @@ -80,7 +80,7 @@ class PrescriptionDetailsPage extends StatelessWidget { width: double.infinity, child: Center( child: AppText( - TranslationBase.of(context).frequency, + TranslationBase.of(context)!.frequency, fontSize: 14, ))), Container( @@ -89,7 +89,7 @@ class PrescriptionDetailsPage extends StatelessWidget { padding: EdgeInsets.symmetric(horizontal: 4), child: Center( child: AppText( - "${TranslationBase.of(context).dailyDoses}", + "${TranslationBase.of(context)!.dailyDoses}", fontSize: 14, ))), Container( @@ -98,7 +98,7 @@ class PrescriptionDetailsPage extends StatelessWidget { width: double.infinity, child: Center( child: AppText( - TranslationBase.of(context).duration, + TranslationBase.of(context)!.duration, fontSize: 14, ))), ], @@ -110,27 +110,27 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 50, width: double.infinity, child: - Center(child: Text(prescriptionReport.routeN))), + Center(child: Text(prescriptionReport!.routeN!))), Container( color: Colors.white, height: 50, width: double.infinity, child: Center( child: - Text(prescriptionReport.frequencyN ?? ''))), + Text(prescriptionReport!.frequencyN ?? ''))), Container( color: Colors.white, height: 50, width: double.infinity, child: Center( child: Text( - '${prescriptionReport.doseDailyQuantity}'))), + '${prescriptionReport!.doseDailyQuantity}'))), Container( color: Colors.white, height: 50, width: double.infinity, child: - Center(child: Text('${prescriptionReport.days}'))) + Center(child: Text('${prescriptionReport!.days}'))) ], ), ], @@ -144,7 +144,7 @@ class PrescriptionDetailsPage extends StatelessWidget { child: Center( child: Column( children: [ - AppText(TranslationBase.of(context).notes), + AppText(TranslationBase.of(context)!.notes), SizedBox( height: 5, ), @@ -155,7 +155,7 @@ class PrescriptionDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - AppText(prescriptionReport.remarks ?? ''), + AppText(prescriptionReport!.remarks ?? ''), ], ), ), diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index b6d27af6..e8b43501 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -13,16 +13,16 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PrescriptionItemsInPatientPage extends StatelessWidget { - final PrescriotionInPatient prescriptions; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final DateTime startOn; - final DateTime stopOn; - final int prescriptionIndex; + final PrescriotionInPatient? prescriptions; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final DateTime? startOn; + final DateTime? stopOn; + final int? prescriptionIndex; PrescriptionItemsInPatientPage( - {Key key, + {Key? key, this.prescriptions, this.patient, this.patientType, @@ -37,7 +37,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { return BaseView( onModelReady: (model) async { if (model.inPatientPrescription.length == 0) { - await model.getPrescriptionsInPatient(patient); + await model.getPrescriptionsInPatient(patient!); } }, builder: (_, model, widget) => AppScaffold( @@ -45,7 +45,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString(), patient.arrivedOn), + patient, patient!.patientType.toString(), patient!.arrivedOn), body: SingleChildScrollView( child: Container( child: Column( @@ -64,7 +64,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Container( margin: EdgeInsets.only(left: 18, right: 18), child: AppText( - model.inPatientPrescription[prescriptionIndex] + model.inPatientPrescription[prescriptionIndex!] .itemDescription, bold: true, ), @@ -89,28 +89,28 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).direction, + TranslationBase.of(context)!.direction, color: Colors.grey, ), Expanded( child: AppText(" " + model .inPatientPrescription[ - prescriptionIndex] - .direction ?? + prescriptionIndex!] + .direction! ?? '')), ], ), Row( children: [ AppText( - TranslationBase.of(context).route, + TranslationBase.of(context)!.route, color: Colors.grey, ), AppText(" " + model .inPatientPrescription[ - prescriptionIndex] + prescriptionIndex!] .route .toString() ?? ''), @@ -119,22 +119,22 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).refill, + TranslationBase.of(context)!.refill, color: Colors.grey, ), Expanded( child: AppText(" " + model .inPatientPrescription[ - prescriptionIndex] - .refillType ?? + prescriptionIndex!] + .refillType! ?? '')), ], ), Row( children: [ AppText( - TranslationBase.of(context).startDate, + TranslationBase.of(context)!.startDate, color: Colors.grey, ), Expanded( @@ -150,7 +150,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).stopDate, + TranslationBase.of(context)!.stopDate, color: Colors.grey, ), Expanded( @@ -172,21 +172,21 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { AppText(" " + model .inPatientPrescription[ - prescriptionIndex] - .unitofMeasurementDescription ?? + prescriptionIndex!] + .unitofMeasurementDescription! ?? ''), ], ), Row( children: [ AppText( - TranslationBase.of(context).dailyDoses, + TranslationBase.of(context)!.dailyDoses, color: Colors.grey, ), AppText(" " + model .inPatientPrescription[ - prescriptionIndex] + prescriptionIndex!] .dose .toString() ?? ''), @@ -195,13 +195,13 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).status, + TranslationBase.of(context)!.status, color: Colors.grey, ), AppText(" " + model .inPatientPrescription[ - prescriptionIndex] + prescriptionIndex!] .statusDescription .toString() ?? ''), @@ -210,27 +210,27 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).processed, + TranslationBase.of(context)!.processed, color: Colors.grey, ), AppText(" " + model .inPatientPrescription[ - prescriptionIndex] - .processedBy ?? + prescriptionIndex!] + .processedBy! ?? ''), ], ), Row( children: [ AppText( - TranslationBase.of(context).dailyDoses, + TranslationBase.of(context)!.dailyDoses, color: Colors.grey, ), AppText(" " + model .inPatientPrescription[ - prescriptionIndex] + prescriptionIndex!] .dose .toString() ?? ''), @@ -241,7 +241,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { ), AppText(model .inPatientPrescription[ - prescriptionIndex] + prescriptionIndex!] .comments ?? ''), ], diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index a68f6f56..ff044334 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -13,17 +13,17 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class PrescriptionItemsPage extends StatelessWidget { - final Prescriptions prescriptions; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); + final Prescriptions? prescriptions; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + PrescriptionItemsPage({Key? key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => - model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), + model.getPrescriptionReport(prescriptions: prescriptions!,patient: patient), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -32,19 +32,19 @@ class PrescriptionItemsPage extends StatelessWidget { patient: patient, patientType: patientType??"0", arrivalType: arrivalType??"0", - clinic: prescriptions.clinicDescription, - branch: prescriptions.name, + clinic: prescriptions!.clinicDescription, + branch: prescriptions!.name, isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, + appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions!.appointmentDate), + doctorName: prescriptions!.doctorName, + profileUrl: prescriptions!.doctorImageURL, ), body: SingleChildScrollView( child: Container( child: Column( children: [ - if (!prescriptions.isInOutPatient) + if (!prescriptions!.isInOutPatient!) ...List.generate( model.prescriptionReportList.length, (index) => Container( @@ -60,7 +60,7 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(left: 18,right: 18), - child: AppText(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), + child: AppText(model.prescriptionReportList[index].itemDescription!.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), SizedBox(height: 12,), Row( children: [ @@ -84,7 +84,7 @@ class PrescriptionItemsPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, + model.prescriptionReportList[index].imageSRCUrl!, fit: BoxFit.cover, ), ), @@ -96,25 +96,25 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ Row( children: [ - AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN)), + AppText(TranslationBase.of(context)!.route,color: Colors.grey,), + Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN!)), ], ), Row( children: [ - AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].frequencyN ?? ''), + AppText(TranslationBase.of(context)!.frequency,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].frequencyN! ?? ''), ], ), Row( children: [ - AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + AppText(TranslationBase.of(context)!.dailyDoses,color: Colors.grey,), AppText(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), ], ), Row( children: [ - AppText(TranslationBase.of(context).duration,color: Colors.grey,), + AppText(TranslationBase.of(context)!.duration,color: Colors.grey,), AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), ], ), @@ -175,7 +175,7 @@ class PrescriptionItemsPage extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, + model.prescriptionReportEnhList[index].imageSRCUrl!, fit: BoxFit.cover, ), @@ -194,25 +194,25 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ Row( children: [ - AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route??'')), + AppText(TranslationBase.of(context)!.route,color: Colors.grey,), + Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route!??'')), ], ), Row( children: [ - AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportEnhList[index].frequency ?? ''), + AppText(TranslationBase.of(context)!.frequency,color: Colors.grey,), + AppText(" "+model.prescriptionReportEnhList[index].frequency! ?? ''), ], ), Row( children: [ - AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + AppText(TranslationBase.of(context)!.dailyDoses,color: Colors.grey,), AppText(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), ], ), Row( children: [ - AppText(TranslationBase.of(context).duration,color: Colors.grey,), + AppText(TranslationBase.of(context)!.duration,color: Colors.grey,), AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), ], ), diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 6608f108..ebaab89d 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -17,12 +17,12 @@ class NewPrescriptionScreen extends StatefulWidget { } class _NewPrescriptionScreenState extends State { - PersistentBottomSheetController _controller; + PersistentBottomSheetController? _controller; final _scaffoldKey = GlobalKey(); TextEditingController strengthController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + int? strengthChar; + PatiantInformtion? patient; @override void initState() { @@ -31,15 +31,15 @@ class _NewPrescriptionScreenState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getPrescription(mrn: patient.patientId), + onModelReady: (model) => model.getPrescription(mrn: patient!.patientId), builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescription, + appBarTitle: TranslationBase.of(context)!.prescription, body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -101,7 +101,7 @@ class _NewPrescriptionScreenState extends State { MainAxisAlignment.center, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .noPrescriptionListed, color: Colors.black, fontWeight: FontWeight.w900, @@ -113,7 +113,7 @@ class _NewPrescriptionScreenState extends State { MainAxisAlignment.center, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .addNow, color: Color(0XFFB8382C), fontWeight: FontWeight.w900, @@ -213,9 +213,9 @@ class _NewPrescriptionScreenState extends State { child: Column( children: [ AppText( - (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != + (DateTime.parse(model.prescriptionList[0].entityList![index].createdOn) != null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) + ? (DateTime.parse(model.prescriptionList[0].entityList![index].createdOn).year) .toString() : DateTime.now() .year) @@ -226,9 +226,9 @@ class _NewPrescriptionScreenState extends State { 13.5, ), AppText( - AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != + AppDateUtils.getMonth(model.prescriptionList[0].entityList![index].createdOn != null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) + ? (DateTime.parse(model.prescriptionList[0].entityList![index].createdOn) .month) : DateTime.now() .month) @@ -240,7 +240,7 @@ class _NewPrescriptionScreenState extends State { DateTime.parse(model .prescriptionList[ 0] - .entityList[ + .entityList![ index] .createdOn) .day @@ -252,7 +252,7 @@ class _NewPrescriptionScreenState extends State { AppDateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] - .entityList[ + .entityList![ index] .createdOn)) .toString(), @@ -291,7 +291,7 @@ class _NewPrescriptionScreenState extends State { AppText( AppDateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] - .entityList[index] + .entityList![index] .startDate)), fontSize: 13.5, @@ -314,7 +314,7 @@ class _NewPrescriptionScreenState extends State { AppText( model .prescriptionList[0] - .entityList[index] + .entityList![index] .orderTypeDescription, fontSize: 13.0, @@ -336,7 +336,7 @@ class _NewPrescriptionScreenState extends State { AppText( model .prescriptionList[0] - .entityList[index] + .entityList![index] .medicationName, fontWeight: FontWeight.w700, @@ -357,7 +357,7 @@ class _NewPrescriptionScreenState extends State { AppText( model .prescriptionList[0] - .entityList[index] + .entityList![index] .doseDetail, fontSize: 15.0, @@ -390,7 +390,7 @@ class _NewPrescriptionScreenState extends State { text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].indication), + text: model.prescriptionList[0].entityList![index].indication), ), ), ], @@ -417,7 +417,7 @@ class _NewPrescriptionScreenState extends State { text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].uom), + text: model.prescriptionList[0].entityList![index].uom), ), ), ], @@ -444,7 +444,7 @@ class _NewPrescriptionScreenState extends State { text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()), + text: model.prescriptionList[0].entityList![index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList![index].quantity.toString()), ), ), ], @@ -471,7 +471,7 @@ class _NewPrescriptionScreenState extends State { text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), + text: model.prescriptionList[0].entityList![index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList![index].pharmacyInervention.toString()), ), ), ], @@ -492,7 +492,7 @@ class _NewPrescriptionScreenState extends State { Expanded( child: AppText( // commening below code because there is an error coming in the model please fix it before pushing it - model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks, + model.prescriptionList[0].entityList![index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList![index].pharmacistRemarks, fontSize: 15.0), ) ], @@ -503,8 +503,8 @@ class _NewPrescriptionScreenState extends State { Row( children: [ AppText( - TranslationBase.of(context) - .doctorName + + TranslationBase.of(context)! + .doctorName! + ": ", fontWeight: FontWeight @@ -515,7 +515,7 @@ class _NewPrescriptionScreenState extends State { AppText( model .prescriptionList[0] - .entityList[index] + .entityList![index] .doctorName, fontWeight: FontWeight.w700, @@ -555,8 +555,8 @@ class _NewPrescriptionScreenState extends State { TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].remarks != null - ? model.prescriptionList[0].entityList[index].remarks + text: model.prescriptionList[0].entityList![index].remarks != null + ? model.prescriptionList[0].entityList![index].remarks : "", ), ), @@ -597,52 +597,52 @@ class _NewPrescriptionScreenState extends State { box: model .prescriptionList[ 0] - .entityList[ + .entityList![ index] .quantity, uom: model .prescriptionList[ 0] - .entityList[ + .entityList![ index] .uom, drugNameGeneric: model .prescriptionList[ 0] - .entityList[ + .entityList![ index] .medicationName, - doseUnit: model.prescriptionList[0].entityList[index].doseDailyUnitID + doseUnit: model.prescriptionList[0].entityList![index].doseDailyUnitID .toString(), - doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity + doseStreangth: model.prescriptionList[0].entityList![index].doseDailyQuantity .toString(), duration: - model.prescriptionList[0].entityList[index].doseDurationDays + model.prescriptionList[0].entityList![index].doseDurationDays .toString(), startDate: - model.prescriptionList[0].entityList[index].startDate + model.prescriptionList[0].entityList![index].startDate .toString(), dose: model .prescriptionList[ 0] - .entityList[ + .entityList![ index] .doseTimingID .toString(), frequency: - model.prescriptionList[0].entityList[index].frequencyID + model.prescriptionList[0].entityList![index].frequencyID .toString(), rouat: model .prescriptionList[0] - .entityList[index] + .entityList![index] .routeID .toString(), patient: patient, - drugId: model.prescriptionList[0].entityList[index].medicineCode, - drugName: model.prescriptionList[0].entityList[index].medicationName, - remarks: model.prescriptionList[0].entityList[index].remarks, + drugId: model.prescriptionList[0].entityList![index].medicineCode, + drugName: model.prescriptionList[0].entityList![index].medicationName, + remarks: model.prescriptionList[0].entityList![index].remarks, model: model, - enteredRemarks: model.prescriptionList[0].entityList[index].remarks, + enteredRemarks: model.prescriptionList[0].entityList![index].remarks, context: context); //model.postPrescription(); }, @@ -698,7 +698,7 @@ class _NewPrescriptionScreenState extends State { MainAxisAlignment.center, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .noPrescriptionListed, color: Colors.black, fontWeight: FontWeight.w900, @@ -710,7 +710,7 @@ class _NewPrescriptionScreenState extends State { MainAxisAlignment.center, children: [ AppText( - TranslationBase.of(context).addNow, + TranslationBase.of(context)!.addNow, color: Color(0XFFB8382C), fontWeight: FontWeight.w900, ), @@ -729,7 +729,7 @@ class _NewPrescriptionScreenState extends State { selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now().add(Duration(hours: 2)), diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart index 5ce98c54..628460d5 100644 --- a/lib/screens/prescription/prescription_screen_history.dart +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -17,12 +17,12 @@ class NewPrescriptionHistoryScreen extends StatefulWidget { class _NewPrescriptionHistoryScreenState extends State { - PersistentBottomSheetController _controller; + PersistentBottomSheetController? _controller; final _scaffoldKey = GlobalKey(); TextEditingController strengthController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + int? strengthChar; + PatiantInformtion? patient; @override void initState() { @@ -31,15 +31,15 @@ class _NewPrescriptionHistoryScreenState Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getPrescription(mrn: patient.patientId), + onModelReady: (model) => model.getPrescription(mrn: patient!.patientId), builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescription, + appBarTitle: TranslationBase.of(context)!.prescription, body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -112,9 +112,9 @@ class _NewPrescriptionHistoryScreenState child: Column( children: [ AppText( - (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != + (DateTime.parse(model.prescriptionList[0].entityList![index].createdOn) != null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) + ? (DateTime.parse(model.prescriptionList[0].entityList![index].createdOn).year) .toString() : DateTime.now() .year) @@ -125,9 +125,9 @@ class _NewPrescriptionHistoryScreenState 13.5, ), AppText( - AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != + AppDateUtils.getMonth(model.prescriptionList[0].entityList![index].createdOn != null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) + ? (DateTime.parse(model.prescriptionList[0].entityList![index].createdOn) .month) : DateTime.now() .month) @@ -139,7 +139,7 @@ class _NewPrescriptionHistoryScreenState DateTime.parse(model .prescriptionList[ 0] - .entityList[ + .entityList![ index] .createdOn) .day @@ -151,7 +151,7 @@ class _NewPrescriptionHistoryScreenState AppDateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] - .entityList[ + .entityList![ index] .createdOn)) .toString(), @@ -189,7 +189,7 @@ class _NewPrescriptionHistoryScreenState AppText( AppDateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] - .entityList[index] + .entityList![index] .startDate)), fontSize: 13.5, @@ -212,7 +212,7 @@ class _NewPrescriptionHistoryScreenState AppText( model .prescriptionList[0] - .entityList[index] + .entityList![index] .orderTypeDescription, fontSize: 13.0, @@ -232,7 +232,7 @@ class _NewPrescriptionHistoryScreenState AppText( model .prescriptionList[0] - .entityList[index] + .entityList![index] .medicationName, fontWeight: FontWeight.w700, @@ -253,7 +253,7 @@ class _NewPrescriptionHistoryScreenState AppText( model .prescriptionList[0] - .entityList[index] + .entityList![index] .doseDetail, fontSize: 15.0, @@ -286,7 +286,7 @@ class _NewPrescriptionHistoryScreenState text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].indication), + text: model.prescriptionList[0].entityList![index].indication), ), ), ], @@ -313,7 +313,7 @@ class _NewPrescriptionHistoryScreenState text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].uom), + text: model.prescriptionList[0].entityList![index].uom), ), ), ], @@ -340,7 +340,7 @@ class _NewPrescriptionHistoryScreenState text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()), + text: model.prescriptionList[0].entityList![index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList![index].quantity.toString()), ), ), ], @@ -367,7 +367,7 @@ class _NewPrescriptionHistoryScreenState text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), + text: model.prescriptionList[0].entityList![index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList![index].pharmacyInervention.toString()), ), ), ], @@ -388,7 +388,7 @@ class _NewPrescriptionHistoryScreenState Expanded( child: AppText( // commening below code because there is an error coming in the model please fix it before pushing it - model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks, + model.prescriptionList[0].entityList![index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList![index].pharmacistRemarks, fontSize: 15.0), ) ], @@ -399,8 +399,8 @@ class _NewPrescriptionHistoryScreenState Row( children: [ AppText( - TranslationBase.of(context) - .doctorName + + TranslationBase.of(context)! + .doctorName! + ": ", fontWeight: FontWeight @@ -411,7 +411,7 @@ class _NewPrescriptionHistoryScreenState AppText( model .prescriptionList[0] - .entityList[index] + .entityList![index] .doctorName, fontWeight: FontWeight.w700, @@ -449,8 +449,8 @@ class _NewPrescriptionHistoryScreenState TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].remarks != null - ? model.prescriptionList[0].entityList[index].remarks + text: model.prescriptionList[0].entityList![index].remarks != null + ? model.prescriptionList[0].entityList![index].remarks : "", ), ), @@ -500,7 +500,7 @@ class _NewPrescriptionHistoryScreenState selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now().add(Duration(hours: 2)), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index a7367cf3..d1f5c17d 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -21,16 +21,16 @@ import 'package:provider/provider.dart'; class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - bool isInpatient = routeArgs['isInpatient']; - bool isSelectInpatient = routeArgs['isSelectInpatient']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; + bool? isInpatient = routeArgs['isInpatient']; + bool? isSelectInpatient = routeArgs['isSelectInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => isSelectInpatient - ? model.getPrescriptionsInPatient(patient) + onModelReady: (model) => isSelectInpatient! + ? model.getPrescriptionsInPatient(patient!) : model.getPrescriptions(patient, patientType: patientType), builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -42,7 +42,7 @@ class PrescriptionsPage extends StatelessWidget { arrivalType, isInpatient: isInpatient, ), - body: patient.admissionNo == null + body: patient!.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, child: ListView( @@ -59,13 +59,13 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).orders, + TranslationBase.of(context)!.orders, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - TranslationBase.of(context).prescriptions, + TranslationBase.of(context)!.prescriptions, bold: true, fontSize: 22, ), @@ -80,13 +80,13 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).orders, + TranslationBase.of(context)!.orders, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - TranslationBase.of(context).prescriptions, + TranslationBase.of(context)!.prescriptions, bold: true, fontSize: 22, ), @@ -100,7 +100,7 @@ class PrescriptionsPage extends StatelessWidget { addPrescriptionForm(context, model, patient, model.prescriptionList); }, - label: TranslationBase.of(context) + label: TranslationBase.of(context)! .applyForNewPrescriptionsOrder, ), ...List.generate( @@ -145,7 +145,7 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) + child: AppText(TranslationBase.of(context)! .noPrescriptionsFound), ) ], @@ -215,7 +215,7 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) + child: AppText(TranslationBase.of(context)! .noPrescriptionsFound), ) ], diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 01ba6a91..2f1ee258 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -23,23 +23,23 @@ import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; class UpdatePrescriptionForm extends StatefulWidget { - final String drugName; - final String doseStreangth; - final int drugId; - final String remarks; - final PatiantInformtion patient; - final String duration; - final String route; - final String dose; - final String doseUnit; - final String enteredRemarks; - final String startDate; - final String frequency; - final String drugNameGeneric; - final String uom; - final int box; + final String? drugName; + final String? doseStreangth; + final int? drugId; + final String? remarks; + final PatiantInformtion? patient; + final String? duration; + final String? route; + final String? dose; + final String? doseUnit; + final String? enteredRemarks; + final String? startDate; + final String? frequency; + final String? drugNameGeneric; + final String? uom; + final int? box; - final PrescriptionViewModel model; + final PrescriptionViewModel? model; UpdatePrescriptionForm( {this.drugName, @@ -66,25 +66,25 @@ class _UpdatePrescriptionFormState extends State { TextEditingController strengthController = TextEditingController(); TextEditingController remarksController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + late int strengthChar; + PatiantInformtion? patient; dynamic route; dynamic doseTime; dynamic frequencyUpdate; dynamic updatedDuration; dynamic units; - GetMedicationResponseModel newSelectedMedication; + GetMedicationResponseModel? newSelectedMedication; GlobalKey key = new GlobalKey>(); - List indicationList; + List? indicationList; dynamic indication; - DateTime selectedDate; + DateTime? selectedDate; @override void initState() { super.initState(); - strengthController.text = widget.doseStreangth; - remarksController.text = widget.remarks; - indicationList = List(); + strengthController.text = widget.doseStreangth!; + remarksController.text = widget.remarks!; + indicationList = []; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; @@ -100,16 +100,16 @@ class _UpdatePrescriptionFormState extends State { dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; - indicationList.add(indication1); - indicationList.add(indication2); - indicationList.add(indication3); - indicationList.add(indication4); - indicationList.add(indication5); - indicationList.add(indication6); - indicationList.add(indication7); - indicationList.add(indication8); - indicationList.add(indication9); - indicationList.add(indication10); + indicationList!.add(indication1); + indicationList!.add(indication2); + indicationList!.add(indication3); + indicationList!.add(indication4); + indicationList!.add(indication5); + indicationList!.add(indication6); + indicationList!.add(indication7); + indicationList!.add(indication8); + indicationList!.add(indication9); + indicationList!.add(indication10); } @override @@ -128,13 +128,13 @@ class _UpdatePrescriptionFormState extends State { await model.getItem(itemID: widget.drugId); //await model.getMedicationIndications(); route = model.getLookupByIdFilter( - model.itemMedicineListRoute, widget.route); + model.itemMedicineListRoute!, widget.route); doseTime = model.getLookupById(model.medicationDoseTimeList, widget.dose); updatedDuration = model.getLookupById( model.medicationDurationList, widget.duration); units = model.getLookupByIdFilter( - model.itemMedicineListUnit, widget.doseUnit); + model.itemMedicineListUnit!, widget.doseUnit); frequencyUpdate = model.getLookupById( model.medicationFrequencyList, widget.frequency); }, @@ -163,7 +163,7 @@ class _UpdatePrescriptionFormState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - widget.drugName.toUpperCase(), + widget.drugName!.toUpperCase(), fontWeight: FontWeight.w900, ), SizedBox( @@ -320,7 +320,7 @@ class _UpdatePrescriptionFormState extends State { 'parameterCode', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { @@ -378,7 +378,7 @@ class _UpdatePrescriptionFormState extends State { attributeValueId: 'parameterCode', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { setState(() { @@ -430,7 +430,7 @@ class _UpdatePrescriptionFormState extends State { attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { setState(() { @@ -451,7 +451,7 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context) + TranslationBase.of(context)! .doseTime, doseTime != null ? doseTime['nameEn'] @@ -480,7 +480,7 @@ class _UpdatePrescriptionFormState extends State { attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { setState(() { @@ -502,7 +502,7 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context) + TranslationBase.of(context)! .frequency, frequencyUpdate != null ? frequencyUpdate[ @@ -532,7 +532,7 @@ class _UpdatePrescriptionFormState extends State { attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { setState(() { @@ -554,7 +554,7 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context) + TranslationBase.of(context)! .duration, updatedDuration != null ? updatedDuration[ @@ -667,7 +667,7 @@ class _UpdatePrescriptionFormState extends State { .textFieldSelectorDecoration( AppDateUtils.getDateFormatted( DateTime.parse( - widget.startDate)), + widget.startDate!)), selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -695,7 +695,7 @@ class _UpdatePrescriptionFormState extends State { attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { setState(() { @@ -738,7 +738,7 @@ class _UpdatePrescriptionFormState extends State { attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { setState(() { @@ -835,11 +835,11 @@ class _UpdatePrescriptionFormState extends State { ? strengthController .text : widget - .doseStreangth, + .doseStreangth!, newUnit: units != null ? units['parameterCode'] .toString() - : widget.doseUnit, + : widget.doseUnit!, doseUnit: widget.doseUnit, doseStreangth: widget.doseStreangth, @@ -848,30 +848,30 @@ class _UpdatePrescriptionFormState extends State { doseId: widget.dose, frequencyId: widget.frequency, routeId: widget.route, - patient: widget.patient, - model: widget.model, + patient: widget.patient!, + model: widget.model!, newDuration: updatedDuration != null ? updatedDuration['id'] .toString() - : widget.duration, + : widget.duration!, drugId: widget.drugId, remarks: remarksController .text, route: route != null ? route['parameterCode'] .toString() - : widget.route, + : widget.route!, frequency: frequencyUpdate != null ? frequencyUpdate[ 'id'] .toString() - : widget.frequency, + : widget.frequency!, dose: doseTime != null ? doseTime['id'] .toString() - : widget.dose, + : widget.dose!, enteredRemarks: widget.enteredRemarks); Navigator.pop(context); @@ -894,11 +894,11 @@ class _UpdatePrescriptionFormState extends State { }); } - selectDate(BuildContext context, PrescriptionViewModel model) async { + selectDate(BuildContext context, PrescriptionViewModel? model) async { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -913,8 +913,8 @@ class _UpdatePrescriptionFormState extends State { } InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -945,30 +945,30 @@ class _UpdatePrescriptionFormState extends State { } updatePrescription( - {PrescriptionViewModel model, - int drugId, - String newDrugId, - String frequencyId, - String remarks, - String dose, - String doseId, - String frequency, - String route, - String routeId, - String startDate, - DateTime newStartDate, - String doseUnit, - String doseStreangth, - String newDoseStreangth, - String duration, - String newDuration, - String newUnit, - String enteredRemarks, - PatiantInformtion patient}) async { + {required PrescriptionViewModel model, + int? drugId, + String? newDrugId, + String? frequencyId, + required String remarks, + required String dose, + String? doseId, + required String frequency, + required String route, + String? routeId, + String? startDate, + DateTime? newStartDate, + String? doseUnit, + String? doseStreangth, + required String newDoseStreangth, + String? duration, + required String newDuration, + required String newUnit, + String? enteredRemarks, + required PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); PostPrescriptionReqModel updatePrescriptionReqModel = new PostPrescriptionReqModel(); - List sss = List(); + List sss = []; updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; updatePrescriptionReqModel.clinicID = patient.clinicId; @@ -979,22 +979,22 @@ class _UpdatePrescriptionFormState extends State { covered: true, dose: newDoseStreangth.isNotEmpty ? double.parse(newDoseStreangth) - : double.parse(doseStreangth), + : double.parse(doseStreangth!), //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, doseUnitId: - newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), - route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), + newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit!), + route: route.isNotEmpty ? int.parse(route) : int.parse(routeId!), frequency: frequency.isNotEmpty ? int.parse(frequency) - : int.parse(frequencyId), + : int.parse(frequencyId!), remarks: remarks.isEmpty ? enteredRemarks : remarks, approvalRequired: true, icdcode10Id: "test2", - doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), + doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId!), duration: newDuration.isNotEmpty ? int.parse(newDuration) - : int.parse(duration), + : int.parse(duration!), doseStartDate: newStartDate != null ? newStartDate.toIso8601String() : startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; @@ -1012,23 +1012,23 @@ class _UpdatePrescriptionFormState extends State { } void updatePrescriptionForm( - {context, - String drugName, - String drugNameGeneric, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient, - String rouat, - String frequency, - String dose, - String duration, - String doseStreangth, - String doseUnit, - String enteredRemarks, - String uom, - int box, - String startDate}) { + {required context, + String? drugName, + String? drugNameGeneric, + int? drugId, + String? remarks, + PrescriptionViewModel? model, + PatiantInformtion? patient, + String? rouat, + String? frequency, + String? dose, + String? duration, + String? doseStreangth, + String? doseUnit, + String? enteredRemarks, + String? uom, + int? box, + String? startDate}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index f18422ee..91876370 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -10,15 +10,15 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { - final Function onTap; - final EntityList entityList; - final String categoryName; - final int categoryID; - final PatiantInformtion patient; - final String doctorName; + final Function? onTap; + final EntityList? entityList; + final String? categoryName; + final int? categoryID; + final PatiantInformtion? patient; + final String? doctorName; const ProcedureCard({ - Key key, + Key? key, this.onTap, this.entityList, this.categoryID, @@ -52,7 +52,7 @@ class ProcedureCard extends StatelessWidget { bottomLeft: Radius.circular(10), ), color: - entityList.orderType == 0 ? Colors.black : Colors.red[500], + entityList!.orderType == 0 ? Colors.black : Colors.red[500], ), ), Expanded( @@ -72,10 +72,10 @@ class ProcedureCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - entityList.orderType == 0 + entityList!.orderType == 0 ? 'Routine' : 'Urgent', - color: entityList.orderType == 0 + color: entityList!.orderType == 0 ? Colors.black : Colors.red[800], fontWeight: FontWeight.w600, @@ -84,7 +84,7 @@ class ProcedureCard extends StatelessWidget { height: 5, ), AppText( - entityList.procedureName, + entityList!.procedureName, bold: true, fontSize: 14, ), @@ -99,13 +99,13 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList!.orderDate!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList!.orderDate!))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -117,13 +117,13 @@ class ProcedureCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).orderNo, + TranslationBase.of(context)!.orderNo, //color: Colors.grey, fontSize: 12, color: Colors.grey, ), AppText( - entityList.orderNo.toString(), + entityList!.orderNo.toString(), fontSize: 12, bold: true, ), @@ -132,13 +132,13 @@ class ProcedureCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).doctorName + ": ", + TranslationBase.of(context)!.doctorName! + ": ", //color: Colors.grey, fontSize: 12, color: Colors.grey, ), AppText( - entityList.doctorName.toString(), + entityList!.doctorName.toString(), fontSize: 12, bold: true, ), @@ -147,13 +147,13 @@ class ProcedureCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).clinic + ": ", + TranslationBase.of(context)!.clinic! + ": ", //color: Colors.grey, fontSize: 12, color: Colors.grey, ), AppText( - entityList.clinicDescription ?? "", + entityList!.clinicDescription ?? "", bold: true, fontSize: 12, ), diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index df748922..19e00ca7 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -32,11 +32,11 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + String? remarks, + String? orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); @@ -44,7 +44,7 @@ postProcedure( procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -53,7 +53,7 @@ postProcedure( entityList.forEach((element) { procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + List controls = []; controls.add( Controls( code: "remarks", @@ -71,7 +71,7 @@ postProcedure( postProcedureReqModel.procedures = controlsProcedure; await model.valadteProcedure(procedureValadteRequestModel); if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { + if (model.valadteProcedureList[0].entityList!.length == 0) { await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { @@ -86,7 +86,7 @@ postProcedure( model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -108,10 +108,10 @@ void addSelectedProcedure( } class AddSelectedProcedure extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; + final ProcedureViewModel? model; + final PatiantInformtion? patient; - const AddSelectedProcedure({Key key, this.model, this.patient}) + const AddSelectedProcedure({Key? key, this.model, this.patient}) : super(key: key); @override _AddSelectedProcedureState createState() => @@ -119,14 +119,14 @@ class AddSelectedProcedure extends StatefulWidget { } class _AddSelectedProcedureState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; + int? selectedType; + ProcedureViewModel? model; + PatiantInformtion? patient; _AddSelectedProcedureState({this.patient, this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -165,7 +165,7 @@ class _AddSelectedProcedureState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, @@ -188,7 +188,7 @@ class _AddSelectedProcedureState extends State { Container( width: MediaQuery.of(context).size.width * 0.85, child: AppTextFieldCustom( - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context)! .searchProcedureHere, isTextFieldHasSuffix: false, @@ -207,7 +207,7 @@ class _AddSelectedProcedureState extends State { categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context)! .atLeastThreeCharacters, ); }, @@ -224,7 +224,7 @@ class _AddSelectedProcedureState extends State { categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context)! .atLeastThreeCharacters, ); }, @@ -321,7 +321,7 @@ class _AddSelectedProcedureState extends State { EntityListCheckboxSearchWidget( model: widget.model, masterList: - widget.model.categoriesList[0].entityList, + widget.model!.categoriesList[0].entityList, removeHistory: (item) { setState(() { entityList.remove(item); @@ -421,7 +421,7 @@ class _AddSelectedProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context).addSelectedProcedures, + title: TranslationBase.of(context)!.addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { @@ -429,7 +429,7 @@ class _AddSelectedProcedureState extends State { onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context)! .fillTheMandatoryProcedureDetails, ); return; @@ -439,8 +439,8 @@ class _AddSelectedProcedureState extends State { postProcedure( orderType: selectedType.toString(), entityList: entityList, - patient: patient, - model: widget.model, + patient: patient!, + model: widget.model!, remarks: remarksController.text); }, ), @@ -462,7 +462,7 @@ class _AddSelectedProcedureState extends State { InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index 4a20dbaa..4e0500a1 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -29,11 +29,11 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + String? remarks, + String? orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); @@ -41,7 +41,7 @@ postProcedure( procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -50,7 +50,7 @@ postProcedure( entityList.forEach((element) { procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + List controls = []; controls.add( Controls( code: "remarks", @@ -68,7 +68,7 @@ postProcedure( postProcedureReqModel.procedures = controlsProcedure; await model.valadteProcedure(procedureValadteRequestModel); if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { + if (model.valadteProcedureList[0].entityList!.length == 0) { await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { @@ -83,7 +83,7 @@ postProcedure( model.getLabs(patient); } else if (model.state == ViewState.Idle) { Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -105,10 +105,10 @@ void addSelectedLabOrder( } class AddSelectedLabOrder extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; + final ProcedureViewModel? model; + final PatiantInformtion? patient; - const AddSelectedLabOrder({Key key, this.model, this.patient}) + const AddSelectedLabOrder({Key? key, this.model, this.patient}) : super(key: key); @override _AddSelectedLabOrderState createState() => @@ -116,14 +116,14 @@ class AddSelectedLabOrder extends StatefulWidget { } class _AddSelectedLabOrderState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; + int? selectedType; + ProcedureViewModel? model; + PatiantInformtion? patient; _AddSelectedLabOrderState({this.patient, this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; dynamic selectedCategory; @@ -161,7 +161,7 @@ class _AddSelectedLabOrderState extends State { Row( children: [ AppText( - TranslationBase.of(context).applyForNewLabOrder, + TranslationBase.of(context)!.applyForNewLabOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -182,13 +182,13 @@ class _AddSelectedLabOrderState extends State { SizedBox( height: 10.0, ), - if (widget.model.categoriesList.length != 0) + if (widget.model!.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, masterList: - widget.model.categoriesList[0].entityList, + widget.model!.categoriesList[0].entityList, removeHistory: (item) { setState(() { entityList.remove(item); @@ -219,7 +219,7 @@ class _AddSelectedLabOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context) + title: TranslationBase.of(context)! .addLabOrder, //TranslationBase.of(context) fontWeight: FontWeight.w700, //.addSelectedProcedures, @@ -229,7 +229,7 @@ class _AddSelectedLabOrderState extends State { onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context)! .fillTheMandatoryProcedureDetails, ); return; @@ -239,8 +239,8 @@ class _AddSelectedLabOrderState extends State { postProcedure( orderType: selectedType.toString(), entityList: entityList, - patient: patient, - model: widget.model, + patient: patient!, + model: widget.model!, remarks: remarksController.text); }, ), @@ -262,7 +262,7 @@ class _AddSelectedLabOrderState extends State { InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 3f19e7f9..ddc4f331 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -29,11 +29,11 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + String? remarks, + String? orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); @@ -41,7 +41,7 @@ postProcedure( procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -50,7 +50,7 @@ postProcedure( entityList.forEach((element) { procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + List controls = []; controls.add( Controls( code: "remarks", @@ -68,7 +68,7 @@ postProcedure( postProcedureReqModel.procedures = controlsProcedure; await model.valadteProcedure(procedureValadteRequestModel); if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { + if (model.valadteProcedureList[0].entityList!.length == 0) { await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { @@ -83,7 +83,7 @@ postProcedure( model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -105,10 +105,10 @@ void addSelectedRadiologyOrder( } class AddSelectedRadiologyOrder extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; + final ProcedureViewModel? model; + final PatiantInformtion? patient; - const AddSelectedRadiologyOrder({Key key, this.model, this.patient}) + const AddSelectedRadiologyOrder({Key? key, this.model, this.patient}) : super(key: key); @override _AddSelectedRadiologyOrderState createState() => @@ -116,14 +116,14 @@ class AddSelectedRadiologyOrder extends StatefulWidget { } class _AddSelectedRadiologyOrderState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; + int? selectedType; + ProcedureViewModel? model; + PatiantInformtion? patient; _AddSelectedRadiologyOrderState({this.patient, this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; dynamic selectedCategory; @@ -162,7 +162,7 @@ class _AddSelectedRadiologyOrderState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context).newRadiologyOrder, + TranslationBase.of(context)!.newRadiologyOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -180,13 +180,13 @@ class _AddSelectedRadiologyOrderState extends State { SizedBox( height: 10.0, ), - if (widget.model.categoriesList.length != 0) + if (widget.model!.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, masterList: - widget.model.categoriesList[0].entityList, + widget.model!.categoriesList[0].entityList, removeHistory: (item) { setState(() { entityList.remove(item); @@ -217,14 +217,14 @@ class _AddSelectedRadiologyOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context).addRadiologyOrder, + title: TranslationBase.of(context)!.addRadiologyOrder, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { //print(entityList.toString()); onPressed: if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context) + DrAppToastMsg.showErrorToast(TranslationBase.of(context)! .fillTheMandatoryProcedureDetails); return; } @@ -233,8 +233,8 @@ class _AddSelectedRadiologyOrderState extends State { postProcedure( orderType: selectedType.toString(), entityList: entityList, - patient: patient, - model: widget.model, + patient: patient!, + model: widget.model!, remarks: remarksController.text); }, ), @@ -256,7 +256,7 @@ class _AddSelectedRadiologyOrderState extends State { InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 801c730c..8c553931 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -10,17 +10,17 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class EntityListCheckboxSearchWidget extends StatefulWidget { - final ProcedureViewModel model; - final Function addSelectedHistories; - final Function(EntityList) removeHistory; - final Function(EntityList) addHistory; - final Function(EntityList) addRemarks; + final ProcedureViewModel? model; + final Function? addSelectedHistories; + final Function(EntityList)? removeHistory; + final Function(EntityList)? addHistory; + final Function(EntityList)? addRemarks; - final bool Function(EntityList) isEntityListSelected; - final List masterList; + final bool Function(EntityList)? isEntityListSelected; + final List? masterList; EntityListCheckboxSearchWidget( - {Key key, + {Key? key, this.model, this.addSelectedHistories, this.removeHistory, @@ -37,23 +37,23 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { - int selectedType = 0; - int typeUrgent; - int typeRegular; + int? selectedType = 0; + int? typeUrgent; + int? typeRegular; - setSelectedType(int val) { + setSelectedType(int? val) { setState(() { selectedType = val; }); } - List items = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List remarksList = []; + List typeList = []; @override void initState() { - items.addAll(widget.masterList); + items.addAll(widget.masterList!); super.initState(); } @@ -76,7 +76,7 @@ class _EntityListCheckboxSearchWidgetState child: ListView( children: [ TextFields( - hintText: TranslationBase.of(context).searchProcedures, + hintText: TranslationBase.of(context)!.searchProcedures, suffixIcon: EvaIcons.search, suffixIconColor: Color(0xff2B353E), onChanged: (value) { @@ -96,18 +96,18 @@ class _EntityListCheckboxSearchWidgetState title: Row( children: [ Checkbox( - value: widget.isEntityListSelected( + value: widget.isEntityListSelected!( historyInfo), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( + if (widget.isEntityListSelected!( historyInfo)) { - widget.removeHistory( + widget.removeHistory!( historyInfo); } else { widget - .addHistory(historyInfo); + .addHistory!(historyInfo); } }); }), @@ -142,7 +142,7 @@ class _EntityListCheckboxSearchWidgetState horizontal: 11), child: AppText( TranslationBase.of( - context) + context)! .orderType, fontWeight: FontWeight.w700, @@ -158,7 +158,7 @@ class _EntityListCheckboxSearchWidgetState Color(0xFFD02127), value: 0, groupValue: selectedType, - onChanged: (value) { + onChanged: (dynamic value) { historyInfo.type = setSelectedType(value) .toString(); @@ -177,7 +177,7 @@ class _EntityListCheckboxSearchWidgetState Color(0xFFD02127), groupValue: selectedType, value: 1, - onChanged: (value) { + onChanged: (dynamic value) { historyInfo.type = setSelectedType(value) .toString(); @@ -187,7 +187,7 @@ class _EntityListCheckboxSearchWidgetState }, ), AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .urgent, color: Color(0xff575757), fontWeight: FontWeight.w600, @@ -205,7 +205,7 @@ class _EntityListCheckboxSearchWidgetState padding: EdgeInsets.symmetric( horizontal: 12, vertical: 12.0), child: TextFields( - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context)! .remarks, //controller: remarksController, onChanged: (value) { @@ -244,12 +244,12 @@ class _EntityListCheckboxSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); - dummySearchList.addAll(widget.masterList); + List dummySearchList = []; + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -261,7 +261,7 @@ class _EntityListCheckboxSearchWidgetState } else { setState(() { items.clear(); - items.addAll(widget.masterList); + items.addAll(widget.masterList!); }); } } diff --git a/lib/screens/procedures/entity_list_procedure_widget.dart b/lib/screens/procedures/entity_list_procedure_widget.dart index 125262e4..505c263e 100644 --- a/lib/screens/procedures/entity_list_procedure_widget.dart +++ b/lib/screens/procedures/entity_list_procedure_widget.dart @@ -10,17 +10,17 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProcedureListWidget extends StatefulWidget { - final ProcedureViewModel model; - final Function addSelectedHistories; - final Function(EntityList) removeHistory; - final Function(EntityList) addHistory; - final Function(EntityList) addRemarks; + final ProcedureViewModel? model; + final Function? addSelectedHistories; + final Function(EntityList)? removeHistory; + final Function(EntityList)? addHistory; + final Function(EntityList)? addRemarks; - final bool Function(EntityList) isEntityListSelected; - final List masterList; + final bool Function(EntityList)? isEntityListSelected; + final List? masterList; ProcedureListWidget( - {Key key, + {Key? key, this.model, this.addSelectedHistories, this.removeHistory, @@ -36,8 +36,8 @@ class ProcedureListWidget extends StatefulWidget { class _ProcedureListWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + int? typeUrgent; + int? typeRegular; setSelectedType(int val) { setState(() { @@ -45,13 +45,13 @@ class _ProcedureListWidgetState extends State { }); } - List items = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List remarksList = []; + List typeList = []; @override void initState() { - items.addAll(widget.masterList); + items.addAll(widget.masterList!); super.initState(); } @@ -74,7 +74,7 @@ class _ProcedureListWidgetState extends State { child: ListView( children: [ TextFields( - hintText: TranslationBase.of(context).searchProcedures, + hintText: TranslationBase.of(context)!.searchProcedures, suffixIcon: EvaIcons.search, onChanged: (value) { filterSearchResults(value); @@ -91,17 +91,17 @@ class _ProcedureListWidgetState extends State { Row( children: [ Checkbox( - value: widget.isEntityListSelected( + value: widget.isEntityListSelected!( historyInfo), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( + if (widget.isEntityListSelected!( historyInfo)) { widget - .removeHistory(historyInfo); + .removeHistory!(historyInfo); } else { - widget.addHistory(historyInfo); + widget.addHistory!(historyInfo); } }); }), @@ -144,12 +144,12 @@ class _ProcedureListWidgetState extends State { } void filterSearchResults(String query) { - List dummySearchList = List(); - dummySearchList.addAll(widget.masterList); + List dummySearchList = []; + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -161,7 +161,7 @@ class _ProcedureListWidgetState extends State { } else { setState(() { items.clear(); - items.addAll(widget.masterList); + items.addAll(widget.masterList!); }); } } diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 7e18055d..8bff2826 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -16,24 +16,24 @@ import 'package:flutter/material.dart'; import 'ProcedureCard.dart'; class ProcedureScreen extends StatelessWidget { - String doctorNameP; + String? doctorNameP; void initState() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile as Map); doctorNameP = doctorProfile.doctorName; } @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - bool isInpatient = routeArgs['isInpatient']; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + PatiantInformtion? patient = routeArgs['patient']; + String? patientType = routeArgs['patientType']; + String? arrivalType = routeArgs['arrivalType']; + bool? isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getProcedure( - mrn: patient.patientId, + mrn: patient!.patientId, patientType: patientType, ), builder: (BuildContext context, ProcedureViewModel model, Widget child) => @@ -56,27 +56,27 @@ class ProcedureScreen extends StatelessWidget { height: 12, ), if (model.procedureList.length == 0 && - patient.patientStatusType != 43) + patient!.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).orderTestOr, + TranslationBase.of(context)!.orderTestOr, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - TranslationBase.of(context).procedure, + TranslationBase.of(context)!.procedure, bold: true, fontSize: 22, ), ], ), ), - if (patient.patientStatusType != null && + if (patient!.patientStatusType != null && patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), @@ -84,13 +84,13 @@ class ProcedureScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).orderTestOr, + TranslationBase.of(context)!.orderTestOr, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - TranslationBase.of(context).procedure, + TranslationBase.of(context)!.procedure, bold: true, fontSize: 22, ), @@ -141,7 +141,7 @@ class ProcedureScreen extends StatelessWidget { height: 10, ), AppText( - TranslationBase.of(context).addMoreProcedure, + TranslationBase.of(context)!.addMoreProcedure, color: Colors.grey[600], fontWeight: FontWeight.w600, ) @@ -153,33 +153,33 @@ class ProcedureScreen extends StatelessWidget { ), if (model.procedureList.isNotEmpty) ...List.generate( - model.procedureList[0].rowcount, + model.procedureList[0].rowcount!, (index) => ProcedureCard( categoryID: - model.procedureList[0].entityList[index].categoryID, - entityList: model.procedureList[0].entityList[index], + model.procedureList[0].entityList![index].categoryID, + entityList: model.procedureList[0].entityList![index], onTap: () { - if (model.procedureList[0].entityList[index].categoryID == + if (model.procedureList[0].entityList![index].categoryID == 2 || - model.procedureList[0].entityList[index].categoryID == 4) + model.procedureList[0].entityList![index].categoryID == 4) updateProcedureForm(context, model: model, patient: patient, remarks: model - .procedureList[0].entityList[index].remarks, + .procedureList[0].entityList![index].remarks, orderType: model - .procedureList[0].entityList[index].orderType + .procedureList[0].entityList![index].orderType .toString(), orderNo: model - .procedureList[0].entityList[index].orderNo, + .procedureList[0].entityList![index].orderNo, procedureName: model.procedureList[0] - .entityList[index].procedureName, + .entityList![index].procedureName, categoreId: model - .procedureList[0].entityList[index].categoryID + .procedureList[0].entityList![index].categoryID .toString(), procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0].entityList[index] + .entityList![index].procedureId, + limetNo: model.procedureList[0].entityList![index] .lineItemNo); // } else // Helpers.showErrorToast( @@ -191,7 +191,7 @@ class ProcedureScreen extends StatelessWidget { ), if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && - model.procedureList[0].entityList.isEmpty)) + model.procedureList[0].entityList!.isEmpty)) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 6190e92e..e33a949a 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -17,15 +17,15 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, - {String procedureName, - int orderNo, - int limetNo, - PatiantInformtion patient, - String orderType, - String procedureId, - String remarks, - ProcedureViewModel model, - String categoreId}) { + {String? procedureName, + int? orderNo, + int? limetNo, + PatiantInformtion? patient, + String? orderType, + String? procedureId, + String? remarks, + ProcedureViewModel? model, + String? categoreId}) { //ProcedureViewModel model2 = ProcedureViewModel(); TextEditingController remarksController = TextEditingController(); TextEditingController orderController = TextEditingController(); @@ -48,15 +48,15 @@ void updateProcedureForm(context, } class UpdateProcedureWidget extends StatefulWidget { - final PatiantInformtion patient; - final ProcedureViewModel model; - final String procedureName; - final String remarks; - final TextEditingController remarksController; - final String procedureId; - final String categoryId; - final int orderNo; - final int limetNo; + final PatiantInformtion? patient; + final ProcedureViewModel? model; + final String? procedureName; + final String? remarks; + final TextEditingController? remarksController; + final String? procedureId; + final String? categoryId; + final int? orderNo; + final int? limetNo; UpdateProcedureWidget( {this.model, @@ -73,8 +73,8 @@ class UpdateProcedureWidget extends StatefulWidget { } class _UpdateProcedureWidgetState extends State { - int selectedType = 0; - setSelectedType(int val) { + int? selectedType = 0; + setSelectedType(int? val) { setState(() { selectedType = val; }); @@ -82,10 +82,10 @@ class _UpdateProcedureWidgetState extends State { void initState() { super.initState(); - widget.remarksController.text = widget.remarks; + widget.remarksController!.text = widget.remarks!; } - List entityList = List(); + List entityList = []; dynamic selectedCategory; @override Widget build(BuildContext context) { @@ -109,7 +109,7 @@ class _UpdateProcedureWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - widget.procedureName.toUpperCase(), + widget.procedureName!.toUpperCase(), fontWeight: FontWeight.w700, ), SizedBox( @@ -241,12 +241,12 @@ class _UpdateProcedureWidgetState extends State { Container( child: Row( children: [ - AppText(TranslationBase.of(context).orderType), + AppText(TranslationBase.of(context)!.orderType), Radio( activeColor: Color(0xFFB9382C), value: 0, groupValue: selectedType, - onChanged: (value) { + onChanged: (dynamic value) { setSelectedType(value); }, ), @@ -255,11 +255,11 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), groupValue: selectedType, value: 1, - onChanged: (value) { + onChanged: (dynamic value) { setSelectedType(value); }, ), - Text(TranslationBase.of(context).urgent), + Text(TranslationBase.of(context)!.urgent!), ], ), ), @@ -275,7 +275,7 @@ class _UpdateProcedureWidgetState extends State { child: TextFields( fontSize: 15.0, controller: widget.remarksController, - hintText: widget.remarksController.text.isEmpty + hintText: widget.remarksController!.text.isEmpty ? 'No Remarks Added' : '', maxLines: 3, @@ -294,8 +294,8 @@ class _UpdateProcedureWidgetState extends State { children: [ AppButton( color: Color(0xff359846), - title: TranslationBase.of(context) - .updateProcedure + title: TranslationBase.of(context)! + .updateProcedure! .toUpperCase(), onPressed: () { // if (entityList.isEmpty == true && @@ -310,12 +310,12 @@ class _UpdateProcedureWidgetState extends State { limetNO: widget.limetNo, orderNo: widget.orderNo, orderType: selectedType.toString(), - categorieId: widget.categoryId, + categorieId: widget.categoryId!, procedureId: widget.procedureId, entityList: entityList, - patient: widget.patient, - model: widget.model, - remarks: widget.remarksController.text); + patient: widget.patient!, + model: widget.model!, + remarks: widget.remarksController!.text); // authorizationForm(context); }, ), @@ -323,7 +323,7 @@ class _UpdateProcedureWidgetState extends State { height: 20.0, ), AppButton( - title: TranslationBase.of(context).cancel, + title: TranslationBase.of(context)!.cancel, color: Color(0xFFB9382C), onPressed: () { Navigator.pop(context); @@ -343,20 +343,20 @@ class _UpdateProcedureWidgetState extends State { } updateProcedure( - {ProcedureViewModel model, - String remarks, - int limetNO, - int orderNo, - String newProcedureId, - String newCategorieId, - List entityList, - String orderType, - String procedureId, - PatiantInformtion patient, - String categorieId}) async { + {required ProcedureViewModel model, + required String remarks, + int? limetNO, + int? orderNo, + String? newProcedureId, + String? newCategorieId, + List? entityList, + String? orderType, + String? procedureId, + required PatiantInformtion patient, + required String categorieId}) async { UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel(); - List controls = List(); + List controls = []; ProcedureDetail controlsProcedure = new ProcedureDetail(); updateProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -425,7 +425,7 @@ class _UpdateProcedureWidgetState extends State { InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 57e6cc11..092be203 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -51,7 +51,7 @@ class _QrReaderScreenState extends State { SessionID: "5G0yXn0Jnq", IsLoginForDoctorApp: true, PatientOutSA: false); - List patientList = []; + List? patientList = []; String error = ''; @override @@ -62,16 +62,16 @@ class _QrReaderScreenState extends State { baseViewModel: model, isShowAppBar: false, appBarTitle: - TranslationBase.of(context).qr + TranslationBase.of(context).reader, + TranslationBase.of(context)!.qr! + TranslationBase.of(context)!.reader!, body: Center( child: Container( - margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), + margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7), child: FractionallySizedBox( widthFactor: 0.9, child: ListView( children: [ AppText( - TranslationBase.of(context).startScanning, + TranslationBase.of(context)!.startScanning, fontSize: 18, fontWeight: FontWeight.bold, textAlign: TextAlign.center, @@ -79,7 +79,7 @@ class _QrReaderScreenState extends State { SizedBox( height: 7, ), - AppText(TranslationBase.of(context).scanQrCode, + AppText(TranslationBase.of(context)!.scanQrCode, fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center), @@ -94,7 +94,7 @@ class _QrReaderScreenState extends State { height: 35, ), AppButton( - title: TranslationBase.of(context).scanQr, + title: TranslationBase.of(context)!.scanQr, onPressed: () { _scanQrAndGetPatient(context, model); }, @@ -116,7 +116,7 @@ class _QrReaderScreenState extends State { Expanded( child: AppText( error ?? - TranslationBase.of(context) + TranslationBase.of(context)! .errorMessage, color: Theme.of(context).errorColor)), ], @@ -168,7 +168,7 @@ class _QrReaderScreenState extends State { isLoading = false; }); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], + "patient": patientList![0], }); } else { setState(() { @@ -187,7 +187,7 @@ class _QrReaderScreenState extends State { error = ""; }); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], + "patient": patientList![0], }); } else { setState(() { diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 2e0a284f..5b09c879 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -15,7 +15,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddRescheduleLeavScreen extends StatelessWidget { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); @@ -25,7 +25,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, + appBarTitle: TranslationBase.of(context)!.rescheduleLeaves, body: SingleChildScrollView( child: Column(children: [ AddNewOrder( onTap: () { @@ -33,7 +33,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { context, false, ); - },label: TranslationBase.of(context).applyForReschedule,), + },label: TranslationBase.of(context)!.applyForReschedule,), Column( children: model.getReschduleLeave .map((GetRescheduleLeavesResponse item) { @@ -45,7 +45,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.red[800] + ? Colors.red[800]! : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 @@ -92,7 +92,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { child: AppText( AppDateUtils .convertStringToDateFormat( - item.createdOn, + item.createdOn!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, )) @@ -103,17 +103,17 @@ class AddRescheduleLeavScreen extends StatelessWidget { Container( child: AppText( item.requisitionType == 1 - ? TranslationBase.of(context) + ? TranslationBase.of(context)! .offTime : item.requisitionType == 2 - ? TranslationBase.of(context) + ? TranslationBase.of(context)! .holiday : item.requisitionType == 3 ? TranslationBase.of( - context) + context)! .changeOfSchedule : TranslationBase.of( - context) + context)! .newSchedule, fontWeight: FontWeight.bold, )), @@ -121,11 +121,11 @@ class AddRescheduleLeavScreen extends StatelessWidget { height: 5, ), Row(children: [ - AppText(TranslationBase.of(context) + AppText(TranslationBase.of(context)! .startDate), AppText( AppDateUtils.convertStringToDateFormat( - item.dateTimeFrom, + item.dateTimeFrom!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) @@ -142,12 +142,12 @@ class AddRescheduleLeavScreen extends StatelessWidget { ), Row( children: [ - AppText(TranslationBase.of(context) + AppText(TranslationBase.of(context)! .endDate), AppText( AppDateUtils .convertStringToDateFormat( - item.dateTimeTo, + item.dateTimeTo!, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) @@ -157,10 +157,10 @@ class AddRescheduleLeavScreen extends StatelessWidget { SizedBox( height: 5, ), - model.coveringDoctors.length > 0 + model.coveringDoctors!.length > 0 ? Row(children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .coveringDoctor, ), AppText( diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index dc3d0adf..a4e335f6 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -37,19 +37,19 @@ class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); - ProjectViewModel projectsProvider; - SickLeaveViewModel sickLeaveViewModel; - String _selectedClinic; + late ProjectViewModel projectsProvider; + SickLeaveViewModel? sickLeaveViewModel; + String? _selectedClinic; Map profile = {}; - var offTime = '1'; + String? offTime = '1'; var date; var doctorID; var reason; var fromDate; var toDate; var clinicID; - String fromTime; - String toTime; + String? fromTime; + String? toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); void _presentDatePicker(id) { @@ -121,7 +121,7 @@ class _RescheduleLeaveScreen extends State { child: AppScaffold( baseViewModel: model2, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, + appBarTitle: TranslationBase.of(context)!.rescheduleLeaves, body: Center( child: Container( margin: EdgeInsets.only(top: 10), @@ -306,7 +306,7 @@ class _RescheduleLeaveScreen extends State { ); }).toList(); }, - onChanged: (newValue) => { + onChanged: (dynamic newValue) => { setState(() { offTime = newValue; }), @@ -368,10 +368,11 @@ class _RescheduleLeaveScreen extends State { children: [ AppTextFormField( hintText: TranslationBase.of( - context) + context)! .fromDate, borderColor: Colors.white, prefix: IconButton( + onPressed: null, icon: Icon(Icons .calendar_today)), textInputType: @@ -411,8 +412,8 @@ class _RescheduleLeaveScreen extends State { DateTimePicker( timeHintText: TranslationBase.of( - context) - .fromTime, + context)! + .fromTime!, type: DateTimePickerType .time, controller: _controller4, @@ -423,7 +424,7 @@ class _RescheduleLeaveScreen extends State { // setState( // () => _valueToValidate4 = val); return null; - }, + } as String Function(String), onSaved: (val) => fromTime = val, ) @@ -451,8 +452,8 @@ class _RescheduleLeaveScreen extends State { DateTimePicker( timeHintText: TranslationBase.of( - context) - .toTime, + context)! + .toTime!, type: DateTimePickerType .time, controller: _controller5, @@ -463,7 +464,7 @@ class _RescheduleLeaveScreen extends State { // setState( // () => _valueToValidate4 = val); return null; - }, + } as String Function(String), onSaved: (val) => toTime = val, ) @@ -494,10 +495,11 @@ class _RescheduleLeaveScreen extends State { AppTextFormField( hintText: TranslationBase.of( - context) + context)! .fromDate, borderColor: Colors.white, prefix: IconButton( + onPressed: null, icon: Icon(Icons .calendar_today)), textInputType: @@ -533,10 +535,11 @@ class _RescheduleLeaveScreen extends State { AppTextFormField( hintText: TranslationBase - .of(context) + .of(context)! .toDate, borderColor: Colors.white, prefix: IconButton( + onPressed: null, icon: Icon(Icons .calendar_today)), textInputType: @@ -580,7 +583,7 @@ class _RescheduleLeaveScreen extends State { Row( mainAxisSize: MainAxisSize.max, children: [ - model2.allReasons.length > 0 + model2.allReasons!.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space child: @@ -590,7 +593,7 @@ class _RescheduleLeaveScreen extends State { focusColor: Colors.grey, isExpanded: true, value: reason == null - ? model2.allReasons[0] + ? model2.allReasons![0] ['id'] .toString() : reason, @@ -599,7 +602,7 @@ class _RescheduleLeaveScreen extends State { selectedItemBuilder: (BuildContext context) { - return model2.allReasons + return model2.allReasons! .map((item) { return Row( mainAxisSize: @@ -623,12 +626,12 @@ class _RescheduleLeaveScreen extends State { ); }).toList(); }, - onChanged: (newValue) => { + onChanged: (dynamic newValue) => { setState(() { reason = newValue; }) }, - items: model2.allReasons + items: model2.allReasons! .map((item) { return DropdownMenuItem< String>( @@ -677,7 +680,7 @@ class _RescheduleLeaveScreen extends State { Row( mainAxisSize: MainAxisSize.max, children: [ - model2.coveringDoctors.length > 0 + model2.coveringDoctors!.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space child: DropdownSearch( @@ -693,7 +696,7 @@ class _RescheduleLeaveScreen extends State { .none), //maxHeight: 300, items: model2 - .coveringDoctors + .coveringDoctors! .map((item) { return projectsProvider .isArabic @@ -703,8 +706,8 @@ class _RescheduleLeaveScreen extends State { 'doctorName']; }).toList(), // label: "Doctor List", - onChanged: (item) { - model2.coveringDoctors + onChanged: (dynamic item) { + model2.coveringDoctors! .forEach( (newVal) => { if (newVal['doctorName'] == @@ -843,7 +846,7 @@ class _RescheduleLeaveScreen extends State { ], ), )), - SizedBox(height: SizeConfig.screenHeight * .3), + SizedBox(height: SizeConfig.screenHeight! * .3), Container( margin: EdgeInsets.all( SizeConfig.widthMultiplier * 5), @@ -852,9 +855,9 @@ class _RescheduleLeaveScreen extends State { children: [ AppButton( title: widget.isUpdate == true - ? TranslationBase.of(context) + ? TranslationBase.of(context)! .updateReschedule - : TranslationBase.of(context) + : TranslationBase.of(context)! .addReschedule, color: HexColor('#359846'), onPressed: () { @@ -866,7 +869,7 @@ class _RescheduleLeaveScreen extends State { } } else { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context)! .onlyOfftimeHoliday); } }, @@ -905,13 +908,13 @@ class _RescheduleLeaveScreen extends State { //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); + this.fromTime = this.fromTime!.substring(0, this.fromTime!.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); - this.toTime = this.toTime.substring(0, this.toTime.length - 3); + this.toTime = this.toTime!.substring(0, this.toTime!.length - 3); _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); - _controller5.text = toTime; - _controller4.text = fromTime; + _controller5.text = toTime!; + _controller4.text = fromTime!; toDate = _toDateController2.text; fromDate = _toDateController.text; this.reason = widget.updateData.reasonId.toString(); @@ -935,12 +938,12 @@ class _RescheduleLeaveScreen extends State { if (offTime == '1') { fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + - fromTime + + fromTime! + ':' + DateTime.now().second.toString())); toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + - toTime + + toTime! + ':' + DateTime.now().second.toString())); } else { @@ -976,7 +979,7 @@ class _RescheduleLeaveScreen extends State { await model.addReschedule(request).then((value) { if (model.postSechedule != null) { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context)!.leaveCreated); Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false); Navigator.push( context, @@ -997,12 +1000,12 @@ class _RescheduleLeaveScreen extends State { if (offTime == '1') { fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + - fromTime + + fromTime! + ':' + DateTime.now().second.toString(); toDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + - toTime + + toTime! + ':' + DateTime.now().second.toString(); } else { @@ -1039,7 +1042,7 @@ class _RescheduleLeaveScreen extends State { model.updateReschedule(request).then((response) { if (model.postSechedule != null) { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context)!.leaveCreated); Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false); Navigator.push( context, diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 734e849a..67cb4b9f 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -19,17 +19,17 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddSickLeavScreen extends StatelessWidget { - PatiantInformtion patient; + PatiantInformtion? patient; @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; - bool isInpatient = routeArgs['isInpatient']; + bool? isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => - model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), + model.getSickLeavePatient(patient!.patientMRN ?? patient!.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -42,7 +42,7 @@ class AddSickLeavScreen extends StatelessWidget { ), body: SingleChildScrollView( child: Column(children: [ - patient.patientStatusType == 43 + patient!.patientStatusType == 43 ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -53,11 +53,11 @@ class AddSickLeavScreen extends StatelessWidget { children: [ if (!projectsProvider.isArabic) AppText( - TranslationBase.of(context).patient, + TranslationBase.of(context)!.patient, fontWeight: FontWeight.bold, ), AppText( - TranslationBase.of(context).sickLeave, + TranslationBase.of(context)!.sickLeave, fontSize: 24, fontWeight: FontWeight.bold, ), @@ -95,7 +95,7 @@ class AddSickLeavScreen extends StatelessWidget { )), Padding( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .noSickLeaveApplied, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -173,8 +173,8 @@ class AddSickLeavScreen extends StatelessWidget { Row( children: [ AppText(TranslationBase - .of(context) - .daysSickleave + + .of(context)! + .daysSickleave! + ": "), AppText( item.sickLeaveDays @@ -188,8 +188,8 @@ class AddSickLeavScreen extends StatelessWidget { children: [ AppText( TranslationBase.of( - context) - .startDate + + context)! + .startDate! + ' ', ), Flexible( @@ -207,8 +207,8 @@ class AddSickLeavScreen extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context) - .endDate + + TranslationBase.of(context)! + .endDate! + ' ', ), Flexible( @@ -227,8 +227,8 @@ class AddSickLeavScreen extends StatelessWidget { ), Row(children: [ AppText(TranslationBase.of( - context) - .branch + + context)! + .branch! + ": "), AppText( item.projectName ?? "", @@ -236,8 +236,8 @@ class AddSickLeavScreen extends StatelessWidget { ]), Row(children: [ AppText(TranslationBase.of( - context) - .clinic + + context)! + .clinic! + ": "), AppText( item.clinicName ?? "", @@ -257,7 +257,7 @@ class AddSickLeavScreen extends StatelessWidget { )); }).toList(), ) - : patient.patientStatusType != 43 + : patient!.patientStatusType != 43 ? Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -269,7 +269,7 @@ class AddSickLeavScreen extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - TranslationBase.of(context).noSickLeave), + TranslationBase.of(context)!.noSickLeave), ) ], ), @@ -279,7 +279,7 @@ class AddSickLeavScreen extends StatelessWidget { } openSickLeave(BuildContext context, isExtend, - {GetAllSickLeaveResponse extendedData}) { + {GetAllSickLeaveResponse? extendedData}) { // showModalBottomSheet( // context: context, // builder: (context) { @@ -290,11 +290,11 @@ class AddSickLeavScreen extends StatelessWidget { FadePage( page: SickLeaveScreen( appointmentNo: isExtend == true - ? extendedData.appointmentNo - : patient.appointmentNo, //extendedData.appointmentNo, + ? extendedData!.appointmentNo + : patient!.appointmentNo, //extendedData.appointmentNo, patientMRN: isExtend == true - ? extendedData.patientMRN - : patient.patientMRN, + ? extendedData!.patientMRN + : patient!.patientMRN, isExtended: isExtend, extendedData: extendedData, patient: patient))); diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 3fbb3287..16bf1724 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -12,15 +12,15 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart' import 'package:flutter/material.dart'; class ShowSickLeaveScreen extends StatelessWidget { - PatiantInformtion patient; + PatiantInformtion? patient; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; return BaseView( onModelReady: (model) => - model.getSickLeave(patient.patientMRN ?? patient.patientId), + model.getSickLeave(patient!.patientMRN ?? patient!.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -48,7 +48,7 @@ class ShowSickLeaveScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 1 - ? Colors.yellow[800] + ? Colors.yellow[800]! : item.status == 2 ? Colors.green : Colors.black, @@ -74,15 +74,15 @@ class ShowSickLeaveScreen extends StatelessWidget { child: AppText( item.status == 1 ? TranslationBase.of( - context) + context)! .hold : item.status == 2 ? TranslationBase .of( - context) + context)! .active : TranslationBase - .of(context) + .of(context)! .all, fontWeight: FontWeight.bold, @@ -97,7 +97,7 @@ class ShowSickLeaveScreen extends StatelessWidget { children: [ AppText( TranslationBase.of( - context) + context)! .daysSickleave), AppText( item.noOfDays @@ -111,15 +111,15 @@ class ShowSickLeaveScreen extends StatelessWidget { children: [ AppText( TranslationBase.of( - context) - .startDate + + context)! + .startDate! + ' ', ), Flexible( child: AppText( AppDateUtils .convertStringToDateFormat( - item.startDate, + item.startDate!, 'dd-MMM-yyyy'), fontWeight: FontWeight.bold, @@ -146,7 +146,7 @@ class ShowSickLeaveScreen extends StatelessWidget { 1) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context)! .sickleaveonhold) } // else @@ -186,7 +186,7 @@ class ShowSickLeaveScreen extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - TranslationBase.of(context).noSickLeave), + TranslationBase.of(context)!.noSickLeave), ) ], ), diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 199a7c82..a50ac265 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -24,7 +24,7 @@ Helpers helpers = Helpers(); class SickLeaveScreen extends StatefulWidget { final bool isExtended; - final GetAllSickLeaveResponse extendedData; + final GetAllSickLeaveResponse? extendedData; final appointmentNo; final patientMRN; final patient; @@ -41,7 +41,7 @@ class SickLeaveScreen extends StatefulWidget { class _SickLeaveScreenState extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); - String _selectedClinic; + String? _selectedClinic; Map profile = {}; AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); void _presentDatePicker(id) { @@ -59,7 +59,7 @@ class _SickLeaveScreenState extends State { final df = new DateFormat('yyyy-MM-dd'); addSickLeave.startDate = df.format(pickedDate); - _toDateController.text = addSickLeave.startDate; + _toDateController.text = addSickLeave.startDate!; //addSickLeave.startDate = selectedDate; }); }); @@ -85,8 +85,8 @@ class _SickLeaveScreenState extends State { child: AppScaffold( baseViewModel: model2, appBarTitle: widget.isExtended == true - ? TranslationBase.of(context).extendSickLeave - : TranslationBase.of(context).addSickLeave, + ? TranslationBase.of(context)!.extendSickLeave + : TranslationBase.of(context)!.addSickLeave, isShowAppBar: true, body: Center( child: Container( @@ -124,22 +124,22 @@ class _SickLeaveScreenState extends State { padding: EdgeInsets.only( top: 5, left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .sickLeave + + TranslationBase.of(context)! + .sickLeave! + ' ' + - TranslationBase.of(context) - .days)), + TranslationBase.of(context)! + .days!)), AppTextFormField( borderColor: Colors.white, onChanged: (value) { addSickLeave.noOfDays = value; if (widget.extendedData != null) { - widget.extendedData.noOfDays = + widget.extendedData!.noOfDays = int.parse(value); } }, hintText: widget.extendedData != null - ? widget.extendedData.noOfDays + ? widget.extendedData!.noOfDays .toString() : '', // validator: (value) { @@ -170,15 +170,16 @@ class _SickLeaveScreenState extends State { padding: EdgeInsets.only( top: 5, left: 10, right: 10), child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .sickLeaveDate, )), AppTextFormField( hintText: widget.extendedData != null - ? widget.extendedData.startDate + ? widget.extendedData!.startDate : '', borderColor: Colors.white, prefix: IconButton( + onPressed: null, icon: Icon(Icons.calendar_today)), textInputType: TextInputType.number, controller: _toDateController, @@ -190,7 +191,7 @@ class _SickLeaveScreenState extends State { onChanged: (value) { addSickLeave.startDate = value; if (widget.extendedData != null) { - widget.extendedData.startDate = + widget.extendedData!.startDate = value; } }), @@ -221,7 +222,7 @@ class _SickLeaveScreenState extends State { Padding( padding: EdgeInsets.only(top: 5), child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .clinicName, )), Row( @@ -244,7 +245,7 @@ class _SickLeaveScreenState extends State { (BuildContext context) { return model - .getClinicNameList() + .getClinicNameList()! .map((item) { return Row( mainAxisSize: @@ -265,10 +266,10 @@ class _SickLeaveScreenState extends State { }).toList(); }, onChanged: - (newValue) => + (dynamic newValue) => {}, items: model - .getClinicNameList() + .getClinicNameList()! .map((item) { return DropdownMenuItem( value: item @@ -320,7 +321,7 @@ class _SickLeaveScreenState extends State { padding: EdgeInsets.only( top: 5, left: 10, right: 10), child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .doctorName, )), new IgnorePointer( @@ -357,7 +358,7 @@ class _SickLeaveScreenState extends State { padding: EdgeInsets.only( top: 5, left: 10, right: 10), child: AppText( - TranslationBase.of(context).remarks, + TranslationBase.of(context)!.remarks, )), TextField( maxLines: 3, @@ -365,12 +366,12 @@ class _SickLeaveScreenState extends State { contentPadding: EdgeInsets.all(20.0), border: InputBorder.none, hintText: widget.extendedData != null - ? widget.extendedData.remarks + ? widget.extendedData!.remarks : ''), onChanged: (value) { addSickLeave.remarks = value; if (widget.extendedData != null) { - widget.extendedData.remarks = value; + widget.extendedData!.remarks = value; } }, ) @@ -385,14 +386,14 @@ class _SickLeaveScreenState extends State { children: [ AppButton( title: widget.isExtended == true - ? TranslationBase.of(context).extend - : TranslationBase.of(context) + ? TranslationBase.of(context)!.extend + : TranslationBase.of(context)! .addSickLeaverequest, color: Colors.green, onPressed: () async { if (widget.isExtended) { await model2.extendSickLeave( - widget.extendedData); + widget.extendedData!); DrAppToastMsg.showSuccesToast( model2.sickleaveResponse[ @@ -438,13 +439,13 @@ class _SickLeaveScreenState extends State { try { if (addSickLeave.noOfDays == null) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterNoOfDays); + TranslationBase.of(context)!.pleaseEnterNoOfDays); } else if (addSickLeave.remarks == null) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterRemarks); + TranslationBase.of(context)!.pleaseEnterRemarks); } else if (addSickLeave.startDate == null) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterDate); + TranslationBase.of(context)!.pleaseEnterDate); } else { addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index bf255b54..eccc56ed 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -10,7 +10,7 @@ class VideoChannel{ /// channel name static const _channel = const MethodChannel("Dr.cloudSolution/videoCall"); static openVideoCallScreen( - {kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID,String generalId,int doctorId, Function() onCallEnd , Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure}) async { + {kApiKey, kSessionId, kToken, callDuration, warningDuration,int? vcId,String? tokenID,String? generalId,int? doctorId, Function()? onCallEnd , Function(SessionStatusModel sessionStatusModel)? onCallNotRespond ,Function(String error)? onFailure}) async { var result; try { result = await _channel.invokeMethod( @@ -28,15 +28,15 @@ class VideoChannel{ }, ); if(result['callResponse'] == 'CallEnd') { - onCallEnd(); + onCallEnd!(); } else { SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); - onCallNotRespond(sessionStatusModel); + onCallNotRespond!(sessionStatusModel); } } catch (e) { - onFailure(e.toString()); + onFailure!(e.toString()); } } diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 44e7bffe..6e46c616 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -20,13 +20,13 @@ class AppDateUtils { return convertDateToFormat(dateTime, dateFormat); } - static convertDateFromServerFormat(String str, dateFormat) { + static convertDateFromServerFormat(String? str, dateFormat) { var date = getDateTimeFromServerFormat(str); return DateFormat(dateFormat).format(date); } - static DateTime getDateTimeFromServerFormat(String str) { + static DateTime getDateTimeFromServerFormat(String? str) { DateTime date= DateTime.now(); if (str!=null) { const start = "/Date("; @@ -44,7 +44,7 @@ class AppDateUtils { } } else { - date = DateTime.parse(str); + date = DateTime.parse(str!); } return date; @@ -68,7 +68,7 @@ class AppDateUtils { final monthAgo = new DateTime(now.year, now.month - 1, firstDate.day); days = now.difference(monthAgo).inDays + 1; } - return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}"; + return "$days ${TranslationBase.of(context)!.days}, $months ${TranslationBase.of(context)!.months}, $years ${TranslationBase.of(context)!.years}"; } static String differenceBetweenDateAndCurrent( @@ -86,7 +86,7 @@ class AppDateUtils { double hoursInOneDay = difference.inHours / difference.inDays; - return "$days ${TranslationBase.of(context).days}, $hours ${TranslationBase.of(context).hr}, $minutes ${TranslationBase.of(context).min}"; + return "$days ${TranslationBase.of(context)!.days}, $hours ${TranslationBase.of(context)!.hr}, $minutes ${TranslationBase.of(context)!.min}"; } static String differenceBetweenServerDateAndCurrent( @@ -237,7 +237,7 @@ class AppDateUtils { } } - static DateTime convertStringToDate(String date) { + static DateTime convertStringToDate(String? date) { // /Date(1585774800000+0300)/ if (date != null) { @@ -254,7 +254,7 @@ class AppDateUtils { /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted Arabic - static String getMonthDayYearDateFormattedAr(DateTime dateTime) { + static String? getMonthDayYearDateFormattedAr(DateTime dateTime) { if (dateTime != null) return getMonthArabic(dateTime.month) + " " + @@ -267,7 +267,7 @@ class AppDateUtils { /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted - static String getMonthDayYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { + static String? getMonthDayYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { if (dateTime != null) return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + " " + @@ -280,7 +280,7 @@ class AppDateUtils { /// get data formatted like 26 Apr 2020 /// [dateTime] convert DateTime to data formatted - static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { + static String getDayMonthYearDateFormatted(DateTime? dateTime,{bool isArabic = false}) { if (dateTime != null) return dateTime.day.toString()+" "+ "${isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) }"+ " " + @@ -320,7 +320,7 @@ class AppDateUtils { final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); days = now.difference(monthAgo).inDays + 1; } - return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}"; + return "$years ${TranslationBase.of(context)!.years} $months ${TranslationBase.of(context)!.months} $days ${TranslationBase.of(context)!.days}"; } static bool isToday(DateTime dateTime){ @@ -333,7 +333,7 @@ class AppDateUtils { } - static String getDate(DateTime dateTime) { + static String? getDate(DateTime? dateTime) { print(dateTime); if (dateTime != null) return getMonth(dateTime.month) + diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index 26e49670..094d25ee 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,8 +1,8 @@ extension Extension on Object { bool isNullOrEmpty() => this == null || this == ''; - bool isNullEmptyOrFalse() => this == null || this == '' || !this; + bool isNullEmptyOrFalse() => this == null || this == '' || !(this as bool); bool isNullEmptyZeroOrFalse() => - this == null || this == '' || !this || this == 0; + this == null || this == '' || !(this as bool) || this == 0; } diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 53f81ef2..11de9995 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -24,14 +24,14 @@ class Helpers { static int cupertinoPickerIndex = 0; get currentLanguage => null; - static showCupertinoPicker(context, List items, decKey, onSelectFun, AuthenticationViewModel model) { + static showCupertinoPicker(context, List items, decKey, onSelectFun, AuthenticationViewModel? model) { showModalBottomSheet( isDismissible: false, context: context, builder: (BuildContext builder) { return Container( // height: 500, - height: SizeConfig.realScreenHeight * 0.4, + height: SizeConfig.realScreenHeight! * 0.4, color: Color(0xfff7f7f7), child: Column( mainAxisAlignment: MainAxisAlignment.end, @@ -42,7 +42,7 @@ class Helpers { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: Text(TranslationBase.of(context).cancel, + child: Text(TranslationBase.of(context)!.cancel!, style: textStyle(context)), onPressed: () { Navigator.pop(context); @@ -50,7 +50,7 @@ class Helpers { ), CupertinoButton( child: Text( - TranslationBase.of(context).done, + TranslationBase.of(context)!.done!, style: textStyle(context), ), onPressed: () { @@ -62,7 +62,7 @@ class Helpers { ), ), Container( - height: SizeConfig.realScreenHeight * 0.3, + height: SizeConfig.realScreenHeight! * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model)) @@ -144,7 +144,7 @@ class Helpers { await sharedPref.clear(); } - navigateToUpdatePage(String message, String androidLink, iosLink) { + navigateToUpdatePage(String? message, String? androidLink, iosLink) { Navigator.pushAndRemoveUntil( AppGlobal.CONTEX, FadePage( @@ -157,7 +157,7 @@ class Helpers { (r) => false); } - static String parseHtmlString(String htmlString) { + static String parseHtmlString(String? htmlString) { final document = parse(htmlString); final String parsedString = parse(document.body.text).documentElement.text; @@ -165,8 +165,8 @@ class Helpers { } static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon, Color dropDownColor}) { + String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon, Color? dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -215,7 +215,7 @@ class Helpers { FocusScope.of(context).unfocus(); } - static String capitalize(str) { + static String? capitalize(str) { if (str != "") { return "${str[0].toUpperCase()}${str.substring(1).toLowerCase()}"; } else { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index a48293ad..cd2721f8 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -9,1331 +9,1331 @@ class TranslationBase { final Locale locale; - static TranslationBase of(BuildContext context) { + static TranslationBase? of(BuildContext context) { return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String? get dashboardScreenToolbarTitle => + localizedValues['dashboardScreenToolbarTitle']![locale.languageCode]; - String get settings => localizedValues['settings'][locale.languageCode]; + String? get settings => localizedValues['settings']![locale.languageCode]; - String get language => localizedValues['language'][locale.languageCode]; + String? get language => localizedValues['language']![locale.languageCode]; - String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; + String? get lanEnglish => localizedValues['lanEnglish']![locale.languageCode]; - String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; + String? get lanArabic => localizedValues['lanArabic']![locale.languageCode]; - String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; + String? get theDoctor => localizedValues['theDoctor']![locale.languageCode]; - String get reply => localizedValues['reply'][locale.languageCode]; + String? get reply => localizedValues['reply']![locale.languageCode]; - String get time => localizedValues['time'][locale.languageCode]; + String? get time => localizedValues['time']![locale.languageCode]; - String get fileNo => localizedValues['fileNo'][locale.languageCode]; + String? get fileNo => localizedValues['fileNo']![locale.languageCode]; - String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; + String? get mobileNo => localizedValues['mobileNo']![locale.languageCode]; - String get replySuccessfully => - localizedValues['replySuccessfully'][locale.languageCode]; + String? get replySuccessfully => + localizedValues['replySuccessfully']![locale.languageCode]; - String get messagesScreenToolbarTitle => - localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String? get messagesScreenToolbarTitle => + localizedValues['messagesScreenToolbarTitle']![locale.languageCode]; - String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; + String? get mySchedule => localizedValues['mySchedule']![locale.languageCode]; - String get errorNoSchedule => - localizedValues['errorNoSchedule'][locale.languageCode]; + String? get errorNoSchedule => + localizedValues['errorNoSchedule']![locale.languageCode]; - String get verify => localizedValues['verify'][locale.languageCode]; + String? get verify => localizedValues['verify']![locale.languageCode]; - String get referralDoctor => - localizedValues['referralDoctor'][locale.languageCode]; + String? get referralDoctor => + localizedValues['referralDoctor']![locale.languageCode]; - String get referringClinic => - localizedValues['referringClinic'][locale.languageCode]; + String? get referringClinic => + localizedValues['referringClinic']![locale.languageCode]; - String get frequency => localizedValues['frequency'][locale.languageCode]; + String? get frequency => localizedValues['frequency']![locale.languageCode]; - String get priority => localizedValues['priority'][locale.languageCode]; + String? get priority => localizedValues['priority']![locale.languageCode]; - String get maxResponseTime => - localizedValues['maxResponseTime'][locale.languageCode]; + String? get maxResponseTime => + localizedValues['maxResponseTime']![locale.languageCode]; - String get clinicDetailsandRemarks => - localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String? get clinicDetailsandRemarks => + localizedValues['clinicDetailsandRemarks']![locale.languageCode]; - String get answerSuggestions => - localizedValues['answerSuggestions'][locale.languageCode]; + String? get answerSuggestions => + localizedValues['answerSuggestions']![locale.languageCode]; - String get outPatients => localizedValues['outPatients'][locale.languageCode]; + String? get outPatients => localizedValues['outPatients']![locale.languageCode]; - String get searchPatient => - localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientName => - localizedValues['searchPatient-name'][locale.languageCode]; + String? get searchPatient => + localizedValues['searchPatient']![locale.languageCode]; + String? get searchPatientName => + localizedValues['searchPatient-name']![locale.languageCode]; - String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; + String? get searchAbout => localizedValues['searchAbout']![locale.languageCode]; - String get patient => localizedValues['patient'][locale.languageCode]; - String get patients => localizedValues['patients'][locale.languageCode]; - String get labResult => localizedValues['labResult'][locale.languageCode]; + String? get patient => localizedValues['patient']![locale.languageCode]; + String? get patients => localizedValues['patients']![locale.languageCode]; + String? get labResult => localizedValues['labResult']![locale.languageCode]; - String get todayStatistics => - localizedValues['todayStatistics'][locale.languageCode]; + String? get todayStatistics => + localizedValues['todayStatistics']![locale.languageCode]; - String get familyMedicine => - localizedValues['familyMedicine'][locale.languageCode]; + String? get familyMedicine => + localizedValues['familyMedicine']![locale.languageCode]; - String get arrived => localizedValues['arrived'][locale.languageCode]; + String? get arrived => localizedValues['arrived']![locale.languageCode]; - String get er => localizedValues['er'][locale.languageCode]; + String? get er => localizedValues['er']![locale.languageCode]; - String get walkIn => localizedValues['walkIn'][locale.languageCode]; + String? get walkIn => localizedValues['walkIn']![locale.languageCode]; - String get notArrived => localizedValues['notArrived'][locale.languageCode]; + String? get notArrived => localizedValues['notArrived']![locale.languageCode]; - String get radiology => localizedValues['radiology'][locale.languageCode]; + String? get radiology => localizedValues['radiology']![locale.languageCode]; - String get service => localizedValues['service'][locale.languageCode]; + String? get service => localizedValues['service']![locale.languageCode]; - String get referral => localizedValues['referral'][locale.languageCode]; + String? get referral => localizedValues['referral']![locale.languageCode]; - String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get inPatientLabel => - localizedValues['inPatientLabel'][locale.languageCode]; + String? get inPatient => localizedValues['inPatient']![locale.languageCode]; + String? get myInPatient => localizedValues['myInPatient']![locale.languageCode]; + String? get inPatientLabel => + localizedValues['inPatientLabel']![locale.languageCode]; - String get inPatientAll => - localizedValues['inPatientAll'][locale.languageCode]; + String? get inPatientAll => + localizedValues['inPatientAll']![locale.languageCode]; - String get operations => localizedValues['operations'][locale.languageCode]; + String? get operations => localizedValues['operations']![locale.languageCode]; - String get patientServices => - localizedValues['patientServices'][locale.languageCode]; + String? get patientServices => + localizedValues['patientServices']![locale.languageCode]; - String get searchMedicine => - localizedValues['searchMedicine'][locale.languageCode]; + String? get searchMedicine => + localizedValues['searchMedicine']![locale.languageCode]; - String get myReferralPatient => - localizedValues['myReferralPatient'][locale.languageCode]; + String? get myReferralPatient => + localizedValues['myReferralPatient']![locale.languageCode]; - String get referPatient => - localizedValues['referPatient'][locale.languageCode]; + String? get referPatient => + localizedValues['referPatient']![locale.languageCode]; - String get myReferral => localizedValues['myReferral'][locale.languageCode]; + String? get myReferral => localizedValues['myReferral']![locale.languageCode]; - String get myReferredPatient => - localizedValues['myReferredPatient'][locale.languageCode]; - String get referredPatient => - localizedValues['referredPatient'][locale.languageCode]; - String get referredOn => localizedValues['referredOn'][locale.languageCode]; + String? get myReferredPatient => + localizedValues['myReferredPatient']![locale.languageCode]; + String? get referredPatient => + localizedValues['referredPatient']![locale.languageCode]; + String? get referredOn => localizedValues['referredOn']![locale.languageCode]; - String get firstName => localizedValues['firstName'][locale.languageCode]; + String? get firstName => localizedValues['firstName']![locale.languageCode]; - String get middleName => localizedValues['middleName'][locale.languageCode]; + String? get middleName => localizedValues['middleName']![locale.languageCode]; - String get lastName => localizedValues['lastName'][locale.languageCode]; + String? get lastName => localizedValues['lastName']![locale.languageCode]; - String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; + String? get phoneNumber => localizedValues['phoneNumber']![locale.languageCode]; - String get patientID => localizedValues['patientID'][locale.languageCode]; + String? get patientID => localizedValues['patientID']![locale.languageCode]; - String get patientFile => localizedValues['patientFile'][locale.languageCode]; + String? get patientFile => localizedValues['patientFile']![locale.languageCode]; - String get search => localizedValues['search'][locale.languageCode]; + String? get search => localizedValues['search']![locale.languageCode]; - String get onlyArrivedPatient => - localizedValues['onlyArrivedPatient'][locale.languageCode]; + String? get onlyArrivedPatient => + localizedValues['onlyArrivedPatient']![locale.languageCode]; - String get searchMedicineNameHere => - localizedValues['searchMedicineNameHere'][locale.languageCode]; + String? get searchMedicineNameHere => + localizedValues['searchMedicineNameHere']![locale.languageCode]; - String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; + String? get youCanFind => localizedValues['youCanFind']![locale.languageCode]; - String get itemsInSearch => - localizedValues['itemsInSearch'][locale.languageCode]; + String? get itemsInSearch => + localizedValues['itemsInSearch']![locale.languageCode]; - String get qr => localizedValues['qr'][locale.languageCode]; + String? get qr => localizedValues['qr']![locale.languageCode]; - String get reader => localizedValues['reader'][locale.languageCode]; + String? get reader => localizedValues['reader']![locale.languageCode]; - String get startScanning => - localizedValues['startScanning'][locale.languageCode]; + String? get startScanning => + localizedValues['startScanning']![locale.languageCode]; - String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; + String? get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]; - String get scanQr => localizedValues['scanQr'][locale.languageCode]; + String? get scanQr => localizedValues['scanQr']![locale.languageCode]; - String get profile => localizedValues['profile'][locale.languageCode]; + String? get profile => localizedValues['profile']![locale.languageCode]; - String get gender => localizedValues['gender'][locale.languageCode]; + String? get gender => localizedValues['gender']![locale.languageCode]; - String get clinic => localizedValues['clinic'][locale.languageCode]; + String? get clinic => localizedValues['clinic']![locale.languageCode]; - String get clinicSelect => - localizedValues['clinicSelect'][locale.languageCode]; + String? get clinicSelect => + localizedValues['clinicSelect']![locale.languageCode]; - String get doctorSelect => - localizedValues['doctorSelect'][locale.languageCode]; + String? get doctorSelect => + localizedValues['doctorSelect']![locale.languageCode]; - String get hospital => localizedValues['hospital'][locale.languageCode]; + String? get hospital => localizedValues['hospital']![locale.languageCode]; - String get speciality => localizedValues['speciality'][locale.languageCode]; + String? get speciality => localizedValues['speciality']![locale.languageCode]; - String get errorMessage => - localizedValues['errorMessage'][locale.languageCode]; + String? get errorMessage => + localizedValues['errorMessage']![locale.languageCode]; - String get patientProfile => - localizedValues['patientProfile'][locale.languageCode]; + String? get patientProfile => + localizedValues['patientProfile']![locale.languageCode]; - String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String? get vitalSign => localizedValues['vitalSign']![locale.languageCode]; - String get vital => localizedValues['vital'][locale.languageCode]; + String? get vital => localizedValues['vital']![locale.languageCode]; - String get signs => localizedValues['signs'][locale.languageCode]; + String? get signs => localizedValues['signs']![locale.languageCode]; - String get labOrder => localizedValues['labOrder'][locale.languageCode]; + String? get labOrder => localizedValues['labOrder']![locale.languageCode]; - String get lab => localizedValues['lab'][locale.languageCode]; + String? get lab => localizedValues['lab']![locale.languageCode]; - String get result => localizedValues['result'][locale.languageCode]; + String? get result => localizedValues['result']![locale.languageCode]; - String get medicines => localizedValues['medicines'][locale.languageCode]; + String? get medicines => localizedValues['medicines']![locale.languageCode]; - String get prescription => - localizedValues['prescription'][locale.languageCode]; + String? get prescription => + localizedValues['prescription']![locale.languageCode]; - String get insuranceApprovals => - localizedValues['insuranceApprovals'][locale.languageCode]; + String? get insuranceApprovals => + localizedValues['insuranceApprovals']![locale.languageCode]; - String get insurance => localizedValues['insurance'][locale.languageCode]; + String? get insurance => localizedValues['insurance']![locale.languageCode]; - String get approvals => localizedValues['approvals'][locale.languageCode]; + String? get approvals => localizedValues['approvals']![locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements'][locale.languageCode]; + String? get bodyMeasurements => + localizedValues['bodyMeasurements']![locale.languageCode]; - String get temperature => localizedValues['temperature'][locale.languageCode]; + String? get temperature => localizedValues['temperature']![locale.languageCode]; - String get pulse => localizedValues['pulse'][locale.languageCode]; + String? get pulse => localizedValues['pulse']![locale.languageCode]; - String get respiration => localizedValues['respiration'][locale.languageCode]; + String? get respiration => localizedValues['respiration']![locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure'][locale.languageCode]; + String? get bloodPressure => + localizedValues['bloodPressure']![locale.languageCode]; - String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String? get oxygenation => localizedValues['oxygenation']![locale.languageCode]; - String get painScale => localizedValues['painScale'][locale.languageCode]; + String? get painScale => localizedValues['painScale']![locale.languageCode]; - String get errorNoVitalSign => - localizedValues['errorNoVitalSign'][locale.languageCode]; + String? get errorNoVitalSign => + localizedValues['errorNoVitalSign']![locale.languageCode]; - String get labOrders => localizedValues['labOrders'][locale.languageCode]; + String? get labOrders => localizedValues['labOrders']![locale.languageCode]; - String get errorNoLabOrders => - localizedValues['errorNoLabOrders'][locale.languageCode]; + String? get errorNoLabOrders => + localizedValues['errorNoLabOrders']![locale.languageCode]; - String get answerThePatient => - localizedValues['answerThePatient'][locale.languageCode]; + String? get answerThePatient => + localizedValues['answerThePatient']![locale.languageCode]; - String get pleaseEnterAnswer => - localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String? get pleaseEnterAnswer => + localizedValues['pleaseEnterAnswer']![locale.languageCode]; - String get replay => localizedValues['replay'][locale.languageCode]; + String? get replay => localizedValues['replay']![locale.languageCode]; - String get progressNote => - localizedValues['progressNote'][locale.languageCode]; + String? get progressNote => + localizedValues['progressNote']![locale.languageCode]; - String get progress => localizedValues['progress'][locale.languageCode]; + String? get progress => localizedValues['progress']![locale.languageCode]; - String get note => localizedValues['note'][locale.languageCode]; + String? get note => localizedValues['note']![locale.languageCode]; - String get searchNote => localizedValues['searchNote'][locale.languageCode]; + String? get searchNote => localizedValues['searchNote']![locale.languageCode]; - String get errorNoProgressNote => - localizedValues['errorNoProgressNote'][locale.languageCode]; + String? get errorNoProgressNote => + localizedValues['errorNoProgressNote']![locale.languageCode]; - String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; - String get orderNo => localizedValues['orderNo'][locale.languageCode]; + String? get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]; + String? get orderNo => localizedValues['orderNo']![locale.languageCode]; - String get generalResult => - localizedValues['generalResult'][locale.languageCode]; + String? get generalResult => + localizedValues['generalResult']![locale.languageCode]; - String get description => localizedValues['description'][locale.languageCode]; + String? get description => localizedValues['description']![locale.languageCode]; - String get value => localizedValues['value'][locale.languageCode]; + String? get value => localizedValues['value']![locale.languageCode]; - String get range => localizedValues['range'][locale.languageCode]; + String? get range => localizedValues['range']![locale.languageCode]; - String get enterId => localizedValues['enterId'][locale.languageCode]; + String? get enterId => localizedValues['enterId']![locale.languageCode]; - String get pleaseEnterYourID => - localizedValues['pleaseEnterYourID'][locale.languageCode]; + String? get pleaseEnterYourID => + localizedValues['pleaseEnterYourID']![locale.languageCode]; - String get enterPassword => - localizedValues['enterPassword'][locale.languageCode]; + String? get enterPassword => + localizedValues['enterPassword']![locale.languageCode]; - String get pleaseEnterPassword => - localizedValues['pleaseEnterPassword'][locale.languageCode]; + String? get pleaseEnterPassword => + localizedValues['pleaseEnterPassword']![locale.languageCode]; - String get selectYourProject => - localizedValues['selectYourProject'][locale.languageCode]; + String? get selectYourProject => + localizedValues['selectYourProject']![locale.languageCode]; - String get pleaseEnterYourProject => - localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String? get pleaseEnterYourProject => + localizedValues['pleaseEnterYourProject']![locale.languageCode]; - String get login => localizedValues['login'][locale.languageCode]; + String? get login => localizedValues['login']![locale.languageCode]; - String get drSulaimanAlHabib => - localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String? get drSulaimanAlHabib => + localizedValues['drSulaimanAlHabib']![locale.languageCode]; - String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; + String? get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]; - String get welcomeBackTo => - localizedValues['welcomeBackTo'][locale.languageCode]; + String? get welcomeBackTo => + localizedValues['welcomeBackTo']![locale.languageCode]; - String get home => localizedValues['home'][locale.languageCode]; + String? get home => localizedValues['home']![locale.languageCode]; - String get services => localizedValues['services'][locale.languageCode]; + String? get services => localizedValues['services']![locale.languageCode]; - String get sms => localizedValues['sms'][locale.languageCode]; + String? get sms => localizedValues['sms']![locale.languageCode]; - String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; + String? get fingerprint => localizedValues['fingerprint']![locale.languageCode]; - String get faceId => localizedValues['faceId'][locale.languageCode]; + String? get faceId => localizedValues['faceId']![locale.languageCode]; - String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + String? get whatsApp => localizedValues['whatsApp']![locale.languageCode]; - String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; + String? get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]; - String get pleaseChoose => - localizedValues['pleaseChoose'][locale.languageCode]; + String? get pleaseChoose => + localizedValues['pleaseChoose']![locale.languageCode]; - String get choose => localizedValues['choose'][locale.languageCode]; + String? get choose => localizedValues['choose']![locale.languageCode]; - String get verification => - localizedValues['verification'][locale.languageCode]; + String? get verification => + localizedValues['verification']![locale.languageCode]; - String get firstStep => localizedValues['firstStep'][locale.languageCode]; + String? get firstStep => localizedValues['firstStep']![locale.languageCode]; - String get yourAccount => - localizedValues['yourAccount!'][locale.languageCode]; + String? get yourAccount => + localizedValues['yourAccount!']![locale.languageCode]; - String get verify1 => localizedValues['verify1'][locale.languageCode]; + String? get verify1 => localizedValues['verify1']![locale.languageCode]; - String get youWillReceiveA => - localizedValues['youWillReceiveA'][locale.languageCode]; + String? get youWillReceiveA => + localizedValues['youWillReceiveA']![locale.languageCode]; - String get loginCode => localizedValues['loginCode'][locale.languageCode]; + String? get loginCode => localizedValues['loginCode']![locale.languageCode]; - String get smsBy => localizedValues['smsBy'][locale.languageCode]; + String? get smsBy => localizedValues['smsBy']![locale.languageCode]; - String get pleaseEnterTheCode => - localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String? get pleaseEnterTheCode => + localizedValues['pleaseEnterTheCode']![locale.languageCode]; - String get youDontHaveAnyPatient => - localizedValues['youDon\'tHaveAnyPatient'][locale.languageCode]; + String? get youDontHaveAnyPatient => + localizedValues['youDon\'tHaveAnyPatient']![locale.languageCode]; - String get youDoNotHaveAnyItem => - localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String? get youDoNotHaveAnyItem => + localizedValues['youDoNotHaveAnyItem']![locale.languageCode]; - String get age => localizedValues['age'][locale.languageCode]; + String? get age => localizedValues['age']![locale.languageCode]; - String get nationality => localizedValues['nationality'][locale.languageCode]; + String? get nationality => localizedValues['nationality']![locale.languageCode]; - String get today => localizedValues['today'][locale.languageCode]; + String? get today => localizedValues['today']![locale.languageCode]; - String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; + String? get tomorrow => localizedValues['tomorrow']![locale.languageCode]; - String get all => localizedValues['all'][locale.languageCode]; + String? get all => localizedValues['all']![locale.languageCode]; - String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; + String? get nextWeek => localizedValues['nextWeek']![locale.languageCode]; - String get yesterday => localizedValues['yesterday'][locale.languageCode]; + String? get yesterday => localizedValues['yesterday']![locale.languageCode]; - String get errorNoInsuranceApprovals => - localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String? get errorNoInsuranceApprovals => + localizedValues['errorNoInsuranceApprovals']![locale.languageCode]; - String get searchInsuranceApprovals => - localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String? get searchInsuranceApprovals => + localizedValues['searchInsuranceApprovals']![locale.languageCode]; - String get status => localizedValues['status'][locale.languageCode]; + String? get status => localizedValues['status']![locale.languageCode]; - String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String? get expiryDate => localizedValues['expiryDate']![locale.languageCode]; - String get producerName => - localizedValues['producerName'][locale.languageCode]; + String? get producerName => + localizedValues['producerName']![locale.languageCode]; - String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String? get receiptOn => localizedValues['receiptOn']![locale.languageCode]; - String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String? get approvalNo => localizedValues['approvalNo']![locale.languageCode]; - String get doctor => localizedValues['doctor'][locale.languageCode]; + String? get doctor => localizedValues['doctor']![locale.languageCode]; - String get ext => localizedValues['ext'][locale.languageCode]; + String? get ext => localizedValues['ext']![locale.languageCode]; - String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; + String? get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]; - String get urgent => localizedValues['urgent'][locale.languageCode]; + String? get urgent => localizedValues['urgent']![locale.languageCode]; - String get routine => localizedValues['routine'][locale.languageCode]; + String? get routine => localizedValues['routine']![locale.languageCode]; - String get send => localizedValues['send'][locale.languageCode]; + String? get send => localizedValues['send']![locale.languageCode]; - String get referralFrequency => - localizedValues['referralFrequency'][locale.languageCode]; + String? get referralFrequency => + localizedValues['referralFrequency']![locale.languageCode]; - String get selectReferralFrequency => - localizedValues['selectReferralFrequency'][locale.languageCode]; + String? get selectReferralFrequency => + localizedValues['selectReferralFrequency']![locale.languageCode]; - String get clinicalDetailsAndRemarks => - localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String? get clinicalDetailsAndRemarks => + localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]; - String get remarks => localizedValues['remarks'][locale.languageCode]; + String? get remarks => localizedValues['remarks']![locale.languageCode]; - String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; + String? get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]; - String get replay2 => localizedValues['replay2'][locale.languageCode]; + String? get replay2 => localizedValues['replay2']![locale.languageCode]; - String get outPatient => localizedValues['outPatients'][locale.languageCode]; + String? get outPatient => localizedValues['outPatients']![locale.languageCode]; - String get myOutPatient => - localizedValues['myOutPatient'][locale.languageCode]; + String? get myOutPatient => + localizedValues['myOutPatient']![locale.languageCode]; - String get logout => localizedValues['logout'][locale.languageCode]; + String? get logout => localizedValues['logout']![locale.languageCode]; - String get pharmaciesList => - localizedValues['pharmaciesList'][locale.languageCode]; + String? get pharmaciesList => + localizedValues['pharmaciesList']![locale.languageCode]; - String get price => localizedValues['price'][locale.languageCode]; + String? get price => localizedValues['price']![locale.languageCode]; - String get youCanFindItIn => - localizedValues['youCanFindItIn'][locale.languageCode]; + String? get youCanFindItIn => + localizedValues['youCanFindItIn']![locale.languageCode]; - String get radiologyReport => - localizedValues['radiologyReport'][locale.languageCode]; + String? get radiologyReport => + localizedValues['radiologyReport']![locale.languageCode]; - String get orders => localizedValues['orders'][locale.languageCode]; + String? get orders => localizedValues['orders']![locale.languageCode]; - String get list => localizedValues['list'][locale.languageCode]; + String? get list => localizedValues['list']![locale.languageCode]; - String get searchOrders => - localizedValues['searchOrders'][locale.languageCode]; + String? get searchOrders => + localizedValues['searchOrders']![locale.languageCode]; - String get prescriptionDetails => - localizedValues['prescriptionDetails'][locale.languageCode]; + String? get prescriptionDetails => + localizedValues['prescriptionDetails']![locale.languageCode]; - String get prescriptionInfo => - localizedValues['prescriptionInfo'][locale.languageCode]; + String? get prescriptionInfo => + localizedValues['prescriptionInfo']![locale.languageCode]; - String get errorNoOrders => - localizedValues['errorNoOrders'][locale.languageCode]; + String? get errorNoOrders => + localizedValues['errorNoOrders']![locale.languageCode]; - String get livecare => localizedValues['livecare'][locale.languageCode]; + String? get livecare => localizedValues['livecare']![locale.languageCode]; - String get beingBad => localizedValues['beingBad'][locale.languageCode]; + String? get beingBad => localizedValues['beingBad']![locale.languageCode]; - String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; + String? get beingGreat => localizedValues['beingGreat']![locale.languageCode]; - String get cancel => localizedValues['cancel'][locale.languageCode]; + String? get cancel => localizedValues['cancel']![locale.languageCode]; - String get ok => localizedValues['ok'][locale.languageCode]; + String? get ok => localizedValues['ok']![locale.languageCode]; - String get done => localizedValues['done'][locale.languageCode]; + String? get done => localizedValues['done']![locale.languageCode]; - String get searchMedicineImageCaption => - localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String? get searchMedicineImageCaption => + localizedValues['searchMedicineImageCaption']![locale.languageCode]; - String get type => localizedValues['type'][locale.languageCode]; + String? get type => localizedValues['type']![locale.languageCode]; - String get resumecall => localizedValues['resumecall'][locale.languageCode]; + String? get resumecall => localizedValues['resumecall']![locale.languageCode]; - String get endcallwithcharge => - localizedValues['endcallwithcharge'][locale.languageCode]; + String? get endcallwithcharge => + localizedValues['endcallwithcharge']![locale.languageCode]; - String get endcall => localizedValues['endcall'][locale.languageCode]; + String? get endcall => localizedValues['endcall']![locale.languageCode]; - String get transfertoadmin => - localizedValues['transfertoadmin'][locale.languageCode]; + String? get transfertoadmin => + localizedValues['transfertoadmin']![locale.languageCode]; - String get fromDate => localizedValues['fromDate'][locale.languageCode]; + String? get fromDate => localizedValues['fromDate']![locale.languageCode]; - String get toDate => localizedValues['toDate'][locale.languageCode]; + String? get toDate => localizedValues['toDate']![locale.languageCode]; - String get fromTime => localizedValues['fromTime'][locale.languageCode]; + String? get fromTime => localizedValues['fromTime']![locale.languageCode]; - String get toTime => localizedValues['toTime'][locale.languageCode]; + String? get toTime => localizedValues['toTime']![locale.languageCode]; - String get searchPatientImageCaptionTitle => - localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + String? get searchPatientImageCaptionTitle => + localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]; - String get searchPatientImageCaptionBody => - localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + String? get searchPatientImageCaptionBody => + localizedValues['searchPatientImageCaptionBody']![locale.languageCode]; - String get welcome => localizedValues['welcome'][locale.languageCode]; + String? get welcome => localizedValues['welcome']![locale.languageCode]; - String get typeMedicineName => - localizedValues['typeMedicineName'][locale.languageCode]; + String? get typeMedicineName => + localizedValues['typeMedicineName']![locale.languageCode]; - String get moreThan3Letter => - localizedValues['moreThan3Letter'][locale.languageCode]; + String? get moreThan3Letter => + localizedValues['moreThan3Letter']![locale.languageCode]; - String get gender2 => localizedValues['gender2'][locale.languageCode]; + String? get gender2 => localizedValues['gender2']![locale.languageCode]; - String get age2 => localizedValues['age2'][locale.languageCode]; + String? get age2 => localizedValues['age2']![locale.languageCode]; - String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String? get sickleave => localizedValues['sick-leaves']![locale.languageCode]; - String get patientSick => - localizedValues['patient-sick'][locale.languageCode]; + String? get patientSick => + localizedValues['patient-sick']![locale.languageCode]; - String get leave => localizedValues['leave'][locale.languageCode]; + String? get leave => localizedValues['leave']![locale.languageCode]; - String get submit => localizedValues['submit'][locale.languageCode]; + String? get submit => localizedValues['submit']![locale.languageCode]; - String get doctorName => localizedValues['doc-name'][locale.languageCode]; + String? get doctorName => localizedValues['doc-name']![locale.languageCode]; - String get clinicName => localizedValues['clinicname'][locale.languageCode]; + String? get clinicName => localizedValues['clinicname']![locale.languageCode]; - String get sickLeaveDate => - localizedValues['sick-leave-date'][locale.languageCode]; + String? get sickLeaveDate => + localizedValues['sick-leave-date']![locale.languageCode]; - String get sickLeaveDays => - localizedValues['sick-leave-days'][locale.languageCode]; + String? get sickLeaveDays => + localizedValues['sick-leave-days']![locale.languageCode]; - String get admissionDetail => - localizedValues['admissionDetail'][locale.languageCode]; + String? get admissionDetail => + localizedValues['admissionDetail']![locale.languageCode]; - String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String? get dateTime => localizedValues['dateTime']![locale.languageCode]; - String get date => localizedValues['date'][locale.languageCode]; + String? get date => localizedValues['date']![locale.languageCode]; - String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; + String? get admissionNo => localizedValues['admissionNo']![locale.languageCode]; - String get losNo => localizedValues['losNo'][locale.languageCode]; + String? get losNo => localizedValues['losNo']![locale.languageCode]; - String get area => localizedValues['area'][locale.languageCode]; + String? get area => localizedValues['area']![locale.languageCode]; - String get room => localizedValues['room'][locale.languageCode]; + String? get room => localizedValues['room']![locale.languageCode]; - String get bed => localizedValues['bed'][locale.languageCode]; + String? get bed => localizedValues['bed']![locale.languageCode]; - String get previousSickLeaveIssue => - localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String? get previousSickLeaveIssue => + localizedValues['prevoius-sickleave-issed']![locale.languageCode]; - String get noSickLeaveApplied => - localizedValues['no-sickleve-applied'][locale.languageCode]; + String? get noSickLeaveApplied => + localizedValues['no-sickleve-applied']![locale.languageCode]; - String get applyNow => localizedValues['applynow'][locale.languageCode]; + String? get applyNow => localizedValues['applynow']![locale.languageCode]; - String get addSickLeave => - localizedValues['add-sickleave'][locale.languageCode]; + String? get addSickLeave => + localizedValues['add-sickleave']![locale.languageCode]; - String get add => localizedValues['add'][locale.languageCode]; - String get addSickLeaverequest => - localizedValues['addSickLeaveRequest'][locale.languageCode]; - String get extendSickLeaverequest => - localizedValues['extendSickLeaveRequest'][locale.languageCode]; - String get approved => localizedValues['approved'][locale.languageCode]; + String? get add => localizedValues['add']![locale.languageCode]; + String? get addSickLeaverequest => + localizedValues['addSickLeaveRequest']![locale.languageCode]; + String? get extendSickLeaverequest => + localizedValues['extendSickLeaveRequest']![locale.languageCode]; + String? get approved => localizedValues['approved']![locale.languageCode]; - String get extended => localizedValues['extended'][locale.languageCode]; + String? get extended => localizedValues['extended']![locale.languageCode]; - String get pending => localizedValues['pending'][locale.languageCode]; + String? get pending => localizedValues['pending']![locale.languageCode]; - String get leaveStartDate => - localizedValues['leave-start-date'][locale.languageCode]; + String? get leaveStartDate => + localizedValues['leave-start-date']![locale.languageCode]; - String get daysSickleave => - localizedValues['days-sick-leave'][locale.languageCode]; + String? get daysSickleave => + localizedValues['days-sick-leave']![locale.languageCode]; - String get extend => localizedValues['extend'][locale.languageCode]; + String? get extend => localizedValues['extend']![locale.languageCode]; - String get extendSickLeave => - localizedValues['extend-sickleave'][locale.languageCode]; + String? get extendSickLeave => + localizedValues['extend-sickleave']![locale.languageCode]; - String get targetPatient => - localizedValues['patient-target'][locale.languageCode]; + String? get targetPatient => + localizedValues['patient-target']![locale.languageCode]; - String get noPrescription => - localizedValues['no-priscription-listed'][locale.languageCode]; + String? get noPrescription => + localizedValues['no-priscription-listed']![locale.languageCode]; - String get next => localizedValues['next'][locale.languageCode]; + String? get next => localizedValues['next']![locale.languageCode]; - String get previous => localizedValues['previous'][locale.languageCode]; + String? get previous => localizedValues['previous']![locale.languageCode]; - String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; + String? get emptyMessage => + localizedValues['empty-message']![locale.languageCode]; - String get healthRecordInformation => - localizedValues['healthRecordInformation'][locale.languageCode]; + String? get healthRecordInformation => + localizedValues['healthRecordInformation']![locale.languageCode]; - String get chiefComplaintLength => - localizedValues['chiefComplaintLength'][locale.languageCode]; + String? get chiefComplaintLength => + localizedValues['chiefComplaintLength']![locale.languageCode]; - String get referTo => localizedValues['referTo'][locale.languageCode]; + String? get referTo => localizedValues['referTo']![locale.languageCode]; - String get referredFrom => - localizedValues['referredFrom'][locale.languageCode]; - String get refClinic => localizedValues['refClinic'][locale.languageCode]; + String? get referredFrom => + localizedValues['referredFrom']![locale.languageCode]; + String? get refClinic => localizedValues['refClinic']![locale.languageCode]; - String get branch => localizedValues['branch'][locale.languageCode]; + String? get branch => localizedValues['branch']![locale.languageCode]; - String get chooseAppointment => - localizedValues['chooseAppointment'][locale.languageCode]; + String? get chooseAppointment => + localizedValues['chooseAppointment']![locale.languageCode]; - String get appointmentNo => - localizedValues['appointmentNo'][locale.languageCode]; + String? get appointmentNo => + localizedValues['appointmentNo']![locale.languageCode]; - String get refer => localizedValues['refer'][locale.languageCode]; + String? get refer => localizedValues['refer']![locale.languageCode]; - String get rejected => localizedValues['rejected'][locale.languageCode]; + String? get rejected => localizedValues['rejected']![locale.languageCode]; - String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; + String? get sameBranch => localizedValues['sameBranch']![locale.languageCode]; - String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; + String? get otherBranch => localizedValues['otherBranch']![locale.languageCode]; - String get dr => localizedValues['dr'][locale.languageCode]; + String? get dr => localizedValues['dr']![locale.languageCode]; - String get previewHealth => - localizedValues['previewHealth'][locale.languageCode]; + String? get previewHealth => + localizedValues['previewHealth']![locale.languageCode]; - String get summaryReport => - localizedValues['summaryReport'][locale.languageCode]; + String? get summaryReport => + localizedValues['summaryReport']![locale.languageCode]; - String get accept => localizedValues['accept'][locale.languageCode]; + String? get accept => localizedValues['accept']![locale.languageCode]; - String get reject => localizedValues['reject'][locale.languageCode]; + String? get reject => localizedValues['reject']![locale.languageCode]; - String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String? get noAppointmentsErrorMsg => + localizedValues['noAppointmentsErrorMsg']![locale.languageCode]; - String get referralPatient => - localizedValues['referralPatient'][locale.languageCode]; + String? get referralPatient => + localizedValues['referralPatient']![locale.languageCode]; - String get noPrescriptionListed => - localizedValues['noPrescriptionListed'][locale.languageCode]; + String? get noPrescriptionListed => + localizedValues['noPrescriptionListed']![locale.languageCode]; - String get addNow => localizedValues['addNow'][locale.languageCode]; + String? get addNow => localizedValues['addNow']![locale.languageCode]; - String get orderType => localizedValues['orderType'][locale.languageCode]; + String? get orderType => localizedValues['orderType']![locale.languageCode]; - String get strength => localizedValues['strength'][locale.languageCode]; + String? get strength => localizedValues['strength']![locale.languageCode]; - String get doseTime => localizedValues['doseTime'][locale.languageCode]; + String? get doseTime => localizedValues['doseTime']![locale.languageCode]; - String get indication => localizedValues['indication'][locale.languageCode]; + String? get indication => localizedValues['indication']![locale.languageCode]; - String get duration => localizedValues['duration'][locale.languageCode]; + String? get duration => localizedValues['duration']![locale.languageCode]; - String get instruction => localizedValues['instruction'][locale.languageCode]; + String? get instruction => localizedValues['instruction']![locale.languageCode]; - String get rescheduleLeaves => - localizedValues['reschedule-leave'][locale.languageCode]; + String? get rescheduleLeaves => + localizedValues['reschedule-leave']![locale.languageCode]; - String get applyOrRescheduleLeave => - localizedValues['applyOrRescheduleLeave'][locale.languageCode]; - String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; + String? get applyOrRescheduleLeave => + localizedValues['applyOrRescheduleLeave']![locale.languageCode]; + String? get myQRCode => localizedValues['myQRCode']![locale.languageCode]; - String get addMedication => - localizedValues['addMedication'][locale.languageCode]; + String? get addMedication => + localizedValues['addMedication']![locale.languageCode]; - String get route => localizedValues['route'][locale.languageCode]; + String? get route => localizedValues['route']![locale.languageCode]; - String get noReScheduleLeave => - localizedValues['no-reschedule-leave'][locale.languageCode]; + String? get noReScheduleLeave => + localizedValues['no-reschedule-leave']![locale.languageCode]; - String get weight => localizedValues['weight'][locale.languageCode]; + String? get weight => localizedValues['weight']![locale.languageCode]; - String get kg => localizedValues['kg'][locale.languageCode]; + String? get kg => localizedValues['kg']![locale.languageCode]; - String get height => localizedValues['height'][locale.languageCode]; + String? get height => localizedValues['height']![locale.languageCode]; - String get cm => localizedValues['cm'][locale.languageCode]; + String? get cm => localizedValues['cm']![locale.languageCode]; - String get idealBodyWeight => - localizedValues['idealBodyWeight'][locale.languageCode]; + String? get idealBodyWeight => + localizedValues['idealBodyWeight']![locale.languageCode]; - String get waistSize => localizedValues['waistSize'][locale.languageCode]; + String? get waistSize => localizedValues['waistSize']![locale.languageCode]; - String get inch => localizedValues['inch'][locale.languageCode]; + String? get inch => localizedValues['inch']![locale.languageCode]; - String get headCircum => localizedValues['headCircum'][locale.languageCode]; + String? get headCircum => localizedValues['headCircum']![locale.languageCode]; - String get leanBodyWeight => - localizedValues['leanBodyWeight'][locale.languageCode]; + String? get leanBodyWeight => + localizedValues['leanBodyWeight']![locale.languageCode]; - String get bodyMassIndex => - localizedValues['bodyMassIndex'][locale.languageCode]; + String? get bodyMassIndex => + localizedValues['bodyMassIndex']![locale.languageCode]; - String get yourBodyMassIndex => - localizedValues['yourBodyMassIndex'][locale.languageCode]; - String get bmiUnderWeight => - localizedValues['bmiUnderWeight'][locale.languageCode]; - String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; - String get bmiOverWeight => - localizedValues['bmiOverWeight'][locale.languageCode]; - String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; - String get bmiObeseExtreme => - localizedValues['bmiObeseExtreme'][locale.languageCode]; + String? get yourBodyMassIndex => + localizedValues['yourBodyMassIndex']![locale.languageCode]; + String? get bmiUnderWeight => + localizedValues['bmiUnderWeight']![locale.languageCode]; + String? get bmiHealthy => localizedValues['bmiHealthy']![locale.languageCode]; + String? get bmiOverWeight => + localizedValues['bmiOverWeight']![locale.languageCode]; + String? get bmiObese => localizedValues['bmiObese']![locale.languageCode]; + String? get bmiObeseExtreme => + localizedValues['bmiObeseExtreme']![locale.languageCode]; - String get method => localizedValues['method'][locale.languageCode]; + String? get method => localizedValues['method']![locale.languageCode]; - String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; + String? get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]; - String get rhythm => localizedValues['rhythm'][locale.languageCode]; + String? get rhythm => localizedValues['rhythm']![locale.languageCode]; - String get respBeats => localizedValues['respBeats'][locale.languageCode]; + String? get respBeats => localizedValues['respBeats']![locale.languageCode]; - String get patternOfRespiration => - localizedValues['patternOfRespiration'][locale.languageCode]; + String? get patternOfRespiration => + localizedValues['patternOfRespiration']![locale.languageCode]; - String get bloodPressureDiastoleAndSystole => - localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String? get bloodPressureDiastoleAndSystole => + localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]; - String get cuffLocation => - localizedValues['cuffLocation'][locale.languageCode]; + String? get cuffLocation => + localizedValues['cuffLocation']![locale.languageCode]; - String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; + String? get cuffSize => localizedValues['cuffSize']![locale.languageCode]; - String get patientPosition => - localizedValues['patientPosition'][locale.languageCode]; + String? get patientPosition => + localizedValues['patientPosition']![locale.languageCode]; - String get fio2 => localizedValues['fio2'][locale.languageCode]; + String? get fio2 => localizedValues['fio2']![locale.languageCode]; - String get sao2 => localizedValues['sao2'][locale.languageCode]; + String? get sao2 => localizedValues['sao2']![locale.languageCode]; - String get painManagement => - localizedValues['painManagement'][locale.languageCode]; + String? get painManagement => + localizedValues['painManagement']![locale.languageCode]; - String get holiday => localizedValues['holiday'][locale.languageCode]; + String? get holiday => localizedValues['holiday']![locale.languageCode]; - String get to => localizedValues['to'][locale.languageCode]; + String? get to => localizedValues['to']![locale.languageCode]; - String get coveringDoctor => - localizedValues['coveringDoctor'][locale.languageCode]; + String? get coveringDoctor => + localizedValues['coveringDoctor']![locale.languageCode]; - String get requestLeave => - localizedValues['requestLeave'][locale.languageCode]; + String? get requestLeave => + localizedValues['requestLeave']![locale.languageCode]; - String get pleaseEnterDate => - localizedValues['pleaseEnterDate'][locale.languageCode]; + String? get pleaseEnterDate => + localizedValues['pleaseEnterDate']![locale.languageCode]; - String get pleaseEnterNoOfDays => - localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String? get pleaseEnterNoOfDays => + localizedValues['pleaseEnterNoOfDays']![locale.languageCode]; - String get pleaseEnterRemarks => - localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String? get pleaseEnterRemarks => + localizedValues['pleaseEnterRemarks']![locale.languageCode]; - String get update => localizedValues['update'][locale.languageCode]; + String? get update => localizedValues['update']![locale.languageCode]; - String get admission => localizedValues['admission'][locale.languageCode]; + String? get admission => localizedValues['admission']![locale.languageCode]; - String get request => localizedValues['request'][locale.languageCode]; + String? get request => localizedValues['request']![locale.languageCode]; - String get admissionRequest => - localizedValues['admissionRequest'][locale.languageCode]; + String? get admissionRequest => + localizedValues['admissionRequest']![locale.languageCode]; - String get patientDetails => - localizedValues['patientDetails'][locale.languageCode]; + String? get patientDetails => + localizedValues['patientDetails']![locale.languageCode]; - String get specialityAndDoctorDetail => - localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String? get specialityAndDoctorDetail => + localizedValues['specialityAndDoctorDetail']![locale.languageCode]; - String get referringDate => - localizedValues['referringDate'][locale.languageCode]; + String? get referringDate => + localizedValues['referringDate']![locale.languageCode]; - String get referringDoctor => - localizedValues['referringDoctor'][locale.languageCode]; + String? get referringDoctor => + localizedValues['referringDoctor']![locale.languageCode]; - String get otherInformation => - localizedValues['otherInformation'][locale.languageCode]; + String? get otherInformation => + localizedValues['otherInformation']![locale.languageCode]; - String get expectedDays => - localizedValues['expectedDays'][locale.languageCode]; + String? get expectedDays => + localizedValues['expectedDays']![locale.languageCode]; - String get expectedAdmissionDate => - localizedValues['expectedAdmissionDate'][locale.languageCode]; + String? get expectedAdmissionDate => + localizedValues['expectedAdmissionDate']![locale.languageCode]; - String get emergencyAdmission => - localizedValues['emergencyAdmission'][locale.languageCode]; - String get isSickLeaveRequired => - localizedValues['isSickLeaveRequired'][locale.languageCode]; + String? get emergencyAdmission => + localizedValues['emergencyAdmission']![locale.languageCode]; + String? get isSickLeaveRequired => + localizedValues['isSickLeaveRequired']![locale.languageCode]; - String get patientPregnant => - localizedValues['patientPregnant'][locale.languageCode]; + String? get patientPregnant => + localizedValues['patientPregnant']![locale.languageCode]; - String get treatmentLine => - localizedValues['treatmentLine'][locale.languageCode]; + String? get treatmentLine => + localizedValues['treatmentLine']![locale.languageCode]; - String get ward => localizedValues['ward'][locale.languageCode]; + String? get ward => localizedValues['ward']![locale.languageCode]; - String get preAnesthesiaReferred => - localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String? get preAnesthesiaReferred => + localizedValues['preAnesthesiaReferred']![locale.languageCode]; - String get admissionType => - localizedValues['admissionType'][locale.languageCode]; + String? get admissionType => + localizedValues['admissionType']![locale.languageCode]; - String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; + String? get diagnosis => localizedValues['diagnosis']![locale.languageCode]; - String get allergies => localizedValues['allergies'][locale.languageCode]; + String? get allergies => localizedValues['allergies']![locale.languageCode]; - String get preOperativeOrders => - localizedValues['preOperativeOrders'][locale.languageCode]; + String? get preOperativeOrders => + localizedValues['preOperativeOrders']![locale.languageCode]; - String get elementForImprovement => - localizedValues['elementForImprovement'][locale.languageCode]; + String? get elementForImprovement => + localizedValues['elementForImprovement']![locale.languageCode]; - String get dischargeDate => - localizedValues['dischargeDate'][locale.languageCode]; + String? get dischargeDate => + localizedValues['dischargeDate']![locale.languageCode]; - String get dietType => localizedValues['dietType'][locale.languageCode]; + String? get dietType => localizedValues['dietType']![locale.languageCode]; - String get dietTypeRemarks => - localizedValues['dietTypeRemarks'][locale.languageCode]; + String? get dietTypeRemarks => + localizedValues['dietTypeRemarks']![locale.languageCode]; - String get save => localizedValues['save'][locale.languageCode]; + String? get save => localizedValues['save']![locale.languageCode]; - String get postPlansEstimatedCost => - localizedValues['postPlansEstimatedCost'][locale.languageCode]; - String get postPlans => localizedValues['postPlans'][locale.languageCode]; + String? get postPlansEstimatedCost => + localizedValues['postPlansEstimatedCost']![locale.languageCode]; + String? get postPlans => localizedValues['postPlans']![locale.languageCode]; - String get ucaf => localizedValues['ucaf'][locale.languageCode]; + String? get ucaf => localizedValues['ucaf']![locale.languageCode]; - String get emergencyCase => - localizedValues['emergencyCase'][locale.languageCode]; + String? get emergencyCase => + localizedValues['emergencyCase']![locale.languageCode]; - String get durationOfIllness => - localizedValues['durationOfIllness'][locale.languageCode]; + String? get durationOfIllness => + localizedValues['durationOfIllness']![locale.languageCode]; - String get chiefComplaintsAndSymptoms => - localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String? get chiefComplaintsAndSymptoms => + localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]; - String get patientFeelsPainInHisBackAndCough => - localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; + String? get patientFeelsPainInHisBackAndCough => + localizedValues['patientFeelsPainInHisBackAndCough']![locale.languageCode]; - String get additionalTextComplaints => - localizedValues['additionalTextComplaints'][locale.languageCode]; + String? get additionalTextComplaints => + localizedValues['additionalTextComplaints']![locale.languageCode]; - String get otherConditions => - localizedValues['otherConditions'][locale.languageCode]; + String? get otherConditions => + localizedValues['otherConditions']![locale.languageCode]; - String get other => localizedValues['other'][locale.languageCode]; + String? get other => localizedValues['other']![locale.languageCode]; - String get how => localizedValues['how'][locale.languageCode]; + String? get how => localizedValues['how']![locale.languageCode]; - String get when => localizedValues['when'][locale.languageCode]; + String? get when => localizedValues['when']![locale.languageCode]; - String get where => localizedValues['where'][locale.languageCode]; + String? get where => localizedValues['where']![locale.languageCode]; - String get specifyPossibleLineManagement => - localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String? get specifyPossibleLineManagement => + localizedValues['specifyPossibleLineManagement']![locale.languageCode]; - String get significantSigns => - localizedValues['significantSigns'][locale.languageCode]; + String? get significantSigns => + localizedValues['significantSigns']![locale.languageCode]; - String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String? get backAbdomen => localizedValues['backAbdomen']![locale.languageCode]; - String get reasons => localizedValues['reasons'][locale.languageCode]; + String? get reasons => localizedValues['reasons']![locale.languageCode]; - String get createNew => localizedValues['createNew'][locale.languageCode]; + String? get createNew => localizedValues['createNew']![locale.languageCode]; - String get episode => localizedValues['episode'][locale.languageCode]; + String? get episode => localizedValues['episode']![locale.languageCode]; - String get medications => localizedValues['medications'][locale.languageCode]; + String? get medications => localizedValues['medications']![locale.languageCode]; - String get procedures => localizedValues['procedures'][locale.languageCode]; + String? get procedures => localizedValues['procedures']![locale.languageCode]; - String get chiefComplaints => - localizedValues['chiefComplaints'][locale.languageCode]; + String? get chiefComplaints => + localizedValues['chiefComplaints']![locale.languageCode]; - String get histories => localizedValues['histories'][locale.languageCode]; + String? get histories => localizedValues['histories']![locale.languageCode]; - String get allergiesSoap => - localizedValues['allergiesSoap'][locale.languageCode]; + String? get allergiesSoap => + localizedValues['allergiesSoap']![locale.languageCode]; - String get addChiefComplaints => - localizedValues['addChiefComplaints'][locale.languageCode]; + String? get addChiefComplaints => + localizedValues['addChiefComplaints']![locale.languageCode]; - String get historyOfPresentIllness => - localizedValues['historyOfPresentIllness'][locale.languageCode]; + String? get historyOfPresentIllness => + localizedValues['historyOfPresentIllness']![locale.languageCode]; - String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; + String? get requiredMsg => localizedValues['requiredMsg']![locale.languageCode]; - String get addHistory => localizedValues['addHistory'][locale.languageCode]; + String? get addHistory => localizedValues['addHistory']![locale.languageCode]; - String get searchHistory => - localizedValues['searchHistory'][locale.languageCode]; + String? get searchHistory => + localizedValues['searchHistory']![locale.languageCode]; - String get addSelectedHistories => - localizedValues['addSelectedHistories'][locale.languageCode]; + String? get addSelectedHistories => + localizedValues['addSelectedHistories']![locale.languageCode]; - String get addAllergies => - localizedValues['addAllergies'][locale.languageCode]; + String? get addAllergies => + localizedValues['addAllergies']![locale.languageCode]; - String get itemExist => localizedValues['itemExist'][locale.languageCode]; + String? get itemExist => localizedValues['itemExist']![locale.languageCode]; - String get selectAllergy => - localizedValues['selectAllergy'][locale.languageCode]; + String? get selectAllergy => + localizedValues['selectAllergy']![locale.languageCode]; - String get selectSeverity => - localizedValues['selectSeverity'][locale.languageCode]; + String? get selectSeverity => + localizedValues['selectSeverity']![locale.languageCode]; - String get leaveCreated => - localizedValues['leaveCreated'][locale.languageCode]; + String? get leaveCreated => + localizedValues['leaveCreated']![locale.languageCode]; - String get vitalSignEmptyMsg => - localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String? get vitalSignEmptyMsg => + localizedValues['vitalSignEmptyMsg']![locale.languageCode]; - String get referralEmptyMsg => - localizedValues['referralEmptyMsg'][locale.languageCode]; + String? get referralEmptyMsg => + localizedValues['referralEmptyMsg']![locale.languageCode]; - String get referralSuccessMsg => - localizedValues['referralSuccessMsg'][locale.languageCode]; + String? get referralSuccessMsg => + localizedValues['referralSuccessMsg']![locale.languageCode]; - String get diagnoseType => - localizedValues['diagnoseType'][locale.languageCode]; + String? get diagnoseType => + localizedValues['diagnoseType']![locale.languageCode]; - String get condition => localizedValues['condition'][locale.languageCode]; + String? get condition => localizedValues['condition']![locale.languageCode]; - String get id => localizedValues['id'][locale.languageCode]; + String? get id => localizedValues['id']![locale.languageCode]; - String get quantity => localizedValues['quantity'][locale.languageCode]; + String? get quantity => localizedValues['quantity']![locale.languageCode]; - String get durDays => localizedValues['durDays'][locale.languageCode]; + String? get durDays => localizedValues['durDays']![locale.languageCode]; - String get codeNo => localizedValues['codeNo'][locale.languageCode]; + String? get codeNo => localizedValues['codeNo']![locale.languageCode]; - String get covered => localizedValues['covered'][locale.languageCode]; + String? get covered => localizedValues['covered']![locale.languageCode]; - String get approvalRequired => - localizedValues['approvalRequired'][locale.languageCode]; + String? get approvalRequired => + localizedValues['approvalRequired']![locale.languageCode]; - String get uncoveredByDoctor => - localizedValues['uncoveredByDoctor'][locale.languageCode]; + String? get uncoveredByDoctor => + localizedValues['uncoveredByDoctor']![locale.languageCode]; - String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String? get chiefComplaintEmptyMsg => + localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]; - String get moreVerification => - localizedValues['more-verify'][locale.languageCode]; + String? get moreVerification => + localizedValues['more-verify']![locale.languageCode]; - String get welcomeBack => - localizedValues['welcome-back'][locale.languageCode]; + String? get welcomeBack => + localizedValues['welcome-back']![locale.languageCode]; - String get accountInfo => - localizedValues['account-info'][locale.languageCode]; + String? get accountInfo => + localizedValues['account-info']![locale.languageCode]; - String get useAnotherAccount => - localizedValues['another-acc'][locale.languageCode]; + String? get useAnotherAccount => + localizedValues['another-acc']![locale.languageCode]; - String get verifyLoginWith => - localizedValues['verify-login-with'][locale.languageCode]; + String? get verifyLoginWith => + localizedValues['verify-login-with']![locale.languageCode]; - String get register => localizedValues['register-user'][locale.languageCode]; + String? get register => localizedValues['register-user']![locale.languageCode]; - String get verifyFingerprint => - localizedValues['verify-with-fingerprint'][locale.languageCode]; + String? get verifyFingerprint => + localizedValues['verify-with-fingerprint']![locale.languageCode]; - String get verifyFaceID => - localizedValues['verify-with-faceid'][locale.languageCode]; + String? get verifyFaceID => + localizedValues['verify-with-faceid']![locale.languageCode]; - String get verifySMS => - localizedValues['verify-with-sms'][locale.languageCode]; - String get verifyWith => - localizedValues['verify-with'][locale.languageCode]; + String? get verifySMS => + localizedValues['verify-with-sms']![locale.languageCode]; + String? get verifyWith => + localizedValues['verify-with']![locale.languageCode]; - String get verifyWhatsApp => - localizedValues['verify-with-whatsapp'][locale.languageCode]; + String? get verifyWhatsApp => + localizedValues['verify-with-whatsapp']![locale.languageCode]; - String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + String? get lastLoginAt => localizedValues['last-login']![locale.languageCode]; - String get lastLoginWith => - localizedValues['last-login-with'][locale.languageCode]; + String? get lastLoginWith => + localizedValues['last-login-with']![locale.languageCode]; - String get verifyFingerprint2 => - localizedValues['verify-fingerprint'][locale.languageCode]; + String? get verifyFingerprint2 => + localizedValues['verify-fingerprint']![locale.languageCode]; - String get verificationMessage => - localizedValues['verification_message'][locale.languageCode]; + String? get verificationMessage => + localizedValues['verification_message']![locale.languageCode]; - String get validationMessage => - localizedValues['validation_message'][locale.languageCode]; + String? get validationMessage => + localizedValues['validation_message']![locale.languageCode]; - String get addAssessment => - localizedValues['addAssessment'][locale.languageCode]; + String? get addAssessment => + localizedValues['addAssessment']![locale.languageCode]; - String get assessment => localizedValues['assessment'][locale.languageCode]; + String? get assessment => localizedValues['assessment']![locale.languageCode]; - String get physicalSystemExamination => - localizedValues['physicalSystemExamination'][locale.languageCode]; + String? get physicalSystemExamination => + localizedValues['physicalSystemExamination']![locale.languageCode]; - String get searchExamination => - localizedValues['searchExamination'][locale.languageCode]; + String? get searchExamination => + localizedValues['searchExamination']![locale.languageCode]; - String get addExamination => - localizedValues['addExamination'][locale.languageCode]; + String? get addExamination => + localizedValues['addExamination']![locale.languageCode]; - String get doc => localizedValues['doc'][locale.languageCode]; + String? get doc => localizedValues['doc']![locale.languageCode]; - String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; + String? get allergicTO => localizedValues['allergicTO']![locale.languageCode]; - String get normal => localizedValues['normal'][locale.languageCode]; - String get notExamined => localizedValues['notExamined'][locale.languageCode]; + String? get normal => localizedValues['normal']![locale.languageCode]; + String? get notExamined => localizedValues['notExamined']![locale.languageCode]; - String get abnormal => localizedValues['abnormal'][locale.languageCode]; + String? get abnormal => localizedValues['abnormal']![locale.languageCode]; - String get patientNoDetailErrMsg => - localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String? get patientNoDetailErrMsg => + localizedValues['patientNoDetailErrMsg']![locale.languageCode]; - String get systolicLng => - localizedValues['systolic-lng'][locale.languageCode]; + String? get systolicLng => + localizedValues['systolic-lng']![locale.languageCode]; - String get diastolicLng => - localizedValues['diastolic-lng'][locale.languageCode]; + String? get diastolicLng => + localizedValues['diastolic-lng']![locale.languageCode]; - String get mass => localizedValues['mass'][locale.languageCode]; + String? get mass => localizedValues['mass']![locale.languageCode]; - String get tempC => localizedValues['temp-c'][locale.languageCode]; + String? get tempC => localizedValues['temp-c']![locale.languageCode]; - String get bpm => localizedValues['bpm'][locale.languageCode]; + String? get bpm => localizedValues['bpm']![locale.languageCode]; - String get respirationSigns => - localizedValues['respiration-signs'][locale.languageCode]; + String? get respirationSigns => + localizedValues['respiration-signs']![locale.languageCode]; - String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String? get sysDias => localizedValues['sys-dias']![locale.languageCode]; - String get body => localizedValues['body'][locale.languageCode]; + String? get body => localizedValues['body']![locale.languageCode]; - String get respirationRate => - localizedValues['respirationRate'][locale.languageCode]; + String? get respirationRate => + localizedValues['respirationRate']![locale.languageCode]; - String get heart => localizedValues['heart'][locale.languageCode]; + String? get heart => localizedValues['heart']![locale.languageCode]; - String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; + String? get medicalReport => localizedValues['medicalReport']![locale.languageCode]; - String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String? get visitDate => localizedValues['visitDate']![locale.languageCode]; - String get test => localizedValues['test'][locale.languageCode]; + String? get test => localizedValues['test']![locale.languageCode]; - String get addMoreProcedure => - localizedValues['addMoreProcedure'][locale.languageCode]; + String? get addMoreProcedure => + localizedValues['addMoreProcedure']![locale.languageCode]; - String get regular => localizedValues['regular'][locale.languageCode]; + String? get regular => localizedValues['regular']![locale.languageCode]; - String get searchProcedures => - localizedValues['searchProcedures'][locale.languageCode]; + String? get searchProcedures => + localizedValues['searchProcedures']![locale.languageCode]; - String get procedureCategorise => - localizedValues['procedureCategorise'][locale.languageCode]; + String? get procedureCategorise => + localizedValues['procedureCategorise']![locale.languageCode]; - String get selectProcedures => - localizedValues['selectProcedures'][locale.languageCode]; + String? get selectProcedures => + localizedValues['selectProcedures']![locale.languageCode]; - String get addSelectedProcedures => - localizedValues['addSelectedProcedures'][locale.languageCode]; + String? get addSelectedProcedures => + localizedValues['addSelectedProcedures']![locale.languageCode]; - String get updateProcedure => - localizedValues['updateProcedure'][locale.languageCode]; + String? get updateProcedure => + localizedValues['updateProcedure']![locale.languageCode]; - String get orderProcedure => - localizedValues['orderProcedure'][locale.languageCode]; + String? get orderProcedure => + localizedValues['orderProcedure']![locale.languageCode]; - String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; + String? get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]; - String get dType => localizedValues['dType'][locale.languageCode]; + String? get dType => localizedValues['dType']![locale.languageCode]; - String get addAssessmentDetails => - localizedValues['addAssessmentDetails'][locale.languageCode]; + String? get addAssessmentDetails => + localizedValues['addAssessmentDetails']![locale.languageCode]; - String get progressNoteSOAP => - localizedValues['progressNoteSOAP'][locale.languageCode]; + String? get progressNoteSOAP => + localizedValues['progressNoteSOAP']![locale.languageCode]; - String get addProgressNote => - localizedValues['addProgressNote'][locale.languageCode]; + String? get addProgressNote => + localizedValues['addProgressNote']![locale.languageCode]; - String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String? get createdBy => localizedValues['createdBy']![locale.languageCode]; - String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String? get editedBy => localizedValues['editedBy']![locale.languageCode]; - String get currentMedications => - localizedValues['currentMedications'][locale.languageCode]; + String? get currentMedications => + localizedValues['currentMedications']![locale.languageCode]; - String get noItem => localizedValues['noItem'][locale.languageCode]; + String? get noItem => localizedValues['noItem']![locale.languageCode]; - String get postUcafSuccessMsg => - localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String? get postUcafSuccessMsg => + localizedValues['postUcafSuccessMsg']![locale.languageCode]; - String get vitalSignDetailEmpty => - localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String? get vitalSignDetailEmpty => + localizedValues['vitalSignDetailEmpty']![locale.languageCode]; - String get onlyOfftimeHoliday => - localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String? get onlyOfftimeHoliday => + localizedValues['onlyOfftimeHoliday']![locale.languageCode]; - String get active => localizedValues['active'][locale.languageCode]; + String? get active => localizedValues['active']![locale.languageCode]; - String get hold => localizedValues['hold'][locale.languageCode]; + String? get hold => localizedValues['hold']![locale.languageCode]; - String get loading => localizedValues['loading'][locale.languageCode]; + String? get loading => localizedValues['loading']![locale.languageCode]; - String get assessmentErrorMsg => - localizedValues['assessmentErrorMsg'][locale.languageCode]; + String? get assessmentErrorMsg => + localizedValues['assessmentErrorMsg']![locale.languageCode]; - String get examinationErrorMsg => - localizedValues['examinationErrorMsg'][locale.languageCode]; - - String get progressNoteErrorMsg => - localizedValues['progressNoteErrorMsg'][locale.languageCode]; - - String get chiefComplaintErrorMsg => - localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; - String get ICDName => localizedValues['ICDName'][locale.languageCode]; - - String get referralStatus => - localizedValues['referralStatus'][locale.languageCode]; - - String get referralRemark => - localizedValues['referralRemark'][locale.languageCode]; - String get offTime => localizedValues['offTime'][locale.languageCode]; - - String get icd => localizedValues['icd'][locale.languageCode]; - String get days => localizedValues['days'][locale.languageCode]; - String get hr => localizedValues['hr'][locale.languageCode]; - String get min => localizedValues['min'][locale.languageCode]; - String get months => localizedValues['months'][locale.languageCode]; - String get years => localizedValues['years'][locale.languageCode]; - String get referralStatusHold => - localizedValues['referralStatusHold'][locale.languageCode]; - String get referralStatusActive => - localizedValues['referralStatusActive'][locale.languageCode]; - String get referralStatusCancelled => - localizedValues['referralStatusCancelled'][locale.languageCode]; - String get referralStatusCompleted => - localizedValues['referralStatusCompleted'][locale.languageCode]; - String get referralStatusNotSeen => - localizedValues['referralStatusNotSeen'][locale.languageCode]; - String get clinicSearch => - localizedValues['clinicSearch'][locale.languageCode]; - String get doctorSearch => - localizedValues['doctorSearch'][locale.languageCode]; - String get referralResponse => - localizedValues['referralResponse'][locale.languageCode]; - String get estimatedCost => - localizedValues['estimatedCost'][locale.languageCode]; - String get diagnosisDetail => - localizedValues['diagnosisDetail'][locale.languageCode]; - String get referralSuccessMsgAccept => - localizedValues['referralSuccessMsgAccept'][locale.languageCode]; - String get referralSuccessMsgReject => - localizedValues['referralSuccessMsgReject'][locale.languageCode]; - - String get patientName => - localizedValues['patient-name'][locale.languageCode]; - - String get appointmentNumber => - localizedValues['appointmentNumber'][locale.languageCode]; - String get sickLeaveComments => - localizedValues['sickLeaveComments'][locale.languageCode]; - String get pastMedicalHistory => - localizedValues['pastMedicalHistory'][locale.languageCode]; - String get pastSurgicalHistory => - localizedValues['pastSurgicalHistory'][locale.languageCode]; - String get complications => - localizedValues['complications'][locale.languageCode]; - String get floor => localizedValues['floor'][locale.languageCode]; - String get roomCategory => - localizedValues['roomCategory'][locale.languageCode]; - String get otherDepartmentsInterventions => - localizedValues['otherDepartmentsInterventions'][locale.languageCode]; - String get otherProcedure => - localizedValues['otherProcedure'][locale.languageCode]; - String get admissionRequestSuccessMsg => - localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; - String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; - String get doctorResponse => - localizedValues['doctorResponse'][locale.languageCode]; - String get sickleaveonhold => - localizedValues['sickleaveonhold'][locale.languageCode]; - String get noClinic => localizedValues['no-clinic'][locale.languageCode]; - - String get otherStatistic => - localizedValues['otherStatistic'][locale.languageCode]; - - String get patientsreferral => - localizedValues['ptientsreferral'][locale.languageCode]; - String get arrivalpatient => - localizedValues['arrivalpatient'][locale.languageCode]; - String get searchmedicinepatient => - localizedValues['searchmedicinepatient'][locale.languageCode]; - String get appointmentDate => - localizedValues['appointmentDate'][locale.languageCode]; - String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; - - String get details => localizedValues['details'][locale.languageCode]; - String get liveCare => localizedValues['liveCare'][locale.languageCode]; - String get outpatient => localizedValues['out-patient'][locale.languageCode]; - String get billNo => localizedValues['BillNo'][locale.languageCode]; - String get labResults => localizedValues['labResults'][locale.languageCode]; - String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => - localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => - localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => - localizedValues['show-more-btn'][locale.languageCode]; - String get showDetail => localizedValues['showDetail'][locale.languageCode]; - String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; - - String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; - String get reschedule => localizedValues['reschedule'][locale.languageCode]; - String get leaves => localizedValues['leaves'][locale.languageCode]; - String get openRad => localizedValues['open-rad'][locale.languageCode]; - - String get totalApproval => - localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => - localizedValues['procedureStatus'][locale.languageCode]; - String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; - String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => - localizedValues['procedureName'][locale.languageCode]; - String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => - localizedValues['prescriptions'][locale.languageCode]; - String get notes => localizedValues['notes'][locale.languageCode]; - String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - String get searchWithOther => - localizedValues['searchWithOther'][locale.languageCode]; - String get hideOtherCriteria => - localizedValues['hideOtherCriteria'][locale.languageCode]; - String get applyForReschedule => - localizedValues['applyForReschedule'][locale.languageCode]; - - String get startDate => localizedValues['startDate'][locale.languageCode]; - String get endDate => localizedValues['endDate'][locale.languageCode]; - - String get addReschedule => - localizedValues['add-reschedule'][locale.languageCode]; - String get updateReschedule => - localizedValues['update-reschedule'][locale.languageCode]; - String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; - String get accepted => localizedValues['accepted'][locale.languageCode]; - String get cancelled => localizedValues['cancelled'][locale.languageCode]; - String get unReplied => localizedValues['unReplied'][locale.languageCode]; - String get replied => localizedValues['replied'][locale.languageCode]; - String get typeHereToReply => - localizedValues['typeHereToReply'][locale.languageCode]; - String get searchHere => localizedValues['searchHere'][locale.languageCode]; - String get remove => localizedValues['remove'][locale.languageCode]; - - String get step => localizedValues['step'][locale.languageCode]; - String get fieldRequired => - localizedValues['fieldRequired'][locale.languageCode]; - String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; - String get changeOfSchedule => - localizedValues['changeOfSchedule'][locale.languageCode]; - String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; - String get enterCredentials => - localizedValues['enter_credentials'][locale.languageCode]; - String get patpatientIDMobilenationalientID => - localizedValues['patientIDMobilenational'][locale.languageCode]; - - String get updateNow => localizedValues['updateNow'][locale.languageCode]; - String get updateTheApp => - localizedValues['updateTheApp'][locale.languageCode]; - String get admissionDate => - localizedValues['admission-date'][locale.languageCode]; - String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; - String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; - String get replayBefore => - localizedValues['replayBefore'][locale.languageCode]; - String get trySaying => localizedValues["try-saying"][locale.languageCode]; - String get acknowledged => - localizedValues['acknowledged'][locale.languageCode]; - String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; - String get pleaseEnterProcedure => - localizedValues["pleaseEnterProcedure"][locale.languageCode]; - String get fillTheMandatoryProcedureDetails => - localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; - String get atLeastThreeCharacters => - localizedValues["atLeastThreeCharacters"][locale.languageCode]; - String get searchProcedureHere => - localizedValues["searchProcedureHere"][locale.languageCode]; - String get noInsuranceApprovalFound => - localizedValues["noInsuranceApprovalFound"][locale.languageCode]; - String get procedure => localizedValues["procedure"][locale.languageCode]; - String get stopDate => localizedValues["stopDate"][locale.languageCode]; - String get processed => localizedValues["processed"][locale.languageCode]; - String get direction => localizedValues["direction"][locale.languageCode]; - String get refill => localizedValues["refill"][locale.languageCode]; - String get medicationHasBeenAdded => - localizedValues["medicationHasBeenAdded"][locale.languageCode]; - String get newPrescriptionOrder => - localizedValues["newPrescriptionOrder"][locale.languageCode]; - String get pleaseFillAllFields => - localizedValues["pleaseFillAllFields"][locale.languageCode]; - String get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] + String? get examinationErrorMsg => + localizedValues['examinationErrorMsg']![locale.languageCode]; + + String? get progressNoteErrorMsg => + localizedValues['progressNoteErrorMsg']![locale.languageCode]; + + String? get chiefComplaintErrorMsg => + localizedValues['chiefComplaintErrorMsg']![locale.languageCode]; + String? get ICDName => localizedValues['ICDName']![locale.languageCode]; + + String? get referralStatus => + localizedValues['referralStatus']![locale.languageCode]; + + String? get referralRemark => + localizedValues['referralRemark']![locale.languageCode]; + String? get offTime => localizedValues['offTime']![locale.languageCode]; + + String? get icd => localizedValues['icd']![locale.languageCode]; + String? get days => localizedValues['days']![locale.languageCode]; + String? get hr => localizedValues['hr']![locale.languageCode]; + String? get min => localizedValues['min']![locale.languageCode]; + String? get months => localizedValues['months']![locale.languageCode]; + String? get years => localizedValues['years']![locale.languageCode]; + String? get referralStatusHold => + localizedValues['referralStatusHold']![locale.languageCode]; + String? get referralStatusActive => + localizedValues['referralStatusActive']![locale.languageCode]; + String? get referralStatusCancelled => + localizedValues['referralStatusCancelled']![locale.languageCode]; + String? get referralStatusCompleted => + localizedValues['referralStatusCompleted']![locale.languageCode]; + String? get referralStatusNotSeen => + localizedValues['referralStatusNotSeen']![locale.languageCode]; + String? get clinicSearch => + localizedValues['clinicSearch']![locale.languageCode]; + String? get doctorSearch => + localizedValues['doctorSearch']![locale.languageCode]; + String? get referralResponse => + localizedValues['referralResponse']![locale.languageCode]; + String? get estimatedCost => + localizedValues['estimatedCost']![locale.languageCode]; + String? get diagnosisDetail => + localizedValues['diagnosisDetail']![locale.languageCode]; + String? get referralSuccessMsgAccept => + localizedValues['referralSuccessMsgAccept']![locale.languageCode]; + String? get referralSuccessMsgReject => + localizedValues['referralSuccessMsgReject']![locale.languageCode]; + + String? get patientName => + localizedValues['patient-name']![locale.languageCode]; + + String? get appointmentNumber => + localizedValues['appointmentNumber']![locale.languageCode]; + String? get sickLeaveComments => + localizedValues['sickLeaveComments']![locale.languageCode]; + String? get pastMedicalHistory => + localizedValues['pastMedicalHistory']![locale.languageCode]; + String? get pastSurgicalHistory => + localizedValues['pastSurgicalHistory']![locale.languageCode]; + String? get complications => + localizedValues['complications']![locale.languageCode]; + String? get floor => localizedValues['floor']![locale.languageCode]; + String? get roomCategory => + localizedValues['roomCategory']![locale.languageCode]; + String? get otherDepartmentsInterventions => + localizedValues['otherDepartmentsInterventions']![locale.languageCode]; + String? get otherProcedure => + localizedValues['otherProcedure']![locale.languageCode]; + String? get admissionRequestSuccessMsg => + localizedValues['admissionRequestSuccessMsg']![locale.languageCode]; + String? get infoStatus => localizedValues['infoStatus']![locale.languageCode]; + String? get doctorResponse => + localizedValues['doctorResponse']![locale.languageCode]; + String? get sickleaveonhold => + localizedValues['sickleaveonhold']![locale.languageCode]; + String? get noClinic => localizedValues['no-clinic']![locale.languageCode]; + + String? get otherStatistic => + localizedValues['otherStatistic']![locale.languageCode]; + + String? get patientsreferral => + localizedValues['ptientsreferral']![locale.languageCode]; + String? get arrivalpatient => + localizedValues['arrivalpatient']![locale.languageCode]; + String? get searchmedicinepatient => + localizedValues['searchmedicinepatient']![locale.languageCode]; + String? get appointmentDate => + localizedValues['appointmentDate']![locale.languageCode]; + String? get arrivedP => localizedValues['arrived_p']![locale.languageCode]; + + String? get details => localizedValues['details']![locale.languageCode]; + String? get liveCare => localizedValues['liveCare']![locale.languageCode]; + String? get outpatient => localizedValues['out-patient']![locale.languageCode]; + String? get billNo => localizedValues['BillNo']![locale.languageCode]; + String? get labResults => localizedValues['labResults']![locale.languageCode]; + String? get sendSuc => localizedValues['sendSuc']![locale.languageCode]; + String? get specialResult => + localizedValues['SpecialResult']![locale.languageCode]; + String? get noDataAvailable => + localizedValues['noDataAvailable']![locale.languageCode]; + String? get showMoreBtn => + localizedValues['show-more-btn']![locale.languageCode]; + String? get showDetail => localizedValues['showDetail']![locale.languageCode]; + String? get viewProfile => localizedValues['viewProfile']![locale.languageCode]; + + String? get fileNumber => localizedValues['fileNumber']![locale.languageCode]; + String? get reschedule => localizedValues['reschedule']![locale.languageCode]; + String? get leaves => localizedValues['leaves']![locale.languageCode]; + String? get openRad => localizedValues['open-rad']![locale.languageCode]; + + String? get totalApproval => + localizedValues['totalApproval']![locale.languageCode]; + String? get procedureStatus => + localizedValues['procedureStatus']![locale.languageCode]; + String? get unusedCount => localizedValues['unusedCount']![locale.languageCode]; + String? get companyName => localizedValues['companyName']![locale.languageCode]; + String? get procedureName => + localizedValues['procedureName']![locale.languageCode]; + String? get usageStatus => localizedValues['usageStatus']![locale.languageCode]; + String? get prescriptions => + localizedValues['prescriptions']![locale.languageCode]; + String? get notes => localizedValues['notes']![locale.languageCode]; + String? get dailyDoses => localizedValues['dailyDoses']![locale.languageCode]; + String? get searchWithOther => + localizedValues['searchWithOther']![locale.languageCode]; + String? get hideOtherCriteria => + localizedValues['hideOtherCriteria']![locale.languageCode]; + String? get applyForReschedule => + localizedValues['applyForReschedule']![locale.languageCode]; + + String? get startDate => localizedValues['startDate']![locale.languageCode]; + String? get endDate => localizedValues['endDate']![locale.languageCode]; + + String? get addReschedule => + localizedValues['add-reschedule']![locale.languageCode]; + String? get updateReschedule => + localizedValues['update-reschedule']![locale.languageCode]; + String? get sickLeave => localizedValues['sick_leave']![locale.languageCode]; + String? get accepted => localizedValues['accepted']![locale.languageCode]; + String? get cancelled => localizedValues['cancelled']![locale.languageCode]; + String? get unReplied => localizedValues['unReplied']![locale.languageCode]; + String? get replied => localizedValues['replied']![locale.languageCode]; + String? get typeHereToReply => + localizedValues['typeHereToReply']![locale.languageCode]; + String? get searchHere => localizedValues['searchHere']![locale.languageCode]; + String? get remove => localizedValues['remove']![locale.languageCode]; + + String? get step => localizedValues['step']![locale.languageCode]; + String? get fieldRequired => + localizedValues['fieldRequired']![locale.languageCode]; + String? get noSickLeave => localizedValues['no-sickleve']![locale.languageCode]; + String? get changeOfSchedule => + localizedValues['changeOfSchedule']![locale.languageCode]; + String? get newSchedule => localizedValues['newSchedule']![locale.languageCode]; + String? get enterCredentials => + localizedValues['enter_credentials']![locale.languageCode]; + String? get patpatientIDMobilenationalientID => + localizedValues['patientIDMobilenational']![locale.languageCode]; + + String? get updateNow => localizedValues['updateNow']![locale.languageCode]; + String? get updateTheApp => + localizedValues['updateTheApp']![locale.languageCode]; + String? get admissionDate => + localizedValues['admission-date']![locale.languageCode]; + String? get noOfDays => localizedValues['noOfDays']![locale.languageCode]; + String? get numOfDays => localizedValues['numOfDays']![locale.languageCode]; + String? get replayBefore => + localizedValues['replayBefore']![locale.languageCode]; + String? get trySaying => localizedValues["try-saying"]![locale.languageCode]; + String? get acknowledged => + localizedValues['acknowledged']![locale.languageCode]; + String? get didntCatch => localizedValues["didntCatch"]![locale.languageCode]; + String? get pleaseEnterProcedure => + localizedValues["pleaseEnterProcedure"]![locale.languageCode]; + String? get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"]![locale.languageCode]; + String? get atLeastThreeCharacters => + localizedValues["atLeastThreeCharacters"]![locale.languageCode]; + String? get searchProcedureHere => + localizedValues["searchProcedureHere"]![locale.languageCode]; + String? get noInsuranceApprovalFound => + localizedValues["noInsuranceApprovalFound"]![locale.languageCode]; + String? get procedure => localizedValues["procedure"]![locale.languageCode]; + String? get stopDate => localizedValues["stopDate"]![locale.languageCode]; + String? get processed => localizedValues["processed"]![locale.languageCode]; + String? get direction => localizedValues["direction"]![locale.languageCode]; + String? get refill => localizedValues["refill"]![locale.languageCode]; + String? get medicationHasBeenAdded => + localizedValues["medicationHasBeenAdded"]![locale.languageCode]; + String? get newPrescriptionOrder => + localizedValues["newPrescriptionOrder"]![locale.languageCode]; + String? get pleaseFillAllFields => + localizedValues["pleaseFillAllFields"]![locale.languageCode]; + String? get narcoticMedicineCanOnlyBePrescribedFromVida => + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"]! [locale.languageCode]; - String get only5DigitsAllowedForStrength => - localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; - String get unit => localizedValues["unit"][locale.languageCode]; - String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; - String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; - String get applyForRadiologyOrder => - localizedValues["applyForRadiologyOrder"][locale.languageCode]; - String get applyForNewLabOrder => - localizedValues["applyForNewLabOrder"][locale.languageCode]; - String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; - String get addRadiologyOrder => - localizedValues["addRadiologyOrder"][locale.languageCode]; - String get newRadiologyOrder => - localizedValues["newRadiologyOrder"][locale.languageCode]; - String get orderDate => localizedValues["orderDate"][locale.languageCode]; - String get examType => localizedValues["examType"][locale.languageCode]; - String get health => localizedValues["health"][locale.languageCode]; - String get summary => localizedValues["summary"][locale.languageCode]; - String get applyForNewPrescriptionsOrder => - localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; - String get noPrescriptionsFound => - localizedValues["noPrescriptionsFound"][locale.languageCode]; - String get noMedicalFileFound => - localizedValues["noMedicalFileFound"][locale.languageCode]; - String get insurance22 => localizedValues["insurance22"][locale.languageCode]; - String get approvals22 => localizedValues["approvals22"][locale.languageCode]; - String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => - localizedValues["graphDetails"][locale.languageCode]; - String get discharged => localizedValues["discharged"][locale.languageCode]; - String get addNewOrderSheet => - localizedValues["addNewOrderSheet"][locale.languageCode]; - String get addNewProgressNote => - localizedValues["addNewProgressNote"][locale.languageCode]; - String get notePending => localizedValues["notePending"][locale.languageCode]; - String get noteCanceled => - localizedValues["noteCanceled"][locale.languageCode]; - String get noteVerified => - localizedValues["noteVerified"][locale.languageCode]; - String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; - String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; - String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; - - String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; - - String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; - String get order => localizedValues["order"][locale.languageCode]; - String get sheet => localizedValues["sheet"][locale.languageCode]; - String get medical => localizedValues["medical"][locale.languageCode]; - String get report => localizedValues["report"][locale.languageCode]; - String get discharge => localizedValues["discharge"][locale.languageCode]; - String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => - localizedValues["notRepliedYet"][locale.languageCode]; - String get clearText => localizedValues["clearText"][locale.languageCode]; - String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; - String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; - String get comments => localizedValues['comments'][locale.languageCode]; + String? get only5DigitsAllowedForStrength => + localizedValues["only5DigitsAllowedForStrength"]![locale.languageCode]; + String? get unit => localizedValues["unit"]![locale.languageCode]; + String? get boxQuantity => localizedValues["boxQuantity"]![locale.languageCode]; + String? get orderTestOr => localizedValues["orderTestOr"]![locale.languageCode]; + String? get applyForRadiologyOrder => + localizedValues["applyForRadiologyOrder"]![locale.languageCode]; + String? get applyForNewLabOrder => + localizedValues["applyForNewLabOrder"]![locale.languageCode]; + String? get addLabOrder => localizedValues["addLabOrder"]![locale.languageCode]; + String? get addRadiologyOrder => + localizedValues["addRadiologyOrder"]![locale.languageCode]; + String? get newRadiologyOrder => + localizedValues["newRadiologyOrder"]![locale.languageCode]; + String? get orderDate => localizedValues["orderDate"]![locale.languageCode]; + String? get examType => localizedValues["examType"]![locale.languageCode]; + String? get health => localizedValues["health"]![locale.languageCode]; + String? get summary => localizedValues["summary"]![locale.languageCode]; + String? get applyForNewPrescriptionsOrder => + localizedValues["applyForNewPrescriptionsOrder"]![locale.languageCode]; + String? get noPrescriptionsFound => + localizedValues["noPrescriptionsFound"]![locale.languageCode]; + String? get noMedicalFileFound => + localizedValues["noMedicalFileFound"]![locale.languageCode]; + String? get insurance22 => localizedValues["insurance22"]![locale.languageCode]; + String? get approvals22 => localizedValues["approvals22"]![locale.languageCode]; + String? get severe => localizedValues["severe"]![locale.languageCode]; + String? get graphDetails => + localizedValues["graphDetails"]![locale.languageCode]; + String? get discharged => localizedValues["discharged"]![locale.languageCode]; + String? get addNewOrderSheet => + localizedValues["addNewOrderSheet"]![locale.languageCode]; + String? get addNewProgressNote => + localizedValues["addNewProgressNote"]![locale.languageCode]; + String? get notePending => localizedValues["notePending"]![locale.languageCode]; + String? get noteCanceled => + localizedValues["noteCanceled"]![locale.languageCode]; + String? get noteVerified => + localizedValues["noteVerified"]![locale.languageCode]; + String? get noteVerify => localizedValues["noteVerify"]![locale.languageCode]; + String? get noteConfirm => localizedValues["noteConfirm"]![locale.languageCode]; + String? get noteAdd => localizedValues["noteAdd"]![locale.languageCode]; + + String? get noteUpdate => localizedValues["noteUpdate"]![locale.languageCode]; + + String? get orderSheet => localizedValues["orderSheet"]![locale.languageCode]; + String? get order => localizedValues["order"]![locale.languageCode]; + String? get sheet => localizedValues["sheet"]![locale.languageCode]; + String? get medical => localizedValues["medical"]![locale.languageCode]; + String? get report => localizedValues["report"]![locale.languageCode]; + String? get discharge => localizedValues["discharge"]![locale.languageCode]; + String? get none => localizedValues["none"]![locale.languageCode]; + String? get notRepliedYet => + localizedValues["notRepliedYet"]![locale.languageCode]; + String? get clearText => localizedValues["clearText"]![locale.languageCode]; + String? get medicalReportAdd => localizedValues['medicalReportAdd']![locale.languageCode]; + String? get medicalReportVerify => localizedValues['medicalReportVerify']![locale.languageCode]; + String? get comments => localizedValues['comments']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 6d091756..ba7be235 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -4,20 +4,20 @@ import 'package:hexcolor/hexcolor.dart'; class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ - Key key, + Key? key, this.assetPath, this.onTap, this.label, this.height = 20, }) : super(key: key); - final String assetPath; - final Function onTap; - final String label; + final String? assetPath; + final Function? onTap; + final String? label; final double height; @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Container( margin: EdgeInsets.all(10), decoration: BoxDecoration( @@ -39,7 +39,7 @@ class MethodTypeCard extends StatelessWidget { Row( children: [ Image.asset( - assetPath, + assetPath!, height: 60, width: 60, ), diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 0c374e58..f44027e8 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -43,8 +43,8 @@ class SMSOTP { final focusD2 = FocusNode(); final focusD3 = FocusNode(); final focusD4 = FocusNode(); - String errorMsg; - ProjectViewModel projectProvider; + String? errorMsg; + ProjectViewModel? projectProvider; String displayTime = ''; bool isClosed = false; displayDialog(BuildContext context) async { @@ -109,7 +109,7 @@ class SMSOTP { Padding( padding: EdgeInsets.only(top: 5, right: 5), child: AppText( - TranslationBase.of(context).verificationMessage + + TranslationBase.of(context)!.verificationMessage! + ' XXXXXX' + mobileNo .toString() @@ -129,7 +129,7 @@ class SMSOTP { mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: SizeConfig.realScreenWidth * 0.16, + width: SizeConfig.realScreenWidth! * 0.16, margin: EdgeInsets.all(5), child: TextFormField( textInputAction: TextInputAction.next, @@ -158,7 +158,7 @@ class SMSOTP { ), ), Container( - width: SizeConfig.realScreenWidth * 0.16, + width: SizeConfig.realScreenWidth! * 0.16, margin: EdgeInsets.all(5), child: TextFormField( focusNode: focusD2, @@ -187,7 +187,7 @@ class SMSOTP { ), Container( margin: EdgeInsets.all(5), - width: SizeConfig.realScreenWidth * 0.16, + width: SizeConfig.realScreenWidth! * 0.16, child: TextFormField( focusNode: focusD3, textInputAction: TextInputAction.next, @@ -215,7 +215,7 @@ class SMSOTP { validator: validateCodeDigit)), Container( margin: EdgeInsets.all(5), - width: SizeConfig.realScreenWidth * 0.16, + width: SizeConfig.realScreenWidth! * 0.16, child: TextFormField( focusNode: focusD4, maxLength: 1, @@ -248,7 +248,7 @@ class SMSOTP { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).validationMessage + + TranslationBase.of(context)!.validationMessage! + ' ', fontWeight: FontWeight.w600, fontSize: 14, @@ -281,15 +281,15 @@ class SMSOTP { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -299,7 +299,7 @@ class SMSOTP { } // ignore: missing_return - String validateCodeDigit(value) { + String? validateCodeDigit(value) { if (value.isEmpty) { return ' '; } else if (value.length == 3) { @@ -310,7 +310,7 @@ class SMSOTP { } checkValue() async { - if (verifyAccountForm.currentState.validate()) { + if (verifyAccountForm.currentState!.validate()) { onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 27dbe8bf..8417cd14 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -8,13 +8,13 @@ import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; class VerificationMethodsList extends StatefulWidget { - final AuthMethodTypes authMethodType; - final Function(AuthMethodTypes type, bool isActive) authenticateUser; - final Function onShowMore; - final AuthenticationViewModel authenticationViewModel; + final AuthMethodTypes? authMethodType; + final Function(AuthMethodTypes type, bool isActive)? authenticateUser; + final Function? onShowMore; + final AuthenticationViewModel? authenticationViewModel; const VerificationMethodsList( - {Key key, + {Key? key, this.authMethodType, this.authenticateUser, this.onShowMore, @@ -28,7 +28,7 @@ class VerificationMethodsList extends StatefulWidget { class _VerificationMethodsListState extends State { final LocalAuthentication auth = LocalAuthentication(); - ProjectViewModel projectsProvider; + ProjectViewModel? projectsProvider; @override Widget build(BuildContext context) { @@ -39,48 +39,48 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/verify-whtsapp.png', onTap: () => - {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, + {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, label: TranslationBase - .of(context) - .verifyWith+ TranslationBase.of(context).verifyWhatsApp, + .of(context)! + .verifyWith!+ TranslationBase.of(context)!.verifyWhatsApp!, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/verify-sms.png", - onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, + onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, label:TranslationBase - .of(context) - .verifyWith+ TranslationBase.of(context).verifySMS, + .of(context)! + .verifyWith!+ TranslationBase.of(context)!.verifySMS!, ); break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( assetPath: 'assets/images/verification_fingerprint_icon.png', onTap: () async { - if (await widget.authenticationViewModel + if (await widget.authenticationViewModel! .checkIfBiometricAvailable(BiometricType.fingerprint)) { - widget.authenticateUser(AuthMethodTypes.Fingerprint, true); + widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); } }, label: TranslationBase - .of(context) - .verifyWith+TranslationBase.of(context).verifyFingerprint, + .of(context)! + .verifyWith!+TranslationBase.of(context)!.verifyFingerprint!, ); break; case AuthMethodTypes.FaceID: return MethodTypeCard( assetPath: 'assets/images/verification_faceid_icon.png', onTap: () async { - if (await widget.authenticationViewModel + if (await widget.authenticationViewModel! .checkIfBiometricAvailable(BiometricType.face)) { - widget.authenticateUser(AuthMethodTypes.FaceID, true); + widget.authenticateUser!(AuthMethodTypes.FaceID, true); } }, label: TranslationBase - .of(context) - .verifyWith+TranslationBase.of(context).verifyFaceID, + .of(context)! + .verifyWith!+TranslationBase.of(context)!.verifyFaceID!, ); break; @@ -88,7 +88,7 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', onTap: widget.onShowMore, - label: TranslationBase.of(context).moreVerification, + label: TranslationBase.of(context)!.moreVerification, height: 0, ); } diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart deleted file mode 100644 index aa532306..00000000 --- a/lib/widgets/charts/app_bar_chart.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -class AppBarChart extends StatelessWidget { - const AppBarChart({ - Key key, - @required this.seriesList, - }) : super(key: key); - - final List seriesList; - - @override - Widget build(BuildContext context) { - return Container( - height: 400, - margin: EdgeInsets.only(top: 60), - child: charts.BarChart( - seriesList, - // animate: animate, - - /// Customize the primary measure axis using a small tick renderer. - /// Use String instead of num for ordinal domain axis - /// (typically bar charts). - primaryMeasureAxis: new charts.NumericAxisSpec( - renderSpec: new charts.GridlineRendererSpec( - // Display the measure axis labels below the gridline. - // - // 'Before' & 'after' follow the axis value direction. - // Vertical axes draw 'before' below & 'after' above the tick. - // Horizontal axes draw 'before' left & 'after' right the tick. - labelAnchor: charts.TickLabelAnchor.before, - - // Left justify the text in the axis. - // - // Note: outside means that the secondary measure axis would right - // justify. - labelJustification: - charts.TickLabelJustification.outside, - )), - ), - ); - } -} diff --git a/lib/widgets/charts/app_line_chart.dart b/lib/widgets/charts/app_line_chart.dart index 1a29b1e6..65339771 100644 --- a/lib/widgets/charts/app_line_chart.dart +++ b/lib/widgets/charts/app_line_chart.dart @@ -9,14 +9,14 @@ import 'package:flutter/material.dart'; /// [stacked] stacked chart over the design class AppLineChart extends StatelessWidget { final List seriesList; - final String chartTitle; + final String? chartTitle; final bool animate; final bool includeArea; final bool stacked; AppLineChart( - {Key key, - @required this.seriesList, + {Key? key, + required this.seriesList, this.chartTitle, this.animate = true, this.includeArea = false, @@ -28,7 +28,7 @@ class AppLineChart extends StatelessWidget { child: Column( children: [ Text( - chartTitle, + chartTitle!, style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold), ), Expanded( diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 670284a1..976938f7 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -12,8 +12,8 @@ import 'package:flutter/material.dart'; /// [endDate] the end date class AppTimeSeriesChart extends StatelessWidget { AppTimeSeriesChart({ - Key key, - @required this.seriesList, + Key? key, + required this.seriesList, this.chartName = '', this.startDate, this.endDate, @@ -21,8 +21,8 @@ class AppTimeSeriesChart extends StatelessWidget { final String chartName; final List> seriesList; - final DateTime startDate; - final DateTime endDate; + final DateTime? startDate; + final DateTime? endDate; @override Widget build(BuildContext context) { @@ -32,7 +32,7 @@ class AppTimeSeriesChart extends StatelessWidget { children: [ AppText(chartName, fontSize: SizeConfig.textMultiplier * 3), Container( - height: SizeConfig.realScreenHeight * 0.37, + height: SizeConfig.realScreenHeight! * 0.37, child: Center( child: Container( child: charts.TimeSeriesChart( @@ -65,7 +65,7 @@ class TimeSeriesSales { class TimeSeriesSales2 { final DateTime time; - final double sales; + final double? sales; TimeSeriesSales2(this.time, this.sales); } diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart index 659e4562..bf91fb09 100644 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -26,7 +26,7 @@ class DashboardItemTexts extends StatefulWidget { } class _DashboardItemTextsState extends State { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index 6769c568..856ea66a 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class GaugeChart extends StatelessWidget { final List seriesList; - final bool animate; + final bool? animate; GaugeChart(this.seriesList, {this.animate}); @@ -19,12 +19,12 @@ class GaugeChart extends StatelessWidget { @override Widget build(BuildContext context) { return new charts.PieChart(seriesList, - animate: animate, + animate: animate!, defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); //); } - static List> _createSampleData() { + static List> _createSampleData() { final data = [ new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault), new GaugeSegment( @@ -35,10 +35,10 @@ class GaugeChart extends StatelessWidget { ]; return [ - new charts.Series( + new charts.Series( id: 'Segments', domainFn: (GaugeSegment segment, _) => segment.segment, - measureFn: (GaugeSegment segment, _) => segment.size, + measureFn: (GaugeSegment segment, _) => segment.size!, data: data, ) ]; @@ -47,8 +47,8 @@ class GaugeChart extends StatelessWidget { /// Sample data type. class GaugeSegment { - final String segment; - final int size; + final String? segment; + final int? size; final charts.Color color; GaugeSegment(this.segment, this.size, this.color); } diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 2b982e20..38abe3c6 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -10,9 +10,9 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { value.summaryoptions - .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + .sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!); - var list = new List(); + var list = []; value.summaryoptions.forEach((result) => {list.add(getStack(result, value.summaryoptions.first.value))}); return Column( @@ -41,7 +41,7 @@ class GetOutPatientStack extends StatelessWidget { begin: Alignment.topLeft, end: Alignment( 0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow + colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), borderRadius: BorderRadius.circular(8), @@ -55,7 +55,7 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? (150 * value.value) / max : 0, + height: max != 0 ? (150 * value.value!) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a22932f4..a9f90719 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class RowCounts extends StatelessWidget { final name; - final int count; + final int? count; final Color c; RowCounts(this.name, this.count, this.c); @override diff --git a/lib/widgets/data_display/list/custom_Item.dart b/lib/widgets/data_display/list/custom_Item.dart index c11af999..585301ea 100644 --- a/lib/widgets/data_display/list/custom_Item.dart +++ b/lib/widgets/data_display/list/custom_Item.dart @@ -14,20 +14,20 @@ import 'package:flutter/material.dart'; /// [child] child of the widget /// [decoration] decoration of the widget class CustomItem extends StatelessWidget { - final IconData startIcon; + final IconData? startIcon; final double startIconSize; - final Color startIconColor; + final Color? startIconColor; final IconData endIcon; final double endIconSize; - final Color endIconColor; + final Color? endIconColor; final bool disabled; - final Function onTap; - final EdgeInsets padding; - final Widget child; - final BoxDecoration decoration; + final Function? onTap; + final EdgeInsets? padding; + final Widget? child; + final BoxDecoration? decoration; CustomItem( - {Key key, + {Key? key, this.startIcon, this.disabled: false, this.onTap, @@ -49,11 +49,11 @@ class CustomItem extends StatelessWidget { decoration: decoration != null ? decoration : BoxDecoration(), child: InkWell( onTap: () { - if (onTap != null) onTap(); + if (onTap != null) onTap!(); }, child: Padding( padding: padding != null - ? padding + ? padding! : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), child: Row( children: [ @@ -68,7 +68,7 @@ class CustomItem extends StatelessWidget { ), if (startIcon != null) SizedBox(width: 18.0), Expanded( - child: child, + child: child!, flex: 10, ), endIcon == null diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index a35fa279..8f374ca3 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -14,11 +14,11 @@ import 'package:flutter/material.dart'; class FlexibleContainer extends StatelessWidget { final double widthFactor; final double heightFactor; - final EdgeInsets padding; - final Widget child; + final EdgeInsets? padding; + final Widget? child; FlexibleContainer({ - Key key, + Key? key, this.widthFactor = 0.9, this.heightFactor = 1, this.padding, diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 7817ba3c..423e2bff 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -13,10 +13,10 @@ import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class DoctorReplyWidget extends StatefulWidget { - final ListGtMyPatientsQuestions reply; + final ListGtMyPatientsQuestions? reply; bool isShowMore = false; - DoctorReplyWidget({Key key, this.reply}); + DoctorReplyWidget({Key? key, this.reply}); @override _DoctorReplyWidgetState createState() => _DoctorReplyWidgetState(); @@ -30,7 +30,7 @@ class _DoctorReplyWidgetState extends State { return Container( child: CardWithBgWidget( bgColor: - widget.reply.status == 2 + widget.reply!.status == 2 ? Color(0xFF2E303A) : Color(0xFFD02127), hasBorder: false, @@ -50,9 +50,9 @@ class _DoctorReplyWidgetState extends State { color: Colors.black), children: [ new TextSpan( - text: widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , + text: widget.reply!.status==2 ? "Active":widget.reply!.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , style: TextStyle( - color: widget.reply.status == 2 + color: widget.reply!.status == 2 ? Color(0xFF2E303A) : Color(0xFFD02127), @@ -67,19 +67,19 @@ class _DoctorReplyWidgetState extends State { children: [ AppText( AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.reply!.createdOn) .day .toString() + " " + AppDateUtils.getMonth( AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.reply!.createdOn) .month) .toString() .substring(0, 3) + ' ' + AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.reply!.createdOn) .year .toString(), fontFamily: 'Poppins', @@ -87,12 +87,12 @@ class _DoctorReplyWidgetState extends State { ), AppText( AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.reply!.createdOn) .hour .toString() + ":"+ AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.reply!.createdOn) .minute .toString(), fontFamily: 'Poppins', @@ -108,7 +108,7 @@ class _DoctorReplyWidgetState extends State { children: [ Expanded( child: AppText( - Helpers.capitalize( widget.reply.patientName), + Helpers.capitalize( widget.reply!.patientName), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -118,7 +118,7 @@ class _DoctorReplyWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" +widget.reply.mobileNumber); + launch("tel://" +widget.reply!.mobileNumber!); }, child: Icon( Icons.phone, @@ -129,7 +129,7 @@ class _DoctorReplyWidgetState extends State { SizedBox( width: 4, ), - widget.reply.gender == 1 + widget.reply!.gender == 1 ? Icon( DoctorApp.male_2, color: Colors.blue, @@ -156,7 +156,7 @@ class _DoctorReplyWidgetState extends State { width: 60, height: 60, child: Image.asset( - widget.reply.gender == 1 + widget.reply!.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -188,11 +188,11 @@ class _DoctorReplyWidgetState extends State { color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).fileNumber, + text: TranslationBase.of(context)!.fileNumber, style: TextStyle( fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold, fontFamily: 'Poppins')), new TextSpan( - text: widget.reply.patientID.toString(), + text: widget.reply!.patientID.toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -211,12 +211,12 @@ class _DoctorReplyWidgetState extends State { ), children: [ new TextSpan( - text: TranslationBase.of(context).age + + text: TranslationBase.of(context)!.age! + " : ", style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(widget.reply!.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index c4343a4b..53359219 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -9,9 +9,9 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class LabResultWidget extends StatefulWidget { - final List labResult; + final List? labResult; - LabResultWidget({Key key, this.labResult}); + LabResultWidget({Key? key, this.labResult}); @override _LabResultWidgetState createState() => _LabResultWidgetState(); @@ -31,7 +31,7 @@ class _LabResultWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).generalResult, + TranslationBase.of(context)!.generalResult, fontSize: 2.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -73,7 +73,7 @@ class _LabResultWidgetState extends State { ), child: Center( child: AppText( - TranslationBase.of(context).description, + TranslationBase.of(context)!.description, color: Colors.white, ), ), @@ -85,7 +85,7 @@ class _LabResultWidgetState extends State { color: HexColor('#515B5D'), child: Center( child: AppText( - TranslationBase.of(context).value, + TranslationBase.of(context)!.value, color: Colors.white), ), height: 60), @@ -100,7 +100,7 @@ class _LabResultWidgetState extends State { ), child: Center( child: AppText( - TranslationBase.of(context).range, + TranslationBase.of(context)!.range, color: Colors.white), ), height: 60), @@ -108,7 +108,7 @@ class _LabResultWidgetState extends State { ], ), ), - ...widget.labResult.map((result) { + ...widget.labResult!.map((result) { return Container( padding: EdgeInsets.symmetric(horizontal: 4), decoration: BoxDecoration( diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 453cff30..a407cf75 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -13,13 +13,13 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class MyReferralPatientWidget extends StatefulWidget { - final MyReferralPatientModel myReferralPatientModel; - final ReferralPatientViewModel model; - final bool isExpand; - final Function expandClick; + final MyReferralPatientModel? myReferralPatientModel; + final ReferralPatientViewModel? model; + final bool? isExpand; + final Function? expandClick; MyReferralPatientWidget( - {Key key, + {Key? key, this.myReferralPatientModel, this.model, this.isExpand, @@ -33,13 +33,13 @@ class MyReferralPatientWidget extends StatefulWidget { class _MyReferralPatientWidgetState extends State { bool _isLoading = false; final _formKey = GlobalKey(); - String error; - TextEditingController answerController; + String? error; + TextEditingController? answerController; @override void initState() { answerController = new TextEditingController( - text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); + text: widget.myReferralPatientModel!.referredDoctorRemarks ?? ''); super.initState(); } @@ -79,7 +79,7 @@ class _MyReferralPatientWidgetState extends State { padding: EdgeInsets.symmetric( vertical: 4, horizontal: 4), child: AppText( - '${widget.myReferralPatientModel.priorityDescription}', + '${widget.myReferralPatientModel!.priorityDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -90,7 +90,7 @@ class _MyReferralPatientWidgetState extends State { height: 10, ), AppText( - '${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.middleName} ${widget.myReferralPatientModel.lastName}', + '${widget.myReferralPatientModel!.firstName} ${widget.myReferralPatientModel!.middleName} ${widget.myReferralPatientModel!.lastName}', fontSize: 2 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -102,7 +102,7 @@ class _MyReferralPatientWidgetState extends State { Row( children: [ AppText( - TranslationBase.of(context).fileNo, + TranslationBase.of(context)!.fileNo, fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -112,7 +112,7 @@ class _MyReferralPatientWidgetState extends State { width: 20, ), AppText( - '${widget.myReferralPatientModel.referralDoctor}', + '${widget.myReferralPatientModel!.referralDoctor}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -127,7 +127,7 @@ class _MyReferralPatientWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8), child: InkWell( - onTap: widget.expandClick, + onTap: widget.expandClick as void Function()?, child: Image.asset( "assets/images/ic_circle_arrow.png", width: 25, @@ -170,7 +170,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).referralDoctor, + TranslationBase.of(context)!.referralDoctor, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -182,7 +182,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${widget.myReferralPatientModel.referringDoctorName}', + '${widget.myReferralPatientModel!.referringDoctorName}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -213,7 +213,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).referringClinic, + TranslationBase.of(context)!.referringClinic, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -225,7 +225,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${widget.myReferralPatientModel.referringClinicDescription}', + '${widget.myReferralPatientModel!.referringClinicDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -268,7 +268,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).frequency, + TranslationBase.of(context)!.frequency, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -280,7 +280,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${widget.myReferralPatientModel.frequencyDescription}', + '${widget.myReferralPatientModel!.frequencyDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -311,7 +311,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).maxResponseTime, + TranslationBase.of(context)!.maxResponseTime, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -323,7 +323,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}', + '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel!.mAXResponseTime!)}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -365,7 +365,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context)! .clinicDetailsandRemarks, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, @@ -378,7 +378,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${widget.myReferralPatientModel.referringDoctorRemarks}', + '${widget.myReferralPatientModel!.referringDoctorRemarks}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -414,12 +414,12 @@ class _MyReferralPatientWidgetState extends State { controller: answerController, maxLines: 3, minLines: 2, - hintText: TranslationBase.of(context).answerThePatient, + hintText: TranslationBase.of(context)!.answerThePatient, fontWeight: FontWeight.normal, readOnly: _isLoading, validator: (value) { if (value.isEmpty) - return TranslationBase.of(context) + return TranslationBase.of(context)! .pleaseEnterAnswer; else return null; @@ -431,22 +431,22 @@ class _MyReferralPatientWidgetState extends State { width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), child: AppButton( - title : TranslationBase.of(context).replay, + title : TranslationBase.of(context)!.replay, onPressed: () async { - final form = _formKey.currentState; + final form = _formKey.currentState!; if (form.validate()) { try { - await widget.model.replay( - answerController.text.toString(), - widget.myReferralPatientModel); + await widget.model!.replay( + answerController!.text.toString(), + widget.myReferralPatientModel!); DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).replySuccessfully); + TranslationBase.of(context)!.replySuccessfully); } catch (e) { DrAppToastMsg.showErrorToast(e); } } }, - loading: widget.model.state == ViewState.BusyLocal, + loading: widget.model!.state == ViewState.BusyLocal, ), ) ], diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 54df8cd9..558b6660 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -10,15 +10,15 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { - final ListDoctorWorkingHoursTable workingHoursTable; + final ListDoctorWorkingHoursTable? workingHoursTable; - MyScheduleWidget({Key key, this.workingHoursTable}); + MyScheduleWidget({Key? key, this.workingHoursTable}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); List workingHours = Helpers.getWorkingHours( - workingHoursTable.workingHours, + workingHoursTable!.workingHours!, ); return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -33,13 +33,13 @@ class MyScheduleWidget extends StatelessWidget { height: 10, ), AppText( - projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , + projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable!.date!.weekday): AppDateUtils.getWeekDay(workingHoursTable!.date!.weekday) , fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( - ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + ' ${workingHoursTable!.date!.day} ${(AppDateUtils.getMonth(workingHoursTable!.date!.month).toString().substring(0, 3))}', fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -51,7 +51,7 @@ class MyScheduleWidget extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( - bgColor: AppDateUtils.isToday(workingHoursTable.date) + bgColor: AppDateUtils.isToday(workingHoursTable!.date!) ? Colors.green[500] : Colors.transparent, // hasBorder: false, @@ -59,7 +59,7 @@ class MyScheduleWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (AppDateUtils.isToday(workingHoursTable.date)) + if (AppDateUtils.isToday(workingHoursTable!.date!)) AppText( "Today", fontSize: 1.8 * SizeConfig.textMultiplier, @@ -81,9 +81,9 @@ class MyScheduleWidget extends StatelessWidget { SizedBox( height: 5, ), - if(workingHoursTable.clinicName!=null) + if(workingHoursTable!.clinicName!=null) AppText( - workingHoursTable.clinicName??"", + workingHoursTable!.clinicName??"", fontSize: 15, fontWeight: FontWeight.w700, ), @@ -95,9 +95,9 @@ class MyScheduleWidget extends StatelessWidget { fontWeight: FontWeight.w300, ), ), - if(workingHoursTable.projectName!=null) + if(workingHoursTable!.projectName!=null) AppText( - workingHoursTable.projectName??"", + workingHoursTable!.projectName??"", fontSize: 15, fontWeight: FontWeight.w700, ), diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index f4f78c08..8656af15 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -18,14 +18,14 @@ import '../shared/rounded_container_widget.dart'; */ class MedicineItemWidget extends StatefulWidget { - final String label; + final String? label; final Color backgroundColor; final bool showBorder; final Color borderColor; - final String url; + final String? url; MedicineItemWidget( - {@required this.label, + {required this.label, this.backgroundColor = Colors.white, this.showBorder = false, this.borderColor = Colors.white, @@ -52,7 +52,7 @@ class _MedicineItemWidgetState extends State { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.network( - widget.url, + widget.url!, height: SizeConfig.imageSizeMultiplier * 15, width: SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 179633e7..5c1486ef 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -12,16 +12,16 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class PatientCard extends StatelessWidget { - final PatiantInformtion patientInfo; - final Function onTap; - final String patientType; - final String arrivalType; - final bool isInpatient; + final PatiantInformtion? patientInfo; + final Function? onTap; + final String? patientType; + final String? arrivalType; + final bool? isInpatient; final bool isMyPatient; final bool isFromSearch; const PatientCard( - {Key key, + {Key? key, this.patientInfo, this.onTap, this.patientType, @@ -31,7 +31,7 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: SizeConfig.screenWidth * 0.9, + width: SizeConfig.screenWidth! * 0.9, margin: EdgeInsets.all(6), padding: EdgeInsets.only(left: 0, right: 5, bottom: 0, top: 0), decoration: BoxDecoration( @@ -40,12 +40,12 @@ class PatientCard extends StatelessWidget { ), child: CardWithBgWidget( padding: 0, - marginLeft: (!isMyPatient && isInpatient)?0:10, + marginLeft: (!isMyPatient && isInpatient!)?0:10, marginSymmetric:isFromSearch ? 10 : 0.0, hasBorder: false, - bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43 + bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo!.patientStatusType == 43 ? Colors.green[500] - :isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white, + :isMyPatient? Colors.green[500]:isInpatient!?Colors.white:!isFromSearch?Colors.red[800]:Colors.white, widget: Container( color: Colors.white, // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), @@ -55,17 +55,17 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - !(isInpatient && !isFromSearch) + !(isInpatient! && !isFromSearch) ? Padding( padding: EdgeInsets.only(left: 12.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patientInfo.patientStatusType == 43 + patientInfo!.patientStatusType == 43 ? Row( children: [ AppText( - TranslationBase.of(context).arrivedP, + TranslationBase.of(context)!.arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -75,18 +75,18 @@ class PatientCard extends StatelessWidget { SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), SizedBox(width: 8,), AppText( - patientInfo.status==2? 'Confirmed':'Booked', - color: patientInfo.status==2? Colors.green:Colors.grey , + patientInfo!.status==2? 'Confirmed':'Booked', + color: patientInfo!.status==2? Colors.green:Colors.grey , fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, ), ], ) - : patientInfo.patientStatusType == 42?Row( + : patientInfo!.patientStatusType == 42?Row( children: [ AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context)!.notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -96,17 +96,17 @@ class PatientCard extends StatelessWidget { SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), SizedBox(width: 8,), AppText( - patientInfo.status==2? 'Confirmed':'Booked', - color: patientInfo.status==2? Colors.green:Colors.grey , + patientInfo!.status==2? 'Confirmed':'Booked', + color: patientInfo!.status==2? Colors.green:Colors.grey , fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, ), ], - ): !isFromSearch && patientInfo.patientStatusType==null ? Row( + ): !isFromSearch && patientInfo!.patientStatusType==null ? Row( children: [ AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context)!.notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -116,8 +116,8 @@ class PatientCard extends StatelessWidget { SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), SizedBox(width: 8,), AppText( - patientInfo.status==2? 'Booked':'Confirmed', - color: patientInfo.status==2? Colors.grey:Colors.green , + patientInfo!.status==2? 'Booked':'Confirmed', + color: patientInfo!.status==2? Colors.grey:Colors.green , fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -126,24 +126,24 @@ class PatientCard extends StatelessWidget { ):SizedBox(), this.arrivalType == '1' ? AppText( - patientInfo.startTime != null - ? patientInfo.startTime - : patientInfo.startTimes, + patientInfo!.startTime != null + ? patientInfo!.startTime + : patientInfo!.startTimes, fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) - : patientInfo.arrivedOn != null + : patientInfo!.arrivedOn != null ? AppText( - AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.arrivedOn,) - )+" "+ "${AppDateUtils.getStartTime(patientInfo.startTime)}", + AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo!.arrivedOn,) + )+" "+ "${AppDateUtils.getStartTime(patientInfo!.startTime!)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, ) - : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? + : (patientInfo!.appointmentDate != null && patientInfo!.appointmentDate!.isNotEmpty)? AppText( - "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", + "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo!.appointmentDate,))} ${AppDateUtils.getStartTime(patientInfo!.startTime!)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, @@ -151,7 +151,7 @@ class PatientCard extends StatelessWidget { ], )) : SizedBox(), - if(isInpatient && isMyPatient && !isFromSearch) + if(isInpatient! && isMyPatient && !isFromSearch) Row( children: [ SizedBox(width: 12,), @@ -174,9 +174,9 @@ class PatientCard extends StatelessWidget { Expanded( // width: MediaQuery.of(context).size.width*0.51, child: AppText( - (Helpers.capitalize(patientInfo.firstName) + + (Helpers.capitalize(patientInfo!.firstName)! + " " + - Helpers.capitalize(patientInfo.lastName)), + Helpers.capitalize(patientInfo!.lastName)!), fontSize: 16, color: Color(0xff2e303a), fontWeight: FontWeight.w700, @@ -184,7 +184,7 @@ class PatientCard extends StatelessWidget { textOverflow: TextOverflow.ellipsis, ), ), - if (patientInfo.gender == 1) + if (patientInfo!.gender == 1) Icon( DoctorApp.male_2, color: Colors.blue, @@ -197,31 +197,31 @@ class PatientCard extends StatelessWidget { Row( children: [ AppText( - patientInfo.nationalityName != null - ? patientInfo.nationalityName.trim() - : patientInfo.nationality != null - ? patientInfo.nationality.trim() - : patientInfo.nationalityId != null - ? patientInfo.nationalityId + patientInfo!.nationalityName != null + ? patientInfo!.nationalityName!.trim() + : patientInfo!.nationality != null + ? patientInfo!.nationality!.trim() + : patientInfo!.nationalityId != null + ? patientInfo!.nationalityId : "", fontWeight: FontWeight.bold, fontSize: 14, textOverflow: TextOverflow.ellipsis, ), - patientInfo.nationality != null || - patientInfo.nationalityId != null + patientInfo!.nationality != null || + patientInfo!.nationalityId != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patientInfo.nationalityFlagURL != null - ? patientInfo.nationalityFlagURL + patientInfo!.nationalityFlagURL != null + ? patientInfo!.nationalityFlagURL! : '', height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return AppText( 'No Image', fontSize: 10, @@ -243,7 +243,7 @@ class PatientCard extends StatelessWidget { width: 60, height: 60, child: Image.asset( - patientInfo.gender == 1 + patientInfo!.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -267,13 +267,13 @@ class PatientCard extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context) + text: TranslationBase.of(context)! .fileNumber, style: TextStyle( fontSize: 12, fontFamily: 'Poppins')), new TextSpan( - text: patientInfo.patientId.toString(), + text: patientInfo!.patientId.toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -294,12 +294,12 @@ class PatientCard extends StatelessWidget { children: [ new TextSpan( text: - TranslationBase.of(context).age + + TranslationBase.of(context)!.age! + " : ", style: TextStyle(fontSize: 12)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 13)), @@ -307,7 +307,7 @@ class PatientCard extends StatelessWidget { ), ), ), - if (isInpatient ) + if (isInpatient! ) Container( child: RichText( text: new TextSpan( @@ -319,21 +319,21 @@ class PatientCard extends StatelessWidget { ), children: [ new TextSpan( - text: patientInfo.admissionDate == null + text: patientInfo!.admissionDate == null ? "" - : TranslationBase.of(context) - .admissionDate + + : TranslationBase.of(context)! + .admissionDate! + " : ", style: TextStyle(fontSize: 12)), new TextSpan( - text: patientInfo.admissionDate == null + text: patientInfo!.admissionDate == null ? "" - : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(patientInfo!.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 13)), ]))), - if (patientInfo.admissionDate != null) + if (patientInfo!.admissionDate != null) Container( child: RichText( text: new TextSpan( @@ -345,10 +345,10 @@ class PatientCard extends StatelessWidget { ), children: [ new TextSpan( - text: TranslationBase.of(context).numOfDays + " : ", + text: TranslationBase.of(context)!.numOfDays! + " : ", style: TextStyle(fontSize: 12)), new TextSpan( - text: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + text: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate)).inDays + 1}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 13)), @@ -356,18 +356,18 @@ class PatientCard extends StatelessWidget { ])) ]), - !isInpatient && !isFromSearch + !isInpatient! && !isFromSearch ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Container( padding: EdgeInsets.all(4), child: Image.asset( - patientInfo.appointmentType == + patientInfo!.appointmentType == 'Regular' && - patientInfo.visitTypeId == 100 + patientInfo!.visitTypeId == 100 ? 'assets/images/livecare.png' - : patientInfo.appointmentType == + : patientInfo!.appointmentType == 'Walkin' ? 'assets/images/walkin.png' : 'assets/images/booked.png', @@ -390,7 +390,7 @@ class PatientCard extends StatelessWidget { : SizedBox() ], ), - onTap: onTap, + onTap: onTap as void Function()?, )), )); } diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart index c903bd7b..9179f46f 100644 --- a/lib/widgets/patients/clinic_list_dropdwon.dart +++ b/lib/widgets/patients/clinic_list_dropdwon.dart @@ -8,11 +8,11 @@ import 'package:provider/provider.dart'; class ClinicList extends StatelessWidget { - ProjectViewModel projectsProvider; - final int clinicId; - final Function (int value) onClinicChange; + late ProjectViewModel projectsProvider; + final int? clinicId; + final Function (int? value)? onClinicChange; - ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); + ClinicList({Key? key, this.clinicId, this.onClinicChange}) : super(key: key); @override Widget build(BuildContext context) { @@ -69,15 +69,15 @@ class ClinicList extends StatelessWidget { ); }).toList(); }, - onChanged: (newValue){ - onClinicChange(newValue); + onChanged: (dynamic newValue){ + onClinicChange!(newValue); }, items: projectsProvider .doctorClinicsList .map((item) { return DropdownMenuItem( child: Text( - item.clinicName, + item.clinicName!, textAlign: TextAlign.end, ), @@ -92,7 +92,7 @@ class ClinicList extends StatelessWidget { ) : AppText( TranslationBase - .of(context) + .of(context)! .noClinic), ); } diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index d2a68acd..0f5bd77c 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -59,10 +59,10 @@ class _DynamicElementsState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; InputDecoration textFieldSelectorDecoration( - {String hintText, - String selectedText, - bool isDropDown, - IconData icon}) { + {String? hintText, + String? selectedText, + required bool isDropDown, + IconData? icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -104,7 +104,7 @@ class _DynamicElementsState extends State { child: AppTextFormField( borderColor: Colors.white, onTap: () => _presentDatePicker('_selectedFromDate'), - hintText: TranslationBase.of(context).fromDate, + hintText: TranslationBase.of(context)!.fromDate, controller: _fromDateController, inputFormatter: ONLY_DATE, onSaved: (value) { @@ -134,7 +134,7 @@ class _DynamicElementsState extends State { child: AppTextFormField( readOnly: true, borderColor: Colors.white, - hintText: TranslationBase.of(context).toDate, + hintText: TranslationBase.of(context)!.toDate, controller: _toDateController, onTap: () { _presentDatePicker('_selectedToDate'); diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index a08282c0..0be8d12e 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -9,24 +9,24 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { - final String referralStatus; - final int referralStatusCode; - final String patientName; - final int patientGender; - final String referredDate; - final String referredTime; - final String patientID; + final String? referralStatus; + final int? referralStatusCode; + final String? patientName; + final int? patientGender; + final String? referredDate; + final String? referredTime; + final String? patientID; final isSameBranch; - final bool isReferral; + final bool? isReferral; final bool isReferralClinic; - final String referralClinic; - final String remark; - final String nationality; - final String nationalityFlag; - final String doctorAvatar; - final String referralDoctorName; - final String clinicDescription; - final Widget infoIcon; + final String? referralClinic; + final String? remark; + final String? nationality; + final String? nationalityFlag; + final String? doctorAvatar; + final String? referralDoctorName; + final String? clinicDescription; + final Widget? infoIcon; PatientReferralItemWidget( {this.referralStatus, @@ -138,7 +138,7 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).fileNumber, + TranslationBase.of(context)!.fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -157,7 +157,7 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, + isSameBranch ? TranslationBase.of(context)!.referredFrom :TranslationBase.of(context)!.refClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -165,7 +165,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), AppText( - !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, + !isReferralClinic? isSameBranch ? TranslationBase.of(context)!.sameBranch : TranslationBase.of(context)!.otherBranch: " "+referralClinic!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -188,12 +188,12 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - nationalityFlag, + nationalityFlag!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -207,7 +207,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks + " : ", + TranslationBase.of(context)!.remarks! + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -231,7 +231,7 @@ class PatientReferralItemWidget extends StatelessWidget { Container( margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( - isReferral + isReferral! ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -249,12 +249,12 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - doctorAvatar, + doctorAvatar!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) diff --git a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart index aef7a161..d1385d0e 100644 --- a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart +++ b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart @@ -21,7 +21,7 @@ class PatientHeaderWidgetNoAvatar extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - patient.firstName + ' ' + patient.lastName, + patient.firstName! + ' ' + patient.lastName!, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.2, ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 2cf9a5ca..9281a9a7 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -8,25 +8,25 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientProfileButton extends StatelessWidget { - final String nameLine1; - final String nameLine2; - final String icon; + final String? nameLine1; + final String? nameLine2; + final String? icon; final dynamic route; - final PatiantInformtion patient; - final String patientType; - String arrivalType; - final bool isInPatient; - String from; - String to; + final PatiantInformtion? patient; + final String? patientType; + String? arrivalType; + final bool? isInPatient; + String? from; + String? to; final String url = "assets/images/"; final bool isDisable; final bool isLoading; - final Function onTap; - final bool isDischargedPatient; + final Function? onTap; + final bool? isDischargedPatient; final bool isSelectInpatient; PatientProfileButton({ - Key key, + Key? key, this.patient, this.patientType, this.arrivalType, @@ -55,7 +55,7 @@ class PatientProfileButton extends StatelessWidget { onTap: isDisable ? null : onTap != null - ? onTap + ? onTap as void Function()? : () { navigator(context, this.route); }, @@ -67,7 +67,7 @@ class PatientProfileButton extends StatelessWidget { children: [ Container( child: new Image.asset( - url + icon, + url + icon!, width: 30, height: 30, fit: BoxFit.contain, diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart index e0eb5b12..9c3f4d5a 100644 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ b/lib/widgets/patients/profile/Profile_general_info_Widget.dart @@ -13,9 +13,9 @@ import '../../shared/rounded_container_widget.dart'; *@desc: Profile General Info Widget class */ class ProfileGeneralInfoWidget extends StatelessWidget { - ProfileGeneralInfoWidget({Key key, this.patient}) : super(key: key); + ProfileGeneralInfoWidget({Key? key, this.patient}) : super(key: key); - PatiantInformtion patient; + PatiantInformtion? patient; @override Widget build(BuildContext context) { @@ -26,20 +26,20 @@ class ProfileGeneralInfoWidget extends StatelessWidget { children: [ ProfileGeneralInfoContentWidget( title: "Age", - info: '${patient.age}', + info: '${patient!.age}', ), ProfileGeneralInfoContentWidget( title: "Contact Number", - info: '${patient.mobileNumber}', + info: '${patient!.mobileNumber}', ), ProfileGeneralInfoContentWidget( title: "Email", - info: '${patient.emailAddress}', + info: '${patient!.emailAddress}', ), ], ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.25, + width: SizeConfig.screenWidth! * 0.70, + height: SizeConfig.screenHeight! * 0.25, ); } } diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart index 275888e3..278ab007 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -3,17 +3,17 @@ import 'package:flutter/material.dart'; class AddNewOrder extends StatelessWidget { const AddNewOrder({ - Key key, + Key? key, this.onTap, this.label, }) : super(key: key); - final Function onTap; - final String label; + final Function? onTap; + final String? label; @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Container( width: double.maxFinite, height: 140, diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 80f54e12..06c5ad8b 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class LargeAvatar extends StatelessWidget { LargeAvatar( - {Key key, + {Key? key, this.name, this.url, this.disableProfileView: false, @@ -14,15 +14,15 @@ class LargeAvatar extends StatelessWidget { this.height = 90}) : super(key: key); - final String name; - final String url; + final String? name; + final String? url; final bool disableProfileView; final double radius; final double width; final double height; Widget _getAvatar() { - if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { + if (url != null && url!.isNotEmpty && Uri.parse(url!).isAbsolute) { return CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, @@ -31,14 +31,14 @@ class LargeAvatar extends StatelessWidget { borderRadius:BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), ), backgroundColor: Colors.transparent, ); - } else if (name == null || name.isEmpty) { + } else if (name == null || name!.isEmpty) { return Center( child: AppText( 'DR', @@ -47,7 +47,7 @@ class LargeAvatar extends StatelessWidget { } else { return Center( child: AppText( - name[0].toUpperCase(), + name![0].toUpperCase(), color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold, @@ -71,8 +71,8 @@ class LargeAvatar extends StatelessWidget { begin: Alignment(-1, -1), end: Alignment(1, 1), colors: [ - Colors.grey[100], - Colors.grey[800], + Colors.grey[100]!, + Colors.grey[800]!, ]), boxShadow: [ BoxShadow( diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 49ad8f4e..c2dc94e6 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -13,7 +13,7 @@ import 'package:provider/provider.dart'; class PatientPageHeaderWidget extends StatelessWidget { - final PatiantInformtion patient; + final PatiantInformtion? patient; PatientPageHeaderWidget(this.patient); @override @@ -23,7 +23,7 @@ class PatientPageHeaderWidget extends StatelessWidget { return BaseView( onModelReady: (model) async { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: patient.patientMRN??patient.patientId, + patientMRN: patient!.patientMRN??patient!.patientId, doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); @@ -47,7 +47,7 @@ class PatientPageHeaderWidget extends StatelessWidget { children: [ AvatarWidget( Icon( - patient.genderDescription == "Male" + patient!.genderDescription == "Male" ? DoctorApp.male : DoctorApp.female_icon, size: 70, @@ -66,7 +66,7 @@ class PatientPageHeaderWidget extends StatelessWidget { height: 5, ), AppText( - patient.patientDetails.fullName != null ? patient.patientDetails.fullName : patient.firstName, + patient!.patientDetails!.fullName != null ? patient!.patientDetails!.fullName : patient!.firstName, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -74,7 +74,7 @@ class PatientPageHeaderWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).age , + TranslationBase.of(context)!.age , color: Colors.black, fontWeight: FontWeight.bold, ), @@ -82,14 +82,14 @@ class PatientPageHeaderWidget extends StatelessWidget { width: 20, ), AppText( - patient.age.toString(), + patient!.age.toString(), color: Colors.black, fontWeight: FontWeight.normal, ), ], ), model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText( - TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), + TranslationBase.of(context)!.allergicTO! +" : "+model.getAllergicNames(projectViewModel.isArabic), color: Color(0xFFB9382C), fontWeight: FontWeight.bold, ) : AppText(''), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 07bfe8f7..bbc73103 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -13,23 +13,23 @@ import 'package:url_launcher/url_launcher.dart'; class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; final double height; - final bool isInpatient; - final bool isDischargedPatient; + final bool? isInpatient; + final bool? isDischargedPatient; PatientProfileHeaderNewDesignAppBar( this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false}); @override Widget build(BuildContext context) { - int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + int? gender = 1; + if (patient!.patientDetails != null) { + gender = patient!.patientDetails!.gender; } else { - gender = patient.gender; + gender = patient!.gender; } return Container( padding: EdgeInsets.only( @@ -40,7 +40,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 215:200 : height, + height: height == 0 ? isInpatient!? 215:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -56,11 +56,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), Expanded( child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + + patient!.firstName != null + ? (Helpers.capitalize(patient!.firstName)! + " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), + Helpers.capitalize(patient!.lastName)!) + : Helpers.capitalize(patient!.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -79,7 +79,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -110,39 +110,39 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == + SERVICES_PATIANT2[int.parse(patientType!)] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patient.patientStatusType == 43 + patient!.patientStatusType == 43 ? AppText( - TranslationBase.of(context).arrivedP, + TranslationBase.of(context)!.arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, ) : AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context)!.notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1'|| patient.arrivedOn == null + arrivalType == '1'|| patient!.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime + patient!.startTime != null + ? patient!.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( - patient.arrivedOn != null + patient!.arrivedOn != null ? AppDateUtils.convertStringToDateFormat( - patient.arrivedOn, + patient!.arrivedOn!, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', @@ -151,18 +151,18 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == + if (SERVICES_PATIANT2[int.parse(patientType!)] == "List_MyOutPatient") Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + + TranslationBase.of(context)!.appointmentDate! + " : ", fontSize: 14, ), - patient.startTime != null + patient!.startTime != null ? Container( height: 15, width: 60, @@ -171,7 +171,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget color: HexColor("#20A169"), ), child: AppText( - patient.startTime??"", + patient!.startTime??"", color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, @@ -185,7 +185,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Container( child: AppText( convertDateFormat2( - patient.appointmentDate ?? ''), + patient!.appointmentDate ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -209,11 +209,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).fileNumber, + text: TranslationBase.of(context)!.fileNumber, style: TextStyle( fontSize: 12, fontFamily: 'Poppins')), new TextSpan( - text: patient.patientId.toString(), + text: patient!.patientId.toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -224,20 +224,20 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Row( children: [ AppText( - patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', + patient!.nationalityName ?? patient!.nationality?? patient!.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), - patient.nationalityFlagURL != null + patient!.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient!.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -256,18 +256,18 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age+ " : ", + text: TranslationBase.of(context)!.age!+ " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context)}", + "${AppDateUtils.getAgeByBirthday(patient!.patientDetails != null ? patient!.patientDetails!.dateofBirth??"" : patient!.dateofBirth??"", context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], ), ), ), - if(isInpatient) + if(isInpatient!) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -282,35 +282,35 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), children: [ new TextSpan( - text: patient.admissionDate == null + text: patient!.admissionDate == null ? "" - : TranslationBase.of(context) - .admissionDate + + : TranslationBase.of(context)! + .admissionDate! + " : ", style: TextStyle(fontSize: 14)), new TextSpan( - text: patient.admissionDate == null + text: patient!.admissionDate == null ? "" - : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(patient!.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), ]))), - if (patient.admissionDate != null) + if (patient!.admissionDate != null) Row( children: [ AppText( - "${TranslationBase.of(context).numOfDays}: ", + "${TranslationBase.of(context)!.numOfDays}: ", fontSize: 15, ), - if(isDischargedPatient && patient.dischargeDate!=null) + if(isDischargedPatient! && patient!.dischargeDate!=null) AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${AppDateUtils.getDateTimeFromServerFormat(patient!.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient!.admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700) else AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient!.admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], @@ -328,7 +328,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate; + String? newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 1db29087..8f727cde 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -12,7 +12,7 @@ import 'package:intl/intl.dart'; import 'package:url_launcher/url_launcher.dart'; class PatientProfileHeaderNewDesign extends StatelessWidget { - final PatiantInformtion patient; + final PatiantInformtion? patient; final String patientType; final String arrivalType; final double height; @@ -24,11 +24,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { @override Widget build(BuildContext context) { - int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + int? gender = 1; + if (patient!.patientDetails != null) { + gender = patient!.patientDetails!.gender; } else { - gender = patient.gender; + gender = patient!.gender; } return Container( @@ -56,11 +56,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), Expanded( child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + + patient!.firstName != null + ? (Helpers.capitalize(patient!.firstName)! + " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), + Helpers.capitalize(patient!.lastName)!) + : Helpers.capitalize(patient!.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -79,7 +79,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -116,31 +116,31 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patient.patientStatusType == 43 + patient!.patientStatusType == 43 ? AppText( - TranslationBase.of(context).arrivedP, + TranslationBase.of(context)!.arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, ) : AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context)!.notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1' || patient.arrivedOn == null + arrivalType == '1' || patient!.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime + patient!.startTime != null + ? patient!.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( - AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.arrivedOn)), + AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient!.arrivedOn)), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) @@ -154,11 +154,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + + TranslationBase.of(context)!.appointmentDate! + " : ", fontSize: 14, ), - patient.startTime != null + patient!.startTime != null ? Container( height: 15, width: 60, @@ -167,7 +167,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { color: HexColor("#20A169"), ), child: AppText( - patient.startTime ?? "", + patient!.startTime ?? "", color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, @@ -181,7 +181,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { Container( child: AppText( convertDateFormat2( - patient.appointmentDate.toString() ?? ''), + patient!.appointmentDate.toString() ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -205,11 +205,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).fileNumber, + text: TranslationBase.of(context)!.fileNumber, style: TextStyle( fontSize: 12, fontFamily: 'Poppins')), new TextSpan( - text: patient.patientId.toString(), + text: patient!.patientId.toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -220,23 +220,23 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? + patient!.nationalityName ?? + patient!.nationality ?? + patient!.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), - patient.nationalityFlagURL != null + patient!.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient!.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -255,11 +255,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", + text: TranslationBase.of(context)!.age! + " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}", + "${AppDateUtils.getAgeByBirthday(patient!.patientDetails != null ? patient!.patientDetails!.dateofBirth ?? "" : patient!.dateofBirth ?? "", context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], @@ -277,7 +277,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { } convertDateFormat2(String str) { - String newDate; + String? newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart index c3a8638f..7881d08d 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart @@ -21,9 +21,9 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { @override Widget build(BuildContext context) { - int gender = 1; + int? gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender; } else { gender = patient.gender; } @@ -54,10 +54,10 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { Expanded( child: AppText( patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + + ? (Helpers.capitalize(patient.firstName)! + " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), + Helpers.capitalize(patient.lastName)!) + : Helpers.capitalize(patient.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -76,7 +76,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -113,7 +113,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).fileNumber, + TranslationBase.of(context)!.fileNumber, fontSize: 1.2 * SizeConfig.textMultiplier, ), AppText(patient.patientId.toString(), @@ -141,7 +141,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).admissionDate}: ", + "${TranslationBase.of(context)!.admissionDate}: ", fontSize: 1.2 * SizeConfig.textMultiplier, ), AppText( @@ -165,12 +165,12 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -183,7 +183,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { Row( children: [ AppText( - "${TranslationBase.of(context).numOfDays}: ", + "${TranslationBase.of(context)!.numOfDays}: ", fontSize: 1.2 * SizeConfig.textMultiplier, ), AppText( @@ -203,7 +203,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { } convertDateFormat2(String str) { - String newDate; + String? newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart index f3e01316..575c9775 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -17,17 +17,17 @@ import 'large_avatar.dart'; class PatientProfileHeaderWhitAppointment extends StatelessWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; final bool isPrescriptions; - final String clinic; + final String? clinic; PatientProfileHeaderWhitAppointment( {this.patient, this.patientType, @@ -41,11 +41,11 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { @override Widget build(BuildContext context) { - int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + int? gender = 1; + if (patient!.patientDetails != null) { + gender = patient!.patientDetails!.gender; } else { - gender = patient.gender; + gender = patient!.gender; } ProjectViewModel projectViewModel = Provider.of(context); @@ -72,11 +72,11 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { ), Expanded( child: AppText( - patient.firstName != null ? - (Helpers.capitalize(patient.firstName) + + patient!.firstName != null ? + (Helpers.capitalize(patient!.firstName)! + " " + Helpers.capitalize( - patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), + patient!.lastName)!) : Helpers.capitalize(patient!.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier *2.2, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -95,7 +95,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -128,7 +128,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { CrossAxisAlignment.start, children: [ SERVICES_PATIANT2[ - int.parse(patientType)] == + int.parse(patientType!)] == "patientArrivalList" ? Container( child: Row( @@ -136,11 +136,11 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { MainAxisAlignment .spaceBetween, children: [ - patient.patientStatusType == + patient!.patientStatusType == 43 ? AppText( TranslationBase.of( - context) + context)! .arrivedP, color: Colors.green, fontWeight: @@ -151,7 +151,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { ) : AppText( TranslationBase.of( - context) + context)! .notArrived, color: Colors.red[800], @@ -161,11 +161,11 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { 'Poppins', fontSize: 12, ), - arrivalType == '1' || patient.arrivedOn == null + arrivalType == '1' || patient!.arrivedOn == null ? AppText( - patient.startTime != + patient!.startTime != null - ? patient + ? patient! .startTime : '', fontFamily: @@ -175,8 +175,8 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { ) : AppText( AppDateUtils.convertStringToDateFormat( - patient - .arrivedOn, + patient! + .arrivedOn!, 'MM-dd-yyyy HH:mm'), fontFamily: 'Poppins', @@ -187,7 +187,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { )) : SizedBox(), if (SERVICES_PATIANT2[ - int.parse(patientType)] == + int.parse(patientType!)] == "List_MyOutPatient") Container( child: Row( @@ -195,12 +195,12 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .appointmentDate + + TranslationBase.of(context)! + .appointmentDate! + " : ", fontSize: 14, ), - patient.startTime != null + patient!.startTime != null ? Container( height: 15, width: 60, @@ -214,7 +214,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { "#20A169"), ), child: AppText( - patient.startTime, + patient!.startTime, color: Colors.white, fontSize: 1.5 * SizeConfig @@ -231,7 +231,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { ), Container( child: AppText( - convertDateFormat2(patient.appointmentDate.toString()?? ''), + convertDateFormat2(patient!.appointmentDate.toString()?? ''), fontSize: 1.5 * SizeConfig .textMultiplier, @@ -263,14 +263,14 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { new TextSpan( text: TranslationBase.of( - context) + context)! .fileNumber, style: TextStyle( fontSize: 12, fontFamily: 'Poppins')), new TextSpan( - text: patient.patientId + text: patient!.patientId .toString(), style: TextStyle( fontWeight: @@ -284,19 +284,19 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality??"", + patient!.nationalityName ?? + patient!.nationality??"", fontWeight: FontWeight.bold, fontSize: 12, ), - patient.nationality != null + patient!.nationality != null ? ClipRRect( borderRadius: BorderRadius .circular( 20.0), child: Image.network( - patient.nationalityFlagURL, + patient!.nationalityFlagURL!, height: 25, width: 30, errorBuilder: @@ -304,7 +304,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { context, Object exception, - StackTrace + StackTrace? stackTrace) { return Text( 'No Image'); @@ -327,14 +327,14 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { children: [ new TextSpan( text: TranslationBase.of( - context) - .age + + context)! + .age! + " : ", style: TextStyle( fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}", + "${AppDateUtils.getAgeByBirthday(patient!.patientDetails != null ? patient!.patientDetails!.dateofBirth ??"": patient!.dateofBirth??"", context)}", style: TextStyle( fontWeight: FontWeight.w700, @@ -357,8 +357,8 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( - bottom:BorderSide(color: Colors.grey[400],width: 2.5), - left: BorderSide(color: Colors.grey[400],width: 2.5), + bottom:BorderSide(color: Colors.grey[400]!,width: 2.5), + left: BorderSide(color: Colors.grey[400]!,width: 2.5), ) ), ), @@ -385,7 +385,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - '${TranslationBase.of(context).dr}.$doctorName', + '${TranslationBase.of(context)!.dr}.$doctorName', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 2e47b211..834c207b 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -17,21 +17,21 @@ import 'large_avatar.dart'; class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with PreferredSizeWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; final bool isPrescriptions; final bool isMedicalFile; - final String episode; - final String vistDate; + final String? episode; + final String? vistDate; - final String clinic; + final String? clinic; PatientProfileHeaderWhitAppointmentAppBar( {this.patient, this.patientType, @@ -51,11 +51,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + int? gender = 1; + if (patient!.patientDetails != null) { + gender = patient!.patientDetails!.gender; } else { - gender = patient.gender; + gender = patient!.gender; } return Container( @@ -80,11 +80,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), Expanded( child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + + patient!.firstName != null + ? (Helpers.capitalize(patient!.firstName)! + " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), + Helpers.capitalize(patient!.lastName)!) + : Helpers.capitalize(patient!.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -103,7 +103,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -134,38 +134,38 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == + SERVICES_PATIANT2[int.parse(patientType!)] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patient.patientStatusType == 43 + patient!.patientStatusType == 43 ? AppText( - TranslationBase.of(context).arrivedP, + TranslationBase.of(context)!.arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, ) : AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context)!.notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1' || patient.arrivedOn == null + arrivalType == '1' || patient!.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime + patient!.startTime != null + ? patient!.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( AppDateUtils.convertStringToDateFormat( - patient.arrivedOn, + patient!.arrivedOn!, 'MM-dd-yyyy HH:mm'), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -173,18 +173,18 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == + if (SERVICES_PATIANT2[int.parse(patientType!)] == "List_MyOutPatient") Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + + TranslationBase.of(context)!.appointmentDate! + " : ", fontSize: 14, ), - patient.startTime != null + patient!.startTime != null ? Container( height: 15, width: 60, @@ -193,7 +193,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget color: HexColor("#20A169"), ), child: AppText( - patient.startTime ?? "", + patient!.startTime ?? "", color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, @@ -207,7 +207,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget Container( child: AppText( convertDateFormat2( - patient.appointmentDate.toString() ?? ''), + patient!.appointmentDate.toString() ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -231,11 +231,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).fileNumber, + text: TranslationBase.of(context)!.fileNumber, style: TextStyle( fontSize: 12, fontFamily: 'Poppins')), new TextSpan( - text: patient.patientId.toString(), + text: patient!.patientId.toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -246,22 +246,22 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality ?? + patient!.nationalityName ?? + patient!.nationality ?? "", fontWeight: FontWeight.bold, fontSize: 12, ), - patient.nationality != null + patient!.nationality != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient!.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -280,11 +280,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", + text: TranslationBase.of(context)!.age! + " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(patient!.patientDetails != null ? patient!.patientDetails!.dateofBirth : patient!.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], @@ -308,8 +308,8 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( - bottom: BorderSide(color: Colors.grey[400], width: 2.5), - left: BorderSide(color: Colors.grey[400], width: 2.5), + bottom: BorderSide(color: Colors.grey[400]!, width: 2.5), + left: BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -335,7 +335,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - '${TranslationBase.of(context).dr}$doctorName', + '${TranslationBase.of(context)!.dr}$doctorName', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 9, diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 9d22962a..6b8346fd 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -11,15 +11,15 @@ import 'package:hexcolor/hexcolor.dart'; import 'large_avatar.dart'; class PrescriptionInPatientWidget extends StatelessWidget { - final List prescriptionReportForInPatientList; + final List? prescriptionReportForInPatientList; PrescriptionInPatientWidget( - {Key key, this.prescriptionReportForInPatientList}); + {Key? key, this.prescriptionReportForInPatientList}); @override Widget build(BuildContext context) { return Container( - child: prescriptionReportForInPatientList.length == 0 + child: prescriptionReportForInPatientList!.length == 0 ? Center( child: SingleChildScrollView( child: Column( @@ -42,13 +42,13 @@ class PrescriptionInPatientWidget extends StatelessWidget { ), Padding( child: AppText( - TranslationBase.of(context).noPrescription, + TranslationBase.of(context)!.noPrescription, fontWeight: FontWeight.bold, ), padding: EdgeInsets.all(10), ), AppText( - TranslationBase.of(context).applyNow, + TranslationBase.of(context)!.applyNow, fontWeight: FontWeight.bold, color: HexColor('#B8382C'), ) @@ -56,10 +56,10 @@ class PrescriptionInPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, - SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth! * 0.05, 0, + SizeConfig.realScreenWidth! * 0.05, 0), child: ListView.builder( - itemCount: prescriptionReportForInPatientList.length, + itemCount: prescriptionReportForInPatientList!.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { @@ -67,7 +67,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { IN_PATIENT_PRESCRIPTIONS_DETAILS, arguments: { 'prescription': - prescriptionReportForInPatientList[index] + prescriptionReportForInPatientList![index] }); }, child: CardWithBgWidgetNew( @@ -78,7 +78,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { children: [ LargeAvatar( name: - prescriptionReportForInPatientList[index] + prescriptionReportForInPatientList![index] .createdByName, radius: 10, width: 70, @@ -92,7 +92,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - '${prescriptionReportForInPatientList[index].createdByName}', + '${prescriptionReportForInPatientList![index].createdByName}', fontSize: 2.5 * SizeConfig.textMultiplier, ), @@ -100,7 +100,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { height: 8, ), AppText( - '${prescriptionReportForInPatientList[index].itemDescription}', + '${prescriptionReportForInPatientList![index].itemDescription}', fontSize: 2.5 * SizeConfig.textMultiplier, color: diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index bd40c3ca..6bf3fdf0 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -12,14 +12,14 @@ import 'package:hexcolor/hexcolor.dart'; import 'large_avatar.dart'; class PrescriptionOutPatientWidget extends StatelessWidget { - final List patientPrescriptionsList; + final List? patientPrescriptionsList; - PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList}); + PrescriptionOutPatientWidget({Key? key, this.patientPrescriptionsList}); @override Widget build(BuildContext context) { return Container( - child: patientPrescriptionsList.length == 0 + child: patientPrescriptionsList!.length == 0 ? Center( child: SingleChildScrollView( child: Column( @@ -42,13 +42,13 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), Padding( child: AppText( - TranslationBase.of(context).noPrescription, + TranslationBase.of(context)!.noPrescription, fontWeight: FontWeight.bold, ), padding: EdgeInsets.all(10), ), AppText( - TranslationBase.of(context).applyNow, + TranslationBase.of(context)!.applyNow, fontWeight: FontWeight.bold, color: HexColor('#B8382C'), ) @@ -56,10 +56,10 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, - SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth! * 0.05, 0, + SizeConfig.realScreenWidth! * 0.05, 0), child: ListView.builder( - itemCount: patientPrescriptionsList.length, + itemCount: patientPrescriptionsList!.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { @@ -69,7 +69,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { builder: (context) => OutPatientPrescriptionDetailsScreen( prescriptionResModel: - patientPrescriptionsList[index], + patientPrescriptionsList![index], ), ), ); @@ -81,9 +81,9 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - url: patientPrescriptionsList[index] + url: patientPrescriptionsList![index] .doctorImageURL, - name: patientPrescriptionsList[index] + name: patientPrescriptionsList![index] .doctorName, radius: 10, width: 70, @@ -97,7 +97,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - '${patientPrescriptionsList[index].name}', + '${patientPrescriptionsList![index].name}', fontSize: 2.5 * SizeConfig.textMultiplier, ), @@ -105,7 +105,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { height: 8, ), AppText( - '${patientPrescriptionsList[index].clinicDescription}', + '${patientPrescriptionsList![index].clinicDescription}', fontSize: 2.5 * SizeConfig.textMultiplier, color: diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 53228bc2..cf0c51b8 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -33,7 +33,7 @@ class ProfileWelcomeWidget extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.circular(20), child: Image.network( - authenticationViewModel.doctorProfile.doctorImageURL, + authenticationViewModel.doctorProfile!.doctorImageURL!, fit: BoxFit.fill, width: 75, height: 75, diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart index f5c70ae6..197161a3 100644 --- a/lib/widgets/patients/profile/profile_general_info_content_widget.dart +++ b/lib/widgets/patients/profile/profile_general_info_content_widget.dart @@ -12,8 +12,8 @@ import '../../shared/app_texts_widget.dart'; *@desc: Profile General Info Content Widget */ class ProfileGeneralInfoContentWidget extends StatelessWidget { - String title; - String info; + String? title; + String? info; ProfileGeneralInfoContentWidget({this.title, this.info}); diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart index df958106..087d8c05 100644 --- a/lib/widgets/patients/profile/profile_header_widget.dart +++ b/lib/widgets/patients/profile/profile_header_widget.dart @@ -14,11 +14,11 @@ import '../../shared/profile_image_widget.dart'; */ class ProfileHeaderWidget extends StatelessWidget { ProfileHeaderWidget({ - Key key, + Key? key, this.patient }) : super(key: key); - PatiantInformtion patient; + PatiantInformtion? patient; @override Widget build(BuildContext context) { @@ -29,8 +29,8 @@ class ProfileHeaderWidget extends StatelessWidget { child: ProfileImageWidget( url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", - name: patient.firstName + ' ' + patient.lastName, - des: patient.patientId.toString(), + name: patient!.firstName! + ' ' + patient!.lastName!, + des: patient!.patientId.toString(), height: SizeConfig.heightMultiplier * 17, width: SizeConfig.heightMultiplier * 17, color: HexColor('#58434F')), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index c5417d85..d4d28edb 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -8,15 +8,15 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProfileMedicalInfoWidget extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; + final String? from; + final String? to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final bool? isInpatient; ProfileMedicalInfoWidget( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, @@ -42,8 +42,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + nameLine1: TranslationBase.of(context)!.vital, + nameLine2: TranslationBase.of(context)!.signs, route: VITAL_SIGN_DETAILS, icon: 'patient/vital_signs.png'), // if (selectedPatientType != 7) @@ -62,8 +62,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context)!.lab, + nameLine2: TranslationBase.of(context)!.result, icon: 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( @@ -73,8 +73,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { arrivalType: arrivalType, isInPatient:isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context)!.radiology, + nameLine2: TranslationBase.of(context)!.service, icon: 'patient/health_summary.png'), PatientProfileButton( key: key, @@ -82,7 +82,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context)!.patient, nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( @@ -91,8 +91,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context)!.orders, + nameLine2: TranslationBase.of(context)!.prescription, icon: 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( @@ -101,8 +101,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context)!.orders, + nameLine2: TranslationBase.of(context)!.procedures, icon: 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( @@ -111,8 +111,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context)!.insurance, + nameLine2: TranslationBase.of(context)!.service, icon: 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( @@ -121,53 +121,53 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context)!.patientSick, + nameLine2: TranslationBase.of(context)!.leave, icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) + if (patient!.appointmentNo!=null && patient!.appointmentNo!=0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_UCAF_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, + isDisable: patient!.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context)!.patient, + nameLine2: TranslationBase.of(context)!.ucaf, icon: 'patient/ucaf.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) + if (patient!.appointmentNo!=null && patient!.appointmentNo!=0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + isDisable: patient!.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context)!.referral, + nameLine2: TranslationBase.of(context)!.patient, icon: 'patient/refer_patient.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) + if (patient!.appointmentNo!=null && patient!.appointmentNo!=0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_ADMISSION_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, + isDisable: patient!.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context)!.admission, + nameLine2: TranslationBase.of(context)!.request, icon: 'patient/admission_req.png'), - if (isInpatient) + if (isInpatient!) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + nameLine1: TranslationBase.of(context)!.progress, + nameLine2: TranslationBase.of(context)!.note, icon: 'patient/Progress_notes.png'), - if (isInpatient) + if (isInpatient!) PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index 17feaf0a..27746055 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -8,16 +8,16 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; + final String? from; + final String? to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final bool? isInpatient; final bool isDischargedPatient; ProfileMedicalInfoWidgetInPatient( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, @@ -45,8 +45,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + nameLine1: TranslationBase.of(context)!.vital, + nameLine2: TranslationBase.of(context)!.signs, route: VITAL_SIGN_DETAILS, isInPatient: true, icon: 'patient/vital_signs.png'), @@ -57,8 +57,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { arrivalType: arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context)!.lab, + nameLine2: TranslationBase.of(context)!.result, icon: 'patient/lab_results.png'), PatientProfileButton( key: key, @@ -67,8 +67,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context)!.radiology, + nameLine2: TranslationBase.of(context)!.result, icon: 'patient/health_summary.png'), PatientProfileButton( key: key, @@ -76,8 +76,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context)!.patient, + nameLine2: TranslationBase.of(context)!.prescription, icon: 'patient/order_prescription.png'), PatientProfileButton( key: key, @@ -86,8 +86,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { arrivalType: arrivalType, route: PROGRESS_NOTE, isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + nameLine1: TranslationBase.of(context)!.progress, + nameLine2: TranslationBase.of(context)!.note, icon: 'patient/Progress_notes.png'), PatientProfileButton( key: key, @@ -105,8 +105,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context)!.orders, + nameLine2: TranslationBase.of(context)!.procedures, icon: 'patient/Order_Procedures.png'), PatientProfileButton( key: key, @@ -138,8 +138,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { arrivalType: arrivalType, route: REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context)!.referral, + nameLine2: TranslationBase.of(context)!.patient, icon: 'patient/refer_patient.png'), PatientProfileButton( key: key, @@ -147,8 +147,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, + nameLine1: TranslationBase.of(context)!.insurance, + nameLine2: TranslationBase.of(context)!.approvals, icon: 'patient/vital_signs.png'), PatientProfileButton( key: key, @@ -166,8 +166,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context)!.patientSick, + nameLine2: TranslationBase.of(context)!.leave, icon: 'patient/patient_sick_leave.png'), ], ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index ac33eb82..da24141d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -9,16 +9,16 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProfileMedicalInfoWidgetSearch extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; - final bool isDischargedPatient; + final String? from; + final String? to; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final bool? isInpatient; + final bool? isDischargedPatient; ProfileMedicalInfoWidgetSearch( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, @@ -26,13 +26,13 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { this.to, this.isInpatient, this.isDischargedPatient}); - TabController _tabController; + TabController? _tabController; void initState() { _tabController = TabController(length: 2); } void dispose() { - _tabController.dispose(); + _tabController!.dispose(); } @override @@ -41,7 +41,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { onModelReady: (model) async {}, builder: (_, model, w) => DefaultTabController( length: 2, - initialIndex: isInpatient ? 0 : 1, + initialIndex: isInpatient! ? 0 : 1, child: SizedBox( height: MediaQuery.of(context).size.height * 1.0, width: double.infinity, @@ -104,8 +104,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + nameLine1: TranslationBase.of(context)!.vital, + nameLine2: TranslationBase.of(context)!.signs, route: VITAL_SIGN_DETAILS, isInPatient: true, icon: 'patient/vital_signs.png'), @@ -116,8 +116,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context)!.lab, + nameLine2: TranslationBase.of(context)!.result, icon: 'patient/lab_results.png'), PatientProfileButton( key: key, @@ -126,8 +126,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context)!.radiology, + nameLine2: TranslationBase.of(context)!.result, icon: 'patient/health_summary.png'), PatientProfileButton( key: key, @@ -135,8 +135,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context)!.patient, + nameLine2: TranslationBase.of(context)!.prescription, icon: 'patient/order_prescription.png'), PatientProfileButton( key: key, @@ -145,8 +145,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, route: PROGRESS_NOTE, isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + nameLine1: TranslationBase.of(context)!.progress, + nameLine2: TranslationBase.of(context)!.note, icon: 'patient/Progress_notes.png'), PatientProfileButton( key: key, @@ -165,8 +165,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context)!.orders, + nameLine2: TranslationBase.of(context)!.procedures, icon: 'patient/Order_Procedures.png'), PatientProfileButton( key: key, @@ -198,8 +198,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, route: REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context)!.referral, + nameLine2: TranslationBase.of(context)!.patient, icon: 'patient/refer_patient.png'), PatientProfileButton( key: key, @@ -207,8 +207,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, + nameLine1: TranslationBase.of(context)!.insurance, + nameLine2: TranslationBase.of(context)!.approvals, icon: 'patient/vital_signs.png'), PatientProfileButton( key: key, @@ -226,8 +226,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context)!.patientSick, + nameLine2: TranslationBase.of(context)!.leave, icon: 'patient/patient_sick_leave.png'), ], ), @@ -246,8 +246,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + nameLine1: TranslationBase.of(context)!.vital, + nameLine2: TranslationBase.of(context)!.signs, route: VITAL_SIGN_DETAILS, icon: 'patient/vital_signs.png'), // if (selectedPatientType != 7) @@ -268,8 +268,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context)!.lab, + nameLine2: TranslationBase.of(context)!.result, icon: 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( @@ -279,8 +279,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context)!.radiology, + nameLine2: TranslationBase.of(context)!.service, icon: 'patient/health_summary.png'), PatientProfileButton( key: key, @@ -288,7 +288,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context)!.patient, nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( @@ -297,8 +297,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context)!.orders, + nameLine2: TranslationBase.of(context)!.prescription, icon: 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( @@ -307,8 +307,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context)!.orders, + nameLine2: TranslationBase.of(context)!.procedures, icon: 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( @@ -317,8 +317,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context)!.insurance, + nameLine2: TranslationBase.of(context)!.service, icon: 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( @@ -327,11 +327,11 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context)!.patientSick, + nameLine2: TranslationBase.of(context)!.leave, icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (patient!.appointmentNo != null && + patient!.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, @@ -339,12 +339,12 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, route: PATIENT_UCAF_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, + patient!.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context)!.patient, + nameLine2: TranslationBase.of(context)!.ucaf, icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (patient!.appointmentNo != null && + patient!.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, @@ -352,12 +352,12 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + patient!.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context)!.referral, + nameLine2: TranslationBase.of(context)!.patient, icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (patient!.appointmentNo != null && + patient!.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, @@ -365,21 +365,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { arrivalType: arrivalType, route: PATIENT_ADMISSION_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, + patient!.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context)!.admission, + nameLine2: TranslationBase.of(context)!.request, icon: 'patient/admission_req.png'), - if (isInpatient) + if (isInpatient!) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + nameLine1: TranslationBase.of(context)!.progress, + nameLine2: TranslationBase.of(context)!.note, icon: 'patient/Progress_notes.png'), - if (isInpatient) + if (isInpatient!) PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/profile_status_info_widget.dart b/lib/widgets/patients/profile/profile_status_info_widget.dart index d616c36f..d084a60e 100644 --- a/lib/widgets/patients/profile/profile_status_info_widget.dart +++ b/lib/widgets/patients/profile/profile_status_info_widget.dart @@ -15,7 +15,7 @@ import '../../shared/rounded_container_widget.dart'; */ class ProfileStatusInfoWidget extends StatelessWidget { const ProfileStatusInfoWidget({ - Key key, + Key? key, }) : super(key: key); @override @@ -44,8 +44,8 @@ class ProfileStatusInfoWidget extends StatelessWidget { ), ], ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.12, + width: SizeConfig.screenWidth! * 0.70, + height: SizeConfig.screenHeight! * 0.12, ); } } diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index b8314b03..fe8eb371 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -6,13 +6,13 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class VitalSignDetailsWidget extends StatefulWidget { - final List vitalList; - final String title1; - final String title2; - final String viewKey; + final List? vitalList; + final String? title1; + final String? title2; + final String? viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, this.vitalList, this.title1, this.title2, this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -38,7 +38,7 @@ class _VitalSignDetailsWidgetState extends State { 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(), ), @@ -82,7 +82,7 @@ class _VitalSignDetailsWidgetState extends State { height: 60), ) ])); - widget.vitalList.forEach((vital) { + widget.vitalList!.forEach((vital) { tableRow.add(TableRow(children: [ Container( child: Container( @@ -90,7 +90,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${AppDateUtils.getWeekDay(vital.vitalSignDate!.weekday)}, ${vital.vitalSignDate!.day} ${AppDateUtils.getMonth(vital.vitalSignDate!.month)}, ${vital.vitalSignDate!.year} ', textAlign: TextAlign.center, ), ), @@ -102,7 +102,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${vital.toJson()[widget.viewKey]}', + '${vital.toJson()[widget.viewKey!]}', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart index f391e7bf..62a32e18 100644 --- a/lib/widgets/shared/StarRating.dart +++ b/lib/widgets/shared/StarRating.dart @@ -9,7 +9,7 @@ class StarRating extends StatelessWidget { final bool forceStars; StarRating( - {Key key, + {Key? key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount = 5, diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 18d8e778..4f6ca8b4 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -40,7 +40,7 @@ final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { TextFields( - {Key key, + {Key? key, this.type, this.hintText, this.suffixIcon, @@ -80,26 +80,26 @@ class TextFields extends StatefulWidget { this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, }) : super(key: key); - final String hintText; - final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final Function onTapTextFields; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; + final String? hintText; + final String? initialValue; + final String? type; + final bool? autoFocus; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final Function? onTapTextFields; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final Function? onSaved; + final Function? onSuffixTap; + final Function? onChanged; + final Function? onSubmit; final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; + final int? maxLength; + final int? minLines; + final int? maxLines; final bool maxLengthEnforced; final bool bare; final TextInputAction inputAction; @@ -107,16 +107,16 @@ class TextFields extends StatefulWidget { final FontWeight fontWeight; final bool keepPadding; final TextCapitalization textCapitalization; - final List inputFormatters; + final List? inputFormatters; final bool autoValidate; - final EdgeInsets padding; + final EdgeInsets? padding; final bool focus; final bool borderOnlyError; - final Color hintColor; - final Color fillColor; + final Color? hintColor; + final Color? fillColor; final bool hasBorder; final bool showLabelText; - Color borderColor; + Color? borderColor; final double borderRadius; final double borderWidth; bool hasLabelText; @@ -152,7 +152,7 @@ class _TextFieldsState extends State { super.dispose(); } - Widget _buildSuffixIcon() { + Widget? _buildSuffixIcon() { switch (widget.type) { case "password": { @@ -181,7 +181,7 @@ class _TextFieldsState extends State { default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap, + onTap: widget.onSuffixTap as void Function()?, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null @@ -222,18 +222,18 @@ class _TextFieldsState extends State { child: Column( children: [ TextFormField( - onTap: widget.onTapTextFields, + onTap: widget.onTapTextFields as void Function()?, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), autovalidate: widget.autoValidate, textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null - ? widget.onSubmit + ? widget.onSubmit as void Function(String)? : (val) { _focusNode.nextFocus(); }) - : widget.onSubmit, + : widget.onSubmit as void Function(String)?, textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, @@ -251,7 +251,7 @@ class _TextFieldsState extends State { }); } } - if (widget.onChanged != null) widget.onChanged(value); + if (widget.onChanged != null) widget.onChanged!(value); }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, @@ -261,8 +261,8 @@ class _TextFieldsState extends State { obscureText: widget.type == "password" && !view ? true : false, autofocus: widget.autoFocus ?? false, validator: widget.validator, - onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1.copyWith( + onSaved: widget.onSaved as void Function(String?)?, + style: Theme.of(context).textTheme.bodyText1!.copyWith( fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ @@ -324,7 +324,7 @@ class _TextFieldsState extends State { borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + ? BorderSide(color: widget.borderColor!,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) @@ -332,14 +332,14 @@ class _TextFieldsState extends State { ), disabledBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + ? BorderSide(color: widget.borderColor!,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + ? BorderSide(color: widget.borderColor!,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index e350e39d..7b175031 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -24,7 +24,7 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { Helpers helpers = new Helpers(); - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -84,8 +84,8 @@ class _AppDrawerState extends State { Padding( padding: EdgeInsets.only(top: 10), child: AppText( - TranslationBase.of(context).dr + - authenticationViewModel.doctorProfile?.doctorName, + TranslationBase.of(context)!.dr! + + authenticationViewModel.doctorProfile?.doctorName!, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -107,7 +107,7 @@ class _AppDrawerState extends State { SizedBox(height: 40), InkWell( child: DrawerItem( - TranslationBase.of(context).applyOrRescheduleLeave, + TranslationBase.of(context)!.applyOrRescheduleLeave, icon: DoctorApp.reschedule__1, // subTitle: , ), @@ -124,7 +124,7 @@ class _AppDrawerState extends State { SizedBox(height: 15), InkWell( child: DrawerItem( - TranslationBase.of(context).myQRCode, + TranslationBase.of(context)!.myQRCode, icon: DoctorApp.qr_code_3, // subTitle: , ), @@ -150,8 +150,8 @@ class _AppDrawerState extends State { InkWell( child: DrawerItem( projectsProvider.isArabic - ? TranslationBase.of(context).lanEnglish - : TranslationBase.of(context).lanArabic, + ? TranslationBase.of(context)!.lanEnglish + : TranslationBase.of(context)!.lanArabic, // icon: DoctorApp.qr_code, assetLink: projectsProvider.isArabic ? 'assets/images/usa-flag.png' @@ -167,7 +167,7 @@ class _AppDrawerState extends State { SizedBox(height: 10), InkWell( child: DrawerItem( - TranslationBase.of(context).logout, + TranslationBase.of(context)!.logout, icon: DoctorApp.logout_1, ), onTap: () async { @@ -224,7 +224,7 @@ class _AppDrawerState extends State { ])) ])), ), - width: SizeConfig.realScreenWidth * 0.60, + width: SizeConfig.realScreenWidth! * 0.60, margin: EdgeInsets.all(0), customCornerRaduis: false, diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart index 76a7f57e..2a51b5b3 100644 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -3,8 +3,8 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; class AppExpandableNotifier extends StatelessWidget { - final Widget headerWid; - final Widget bodyWid; + final Widget? headerWid; + final Widget? bodyWid; AppExpandableNotifier({this.headerWid, this.bodyWid}); @@ -31,11 +31,11 @@ class AppExpandableNotifier extends StatelessWidget { header: Padding( padding: EdgeInsets.all(10), child: Text( - "${TranslationBase.of(context).graphDetails}", + "${TranslationBase.of(context)!.graphDetails}", style: TextStyle(fontWeight: FontWeight.bold), )), collapsed: Text(''), - expanded: bodyWid, + expanded: bodyWid!, builder: (_, collapsed, expanded) { return Padding( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart index 848f5265..34a78079 100644 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ b/lib/widgets/shared/app_expandable_notifier_new.dart @@ -10,10 +10,10 @@ import 'package:flutter/material.dart'; /// [title] the widget title /// [collapsed] The widget shown in the collapsed state class AppExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final String title; - final Widget collapsed; + final Widget? headerWidget; + final Widget? bodyWidget; + final String? title; + final Widget? collapsed; final bool isExpand; bool expandFlag = false; var controller = new ExpandableController(); @@ -70,7 +70,7 @@ class _AppExpandableNotifier extends State { child: Padding( padding: EdgeInsets.all(10), child: Text( - widget.title ?? TranslationBase.of(context).details, + widget.title ?? TranslationBase.of(context)!.details!, style: TextStyle( fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2, @@ -104,7 +104,7 @@ class _AppExpandableNotifier extends State { }), ]), collapsed: widget.collapsed ?? Container(), - expanded: widget.bodyWidget, + expanded: widget.bodyWidget!, builder: (_, collapsed, expanded) { return Padding( padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index ef614209..9b0c037f 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -4,10 +4,10 @@ import 'package:progress_hud_v2/progress_hud.dart'; import 'loader/gif_loader_container.dart'; class AppLoaderWidget extends StatefulWidget { - AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); + AppLoaderWidget({Key? key, this.title, this.containerColor}) : super(key: key); - final String title; - final Color containerColor; + final String? title; + final Color? containerColor; @override _AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e957b5d4..e9e9b137 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -11,15 +11,15 @@ import 'app_texts_widget.dart'; import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { - final String appBarTitle; - final Widget body; + final String? appBarTitle; + final Widget? body; final bool isLoading; final bool isShowAppBar; - final BaseViewModel baseViewModel; - final Widget bottomSheet; - final Color backgroundColor; - final Widget appBar; - final String subtitle; + final BaseViewModel? baseViewModel; + final Widget? bottomSheet; + final Color? backgroundColor; + final Widget? appBar; + final String? subtitle; final bool isHomeIcon; AppScaffold( {this.appBarTitle = '', @@ -43,7 +43,7 @@ class AppScaffold extends StatelessWidget { child: Scaffold( backgroundColor: backgroundColor ?? Colors.white, appBar: isShowAppBar - ? appBar ?? + ? appBar as PreferredSizeWidget? ?? AppBar( elevation: 0, backgroundColor: Colors.white, //HexColor('#515B5D'), @@ -55,9 +55,9 @@ class AppScaffold extends StatelessWidget { title: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(appBarTitle.toUpperCase()), + Text(appBarTitle!.toUpperCase()), if(subtitle!=null) - Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), + Text(subtitle!,style: TextStyle(fontSize: 12,color: Colors.red),), ], ), leading: Builder(builder: (BuildContext context) { @@ -88,7 +88,7 @@ class AppScaffold extends StatelessWidget { child: body, ) : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) + children:[body??Container(), buildAppLoaderWidget(isLoading)]) : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 48661a32..064be8c6 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -4,31 +4,31 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { - final String text; - final String variant; - final Color color; - final FontWeight fontWeight; - final double fontSize; - final double fontHeight; + final String? text; + final String? variant; + final Color? color; + final FontWeight? fontWeight; + final double? fontSize; + final double? fontHeight; final String fontFamily; final int maxLength; final bool italic; - final double margin; + final double? margin; final double marginTop; final double marginRight; final double marginBottom; final double marginLeft; - final TextAlign textAlign; - final bool bold; - final bool regular; - final bool medium; - final int maxLines; + final TextAlign? textAlign; + final bool? bold; + final bool? regular; + final bool? medium; + final int? maxLines; final bool readMore; - final String style; + final String? style; final bool allowExpand; final bool visibility; - final TextOverflow textOverflow; - final TextDecoration textDecoration; + final TextOverflow? textOverflow; + final TextDecoration? textDecoration; AppText( this.text, { @@ -64,13 +64,13 @@ class AppText extends StatefulWidget { class _AppTextState extends State { bool hidden = false; - String text = ""; + String? text = ""; @override void didUpdateWidget(covariant AppText oldWidget) { setState(() { if (widget.style == "overline") - text = widget.text.toUpperCase(); + text = widget.text!.toUpperCase(); else { text = widget.text; } @@ -82,7 +82,7 @@ class _AppTextState extends State { void initState() { hidden = widget.readMore; if (widget.style == "overline") - text = widget.text.toUpperCase(); + text = widget.text!.toUpperCase(); else { text = widget.text; } @@ -93,7 +93,7 @@ class _AppTextState extends State { Widget build(BuildContext context) { return Container( margin: widget.margin != null - ? EdgeInsets.all(widget.margin) + ? EdgeInsets.all(widget.margin!) : EdgeInsets.only( top: widget.marginTop, right: widget.marginRight, @@ -107,21 +107,21 @@ class _AppTextState extends State { children: [ Text( !hidden - ? text - : (text.substring( + ? text! + : (text!.substring( 0, - text.length > widget.maxLength + text!.length > widget.maxLength ? widget.maxLength - : text.length)), + : text!.length)), textAlign: widget.textAlign, overflow: widget.maxLines != null - ? ((widget.maxLines > 1) + ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle().copyWith( + ? _getFontStyle()!.copyWith( fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), @@ -138,7 +138,7 @@ class _AppTextState extends State { decoration: widget.textDecoration, height: widget.fontHeight), ), - if (widget.readMore && text.length > widget.maxLength && hidden) + if (widget.readMore && text!.length > widget.maxLength && hidden) Positioned( bottom: 0, left: 0, @@ -159,7 +159,7 @@ class _AppTextState extends State { ), if (widget.allowExpand && widget.readMore && - text.length > widget.maxLength) + text!.length > widget.maxLength) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -169,7 +169,7 @@ class _AppTextState extends State { }); }, child: Text(hidden ? "Read More" : "Read less", - style: _getFontStyle().copyWith( + style: _getFontStyle()!.copyWith( color: HexColor('#FF0000'), fontWeight: FontWeight.w800, fontFamily: "Poppins", @@ -181,7 +181,7 @@ class _AppTextState extends State { ); } - TextStyle _getFontStyle() { + TextStyle? _getFontStyle() { switch (widget.style) { case "headline2": return Theme.of(context).textTheme.headline2; @@ -196,7 +196,7 @@ class _AppTextState extends State { case "bodyText2": return Theme.of(context).textTheme.bodyText2; case "bodyText_15": - return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); + return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0); case "bodyText1": return Theme.of(context).textTheme.bodyText1; case "caption": @@ -247,7 +247,7 @@ class _AppTextState extends State { } } - FontWeight _getFontWeight() { + FontWeight? _getFontWeight() { if (widget.bold ?? false) { return FontWeight.w900; } else if (widget.regular ?? false) { diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index dd64958a..53e2efa2 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -6,9 +6,9 @@ import 'package:flutter/material.dart'; import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { - final ValueChanged changeIndex; - final int index; - BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); + final ValueChanged? changeIndex; + final int? index; + BottomNavBar({Key? key, this.changeIndex, this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); @@ -18,7 +18,7 @@ class _BottomNavBarState extends State { int _index = 0; _changeIndex(int index) { - widget.changeIndex(index); + widget.changeIndex!(index); setState(() { _index = index; }); @@ -42,7 +42,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: widget.index, currentIndex: 0, - name: TranslationBase.of(context).home, + name: TranslationBase.of(context)!.home, ), BottomNavigationItem( icon: DoctorApp.schedule_1, @@ -50,7 +50,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: widget.index, currentIndex: 1, - name: TranslationBase.of(context).mySchedule, + name: TranslationBase.of(context)!.mySchedule, ), BottomNavigationItem( icon: DoctorApp.qr_reader, @@ -58,7 +58,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: widget.index, currentIndex: 2, - name: TranslationBase.of(context).qr, + name: TranslationBase.of(context)!.qr, ), BottomNavigationItem( icon: DoctorApp.dr_reply_1, @@ -66,7 +66,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: widget.index, currentIndex: 3, - name: TranslationBase.of(context).replay2, + name: TranslationBase.of(context)!.replay2, ), ], ), diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index e69ff690..69c3a16c 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -2,12 +2,12 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class BottomNavigationItem extends StatelessWidget { - final IconData icon; - final IconData activeIcon; - final ValueChanged changeIndex; - final int index; - final int currentIndex; - final String name; + final IconData? icon; + final IconData? activeIcon; + final ValueChanged? changeIndex; + final int? index; + final int? currentIndex; + final String? name; BottomNavigationItem( {this.icon, @@ -27,7 +27,7 @@ class BottomNavigationItem extends StatelessWidget { child: InkWell( highlightColor: Colors.transparent, splashColor: Colors.transparent, - onTap: () => changeIndex(currentIndex), + onTap: () => changeIndex!(currentIndex), child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, @@ -43,7 +43,7 @@ class BottomNavigationItem extends StatelessWidget { SizedBox(height: 5,), Expanded( child: Text( - name, + name!, style: TextStyle( color: currentIndex == index ? Theme.of(context).primaryColor diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index ed3e6e98..d08b6be5 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -7,10 +7,10 @@ import '../app_texts_widget.dart'; class AppButton extends StatefulWidget { final GestureTapCallback onPressed; - final String title; - final IconData iconData; - final Widget icon; - final Color color; + final String? title; + final IconData? iconData; + final Widget? icon; + final Color? color; final double fontSize; final double padding; final Color fontColor; @@ -18,13 +18,13 @@ class AppButton extends StatefulWidget { final bool disabled; final FontWeight fontWeight; final bool hasBorder; - final Color borderColor; + final Color? borderColor; final double radius; final double vPadding; final double hPadding; AppButton({ - @required this.onPressed, + required this.onPressed, this.title, this.iconData, this.icon, @@ -89,7 +89,7 @@ class _AppButtonState extends State { width: 19.0, child: CircularProgressIndicator( backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( + valueColor: AlwaysStoppedAnimation( Colors.grey[300], ), ), @@ -110,7 +110,7 @@ class _AppButtonState extends State { shape: RoundedRectangleBorder( side: BorderSide( color: - widget.hasBorder ? widget.borderColor : widget.disabled + widget.hasBorder ? widget.borderColor! : widget.disabled ? Colors.grey : widget.color ?? Color(0xFFB8382C), width: 0.8, ), diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 9db662d2..b3a14687 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -5,10 +5,10 @@ import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { final GestureTapCallback onPressed; - final String title; - final IconData iconData; - final Widget icon; - final Color color; + final String? title; + final IconData? iconData; + final Widget? icon; + final Color? color; final double fontSize; final double padding; final Color fontColor; @@ -16,12 +16,12 @@ class ButtonBottomSheet extends StatelessWidget { final bool disabled; final FontWeight fontWeight; final bool hasBorder; - final Color borderColor; + final Color? borderColor; final double radius; final double vPadding; final double hPadding; - ButtonBottomSheet({@required this.onPressed, + ButtonBottomSheet({required this.onPressed, this.title, this.iconData, this.icon, diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index 48c65baf..9515c732 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -15,7 +15,7 @@ import 'package:provider/provider.dart'; /// [noBorderRadius] remove border radius class SecondaryButton extends StatefulWidget { SecondaryButton( - {Key key, + {Key? key, this.label = "", this.icon, this.iconOnly = false, @@ -29,13 +29,13 @@ class SecondaryButton extends StatefulWidget { this.noBorderRadius = false}) : super(key: key); - final String label; - final Widget icon; - final VoidCallback onTap; + final String? label; + final Widget? icon; + final VoidCallback? onTap; final bool loading; - final Color color; + final Color? color; final Color textColor; - final Color borderColor; + final Color? borderColor; final bool small; final bool iconOnly; final bool disabled; @@ -48,12 +48,12 @@ class SecondaryButton extends StatefulWidget { class _SecondaryButtonState extends State with TickerProviderStateMixin { double _buttonSize = 1.0; - AnimationController _animationController; - Animation _animation; + late AnimationController _animationController; + late Animation _animation; double _rippleSize = 0.0; - AnimationController _rippleController; - Animation _rippleAnimation; + late AnimationController _rippleController; + late Animation _rippleAnimation; @override void initState() { @@ -142,7 +142,7 @@ class _SecondaryButtonState extends State _animationController.forward(); }, onTap: () => { - widget.disabled ? null : widget.onTap(), + widget.disabled ? null : widget.onTap!(), }, // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), behavior: HitTestBehavior.opaque, @@ -152,7 +152,7 @@ class _SecondaryButtonState extends State decoration: BoxDecoration( border: widget.borderColor != null ? Border.all( - color: widget.borderColor.withOpacity(0.1), width: 2.0) + color: widget.borderColor!.withOpacity(0.1), width: 2.0) : null, borderRadius: BorderRadius.all(Radius.circular(100.0)), boxShadow: [ @@ -225,7 +225,7 @@ class _SecondaryButtonState extends State child: CircularProgressIndicator( backgroundColor: Colors.white, valueColor: - AlwaysStoppedAnimation( + AlwaysStoppedAnimation( Colors.grey[300], ), ), @@ -235,7 +235,7 @@ class _SecondaryButtonState extends State padding: EdgeInsets.only( bottom: widget.small ? 4.0 : 3.0), child: Text( - widget.label, + widget.label!, style: TextStyle( color: widget.textColor, fontSize: 16, diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index 00b836bc..bd3439e5 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -12,7 +12,7 @@ import 'package:hexcolor/hexcolor.dart'; class CardWithBgWidgetNew extends StatelessWidget { final Widget widget; - CardWithBgWidgetNew({@required this.widget}); + CardWithBgWidgetNew({required this.widget}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index deeff358..545b7d95 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -6,14 +6,14 @@ import 'package:provider/provider.dart'; class CardWithBgWidget extends StatelessWidget { final Widget widget; - final Color bgColor; + final Color? bgColor; final bool hasBorder; final double padding; final double marginLeft; final double marginSymmetric; CardWithBgWidget( - {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); + {required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/charts/app_line_chart.dart b/lib/widgets/shared/charts/app_line_chart.dart index 422468d7..edbf40e9 100644 --- a/lib/widgets/shared/charts/app_line_chart.dart +++ b/lib/widgets/shared/charts/app_line_chart.dart @@ -10,14 +10,14 @@ import 'package:flutter/material.dart'; */ class AppLineChart extends StatelessWidget { const AppLineChart({ - Key key, - @required this.seriesList, + Key? key, + required this.seriesList, this.chartTitle, }) : super(key: key); final List seriesList; - final String chartTitle; + final String? chartTitle; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/charts/app_time_series_chart.dart b/lib/widgets/shared/charts/app_time_series_chart.dart deleted file mode 100644 index f4bd354e..00000000 --- a/lib/widgets/shared/charts/app_time_series_chart.dart +++ /dev/null @@ -1,121 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -import '../../../config/size_config.dart'; -import '../../../models/patient/vital_sign/vital_sign_res_model.dart'; -import '../../../widgets/shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: AppTimeSeriesChart - */ -class AppTimeSeriesChart extends StatelessWidget { - AppTimeSeriesChart( - {Key key, - @required this.vitalList, - @required this.viewKey, - this.chartName = ''}); - - final List vitalList; - final String chartName; - final String viewKey; - List seriesList; - - @override - Widget build(BuildContext context) { - seriesList = generateData(); - return RoundedContainer( - height: SizeConfig.realScreenHeight * 0.47, - child: Column( - children: [ - Text( - chartName, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 3), - ), - Container( - height: SizeConfig.realScreenHeight * 0.37, - child: Center( - child: Container( - child: charts.TimeSeriesChart( - seriesList, - animate: true, - behaviors: [ - new charts.RangeAnnotation( - [ - new charts.RangeAnnotationSegment( - DateTime( - vitalList[vitalList.length - 1] - .vitalSignDate - .year, - vitalList[vitalList.length - 1] - .vitalSignDate - .month + - 3, - vitalList[vitalList.length - 1] - .vitalSignDate - .day), - vitalList[0].vitalSignDate, - charts.RangeAnnotationAxisType.domain), - ], - ), - ], - ), - ), - ), - ), - ], - ), - ); - } - - /* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: generateData - */ - generateData() { - final List data = []; - if (vitalList.length > 0) { - vitalList.forEach( - (element) { - data.add( - TimeSeriesSales( - new DateTime(element.vitalSignDate.year, - element.vitalSignDate.month, element.vitalSignDate.day), - element.toJson()[viewKey].toInt(), - ), - ); - }, - ); - } - return [ - new charts.Series( - id: 'Sales', - domainFn: (TimeSeriesSales sales, _) => sales.time, - measureFn: (TimeSeriesSales sales, _) => sales.sales, - data: data, - ) - ]; - } -} - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: TimeSeriesSales - */ -class TimeSeriesSales { - final DateTime time; - final int sales; - - TimeSeriesSales(this.time, this.sales); -} diff --git a/lib/widgets/shared/dialogs/ShowImageDialog.dart b/lib/widgets/shared/dialogs/ShowImageDialog.dart index 302366b7..d9ede189 100644 --- a/lib/widgets/shared/dialogs/ShowImageDialog.dart +++ b/lib/widgets/shared/dialogs/ShowImageDialog.dart @@ -2,9 +2,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ShowImageDialog extends StatelessWidget { - final String imageUrl; + final String? imageUrl; - const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); + const ShowImageDialog({Key? key, this.imageUrl}) : super(key: key); @override Widget build(BuildContext context) { return SimpleDialog( @@ -16,7 +16,7 @@ class ShowImageDialog extends StatelessWidget { borderRadius: BorderRadius.circular(12) ), child: Image.network( - imageUrl, + imageUrl!, fit: BoxFit.fill, ), ) diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 76932ecd..5f650a6a 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -3,22 +3,22 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; class ListSelectDialog extends StatefulWidget { - final List list; + final List? list; final String attributeName; final String attributeValueId; final okText; final Function(dynamic) okFunction; dynamic selectedValue; - final Widget searchWidget; + final Widget? searchWidget; final bool usingSearch; - final String hintSearchText; + final String? hintSearchText; ListSelectDialog({ - @required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction, + required this.list, + required this.attributeName, + required this.attributeValueId, + required this.okText, + required this.okFunction, this.searchWidget, this.usingSearch = false, this.hintSearchText, @@ -29,12 +29,12 @@ class ListSelectDialog extends StatefulWidget { } class _ListSelectDialogState extends State { - List items = List(); + List items = []; @override void initState() { - widget.selectedValue = widget.selectedValue ?? widget.list[0]; - items.addAll(widget.list); + widget.selectedValue = widget.selectedValue ?? widget.list![0]; + items.addAll(widget.list!); super.initState(); } @@ -46,7 +46,7 @@ class _ListSelectDialogState extends State { showAlertDialog(BuildContext context) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: Text(TranslationBase.of(context)!.cancel!), onPressed: () { Navigator.of(context).pop(); }); @@ -74,14 +74,14 @@ class _ListSelectDialogState extends State { child: SingleChildScrollView( child: Column( children: [ - if (widget.searchWidget != null) widget.searchWidget, + if (widget.searchWidget != null) widget.searchWidget!, if(widget.usingSearch) Container( height: MediaQuery.of(context).size.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( widget.hintSearchText ?? TranslationBase - .of(context) + .of(context)! .search, null, false, suffixIcon: Icon(Icons.search,)), enabled: true, keyboardType: TextInputType.text, @@ -99,7 +99,7 @@ class _ListSelectDialogState extends State { selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId] .toString(), - onChanged: (val) { + onChanged: (dynamic val) { setState(() { widget.selectedValue = item; }); @@ -117,10 +117,10 @@ class _ListSelectDialogState extends State { } void filterSearchResults(String query) { - List dummySearchList = List(); - dummySearchList.addAll(widget.list); + List dummySearchList = []; + dummySearchList.addAll(widget.list!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); @@ -134,7 +134,7 @@ class _ListSelectDialogState extends State { } else { setState(() { items.clear(); - items.addAll(widget.list); + items.addAll(widget.list!); }); } } diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 55046c3c..380bc0fe 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -8,14 +8,14 @@ import 'package:provider/provider.dart'; class MasterKeyDailog extends StatefulWidget { final List list; final okText; - final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + final Function(MasterKeyModel?) okFunction; + MasterKeyModel? selectedValue; final bool isICD; MasterKeyDailog( - {@required this.list, - @required this.okText, - @required this.okFunction, + {required this.list, + required this.okText, + required this.okFunction, this.selectedValue, this.isICD = false}); @@ -39,7 +39,7 @@ class _MasterKeyDailogState extends State { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: Text(TranslationBase.of(context)!.cancel!), onPressed: () { Navigator.of(context).pop(); }); @@ -72,15 +72,15 @@ class _MasterKeyDailogState extends State { title: Text( '${projectViewModel.isArabic?item.nameAr:item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), groupValue: widget.isICD - ? widget.selectedValue.code.toString() - : widget.selectedValue.id.toString(), - value: widget.isICD ? widget.selectedValue.code.toString() : item + ? widget.selectedValue!.code.toString() + : widget.selectedValue!.id.toString(), + value: widget.isICD ? widget.selectedValue!.code.toString() : item .id.toString(), activeColor: Colors.blue.shade700, selected: widget.isICD ? item.code.toString() == - widget.selectedValue.code.toString() : item.id.toString() == - widget.selectedValue.id.toString(), - onChanged: (val) { + widget.selectedValue!.code.toString() : item.id.toString() == + widget.selectedValue!.id.toString(), + onChanged: (dynamic val) { setState(() { widget.selectedValue = item; }); diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart index 68dce5a4..9d2d4c54 100644 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -10,11 +10,11 @@ class ListSelectDialog extends StatefulWidget { dynamic selectedValue; ListSelectDialog( - {@required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction}); + {required this.list, + required this.attributeName, + required this.attributeValueId, + required this.okText, + required this.okFunction}); @override _ListSelectDialogState createState() => _ListSelectDialogState(); @@ -35,7 +35,7 @@ class _ListSelectDialogState extends State { showAlertDialog(BuildContext context) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: Text(TranslationBase.of(context)!.cancel!), onPressed: () { Navigator.of(context).pop(); }); @@ -73,7 +73,7 @@ class _ListSelectDialogState extends State { selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId] .toString(), - onChanged: (val) { + onChanged: (dynamic val) { setState(() { widget.selectedValue = item; }); diff --git a/lib/widgets/shared/divider_with_spaces_around.dart b/lib/widgets/shared/divider_with_spaces_around.dart index b43557cb..0ecec1b6 100644 --- a/lib/widgets/shared/divider_with_spaces_around.dart +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class DividerWithSpacesAround extends StatelessWidget { DividerWithSpacesAround({ - Key key, this.height = 0, + Key? key, this.height = 0, }); final double height ; diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 2a98a381..a7a74814 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -9,15 +9,15 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class DoctorCard extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final Function? onTap; final bool isPrescriptions; - final String clinic; + final String? clinic; final bool isShowEye; final bool isShowTime; final bool isNoMargin; @@ -51,7 +51,7 @@ class DoctorCard extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(15.0), child: InkWell( - onTap: (isShowEye) ? onTap : null, + onTap: (isShowEye) ? onTap as void Function()? : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -75,7 +75,7 @@ class DoctorCard extends StatelessWidget { ), if (!isPrescriptions&& isShowTime) AppText( - '${AppDateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate!)}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -110,7 +110,7 @@ class DoctorCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).orderNo + + TranslationBase.of(context)!.orderNo! + " ", color: Colors.grey[500], fontSize: 14, @@ -125,8 +125,8 @@ class DoctorCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context) - .invoiceNo + + TranslationBase.of(context)! + .invoiceNo! + " ", fontSize: 14, color: Colors.grey[500], @@ -141,7 +141,7 @@ class DoctorCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).clinic + + TranslationBase.of(context)!.clinic! + ": ", color: Colors.grey[500], fontSize: 14, @@ -156,7 +156,7 @@ class DoctorCard extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).branch + + TranslationBase.of(context)!.branch! + ": ", fontSize: 14, color: Colors.grey[500], diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 2b0aae7c..af1d73fe 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -8,18 +8,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class DoctorCardInsurance extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final Function? onTap; final bool isPrescriptions; - final String clinic; - final String approvalStatus; - final String patientOut; - final String branch2; + final String? clinic; + final String? approvalStatus; + final String? patientOut; + final String? branch2; DoctorCardInsurance( {this.doctorName, @@ -71,7 +71,7 @@ class DoctorCardInsurance extends StatelessWidget { left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), child: InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -157,7 +157,7 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).clinic + + TranslationBase.of(context)!.clinic! + ": ", color: Colors.grey[500], fontSize: 14, @@ -177,7 +177,7 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).branch + + TranslationBase.of(context)!.branch! + ": ", fontSize: 14, color: Colors.grey[500], @@ -191,8 +191,8 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context) - .approvalNo + + TranslationBase.of(context)! + .approvalNo! + ": ", fontSize: 14, color: Colors.grey[500], diff --git a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart index 2c476ec8..c93744ba 100644 --- a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart +++ b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class DrAppCircularProgressIndeicator extends StatelessWidget { const DrAppCircularProgressIndeicator({ - Key key, + Key? key, }) : super(key: key); @override diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 2b8ce40d..9796ce90 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -6,11 +6,11 @@ import 'package:flutter/material.dart'; import '../shared/app_texts_widget.dart'; class DrawerItem extends StatefulWidget { - final String title; + final String? title; final String subTitle; - final IconData icon; - final Color color; - final String assetLink; + final IconData? icon; + final Color? color; + final String? assetLink; DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); @@ -30,7 +30,7 @@ class _DrawerItemState extends State { Container( height: 20, width: 20, - child: Image.asset(widget.assetLink), + child: Image.asset(widget.assetLink!), ), if(widget.assetLink==null) Icon( diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart index de9fd698..7c0a9fbb 100644 --- a/lib/widgets/shared/errors/dr_app_embedded_error.dart +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -11,11 +11,11 @@ import '../app_texts_widget.dart'; */ class DrAppEmbeddedError extends StatelessWidget { const DrAppEmbeddedError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); - final String error; + final String? error; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 21e04e6c..d65797db 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -4,11 +4,11 @@ import '../app_texts_widget.dart'; class ErrorMessage extends StatelessWidget { const ErrorMessage({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); - final String error; + final String? error; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 20d95bcd..c5e5f0f9 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -2,11 +2,11 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; class HeaderBodyExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final Widget collapsed; - final bool isExpand; - bool expandFlag = false; + final Widget? headerWidget; + final Widget? bodyWidget; + final Widget? collapsed; + final bool? isExpand; + bool? expandFlag = false; var controller = new ExpandableController(); HeaderBodyExpandableNotifier({this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); @@ -50,7 +50,7 @@ class _HeaderBodyExpandableNotifierState ), // header: widget.headerWidget, collapsed: Container(), - expanded: widget.bodyWidget, + expanded: widget.bodyWidget!, builder: (_, collapsed, expanded) { return Padding( padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index b2c2224b..2c0709e6 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -8,13 +8,13 @@ class GifLoaderContainer extends StatefulWidget { class _GifLoaderContainerState extends State with TickerProviderStateMixin { - GifController controller1; + late GifController controller1; @override void initState() { controller1 = GifController(vsync: this); - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { controller1.repeat( min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); }); diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 7a1fc3f5..7d96acfc 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -17,19 +17,19 @@ import 'expandable-widget-header-body.dart'; import 'text_fields/app-textfield-custom.dart'; class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { - final SOAPViewModel model; - final Function() addSelectedAllergy; - final Function(MasterKeyModel) removeAllergy; - final Function(MySelectedAllergy mySelectedAllergy) addAllergy; - final bool Function(MasterKeyModel) isServiceSelected; - final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; + final SOAPViewModel? model; + final Function()? addSelectedAllergy; + final Function(MasterKeyModel)? removeAllergy; + final Function(MySelectedAllergy mySelectedAllergy)? addAllergy; + final bool Function(MasterKeyModel)? isServiceSelected; + final MySelectedAllergy? Function(MasterKeyModel)? getServiceSelectedAllergy; - final List masterList; - final String buttonName; - final String hintSearchText; + final List? masterList; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchAllergiesWidget( - {Key key, + {Key? key, this.model, this.addSelectedAllergy, this.removeAllergy, @@ -48,13 +48,13 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { - List items = List(); - MasterKeyModel _selectedAllergySeverity; + List items = []; + MasterKeyModel? _selectedAllergySeverity; bool isSubmitted = false; @override void initState() { - items.addAll(widget.masterList); + items.addAll(widget.masterList!); super.initState(); } @@ -78,7 +78,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState // height: // MediaQuery.of(context).size.height * 0.070, hintText: - TranslationBase.of(context).selectAllergy, + TranslationBase.of(context)!.selectAllergy, isTextFieldHasSuffix: true, hasBorder: false, // controller: filteredSearchController, @@ -86,6 +86,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: null, icon: Icon( Icons.search, color: Colors.black, @@ -105,31 +106,31 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState itemCount: items.length, itemBuilder: (context, index) { bool isSelected = widget - .isServiceSelected(items[index]); - MySelectedAllergy mySelectedAllergy; + .isServiceSelected!(items[index]); + MySelectedAllergy? mySelectedAllergy; if (isSelected) { mySelectedAllergy = - widget.getServiceSelectedAllergy( + widget.getServiceSelectedAllergy!( items[index]); } TextEditingController remarkController = TextEditingController( text: isSelected - ? mySelectedAllergy.remark + ? mySelectedAllergy!.remark : null); TextEditingController severityController = TextEditingController( text: isSelected - ? mySelectedAllergy + ? mySelectedAllergy! .selectedAllergySeverity != null ? projectViewModel .isArabic ? mySelectedAllergy - .selectedAllergySeverity + .selectedAllergySeverity! .nameAr : mySelectedAllergy - .selectedAllergySeverity + .selectedAllergySeverity! .nameEn : null : null); @@ -142,16 +143,16 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState children: [ Checkbox( value: widget - .isServiceSelected( + .isServiceSelected!( items[index]), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { if (widget - .isServiceSelected( + .isServiceSelected!( items[index])) { - widget.removeAllergy( + widget.removeAllergy!( items[index]); } else { MySelectedAllergy @@ -167,7 +168,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState true, isExpanded: true); - widget.addAllergy( + widget.addAllergy!( mySelectedAllergy); } }); @@ -176,9 +177,9 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState onTap: () { setState(() { if (widget - .isServiceSelected( + .isServiceSelected!( items[index])) { - widget.removeAllergy( + widget.removeAllergy!( items[index]); } else { @@ -193,7 +194,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState isChecked: true, isExpanded: true); - widget.addAllergy( + widget.addAllergy!( mySelectedAllergy); } }); @@ -237,10 +238,10 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState if (mySelectedAllergy != null) { setState(() { - mySelectedAllergy + mySelectedAllergy! .isExpanded = mySelectedAllergy - .isExpanded + .isExpanded! ? false : true; }); @@ -250,7 +251,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState null ? mySelectedAllergy .isExpanded - : false) + : false)! ? EvaIcons .arrowIosUpwardOutline : EvaIcons @@ -264,23 +265,23 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: Column( children: [ AppTextFieldCustom( - onClick: widget.model + onClick: widget.model! .allergySeverityList != null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: widget.model + list: widget.model! .allergySeverityList, okText: TranslationBase.of( - context) + context)! .ok, okFunction: (selectedValue) { setState(() { - mySelectedAllergy + mySelectedAllergy! .selectedAllergySeverity = selectedValue; }); @@ -301,7 +302,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState isTextFieldHasSuffix: true, hintText: TranslationBase.of( - context) + context)! .selectSeverity, enabled: false, maxLines: 2, @@ -337,7 +338,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: NewTextFields( hintText: TranslationBase.of( - context) + context)! .remarks, fontSize: 13.5, // hintColor: Colors.black, @@ -346,21 +347,21 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState maxLines: 25, minLines: 3, initialValue: isSelected - ? mySelectedAllergy + ? mySelectedAllergy! .remark : '', // controller: remarkControlle onChanged: (value) { if (isSelected) { - mySelectedAllergy + mySelectedAllergy! .remark = value; } }, validator: (value) { if (value == null) return TranslationBase - .of(context) + .of(context)! .emptyMessage; else return null; @@ -396,13 +397,13 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); - dummySearchList.addAll(widget.masterList); + List dummySearchList = []; + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((items) { - if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || - items.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) || + items.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(items); } }); @@ -414,7 +415,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } else { setState(() { items.clear(); - items.addAll(widget.masterList); + items.addAll(widget.masterList!); }); } } diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 3a0a1525..85507e85 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -11,17 +11,17 @@ import 'app_texts_widget.dart'; import 'text_fields/app-textfield-custom.dart'; class MasterKeyCheckboxSearchWidget extends StatefulWidget { - final SOAPViewModel model; - final Function addSelectedHistories; - final Function(MasterKeyModel) removeHistory; - final Function(MasterKeyModel) addHistory; - final bool Function(MasterKeyModel) isServiceSelected; - final List masterList; - final String buttonName; - final String hintSearchText; + final SOAPViewModel? model; + final Function? addSelectedHistories; + final Function(MasterKeyModel)? removeHistory; + final Function(MasterKeyModel)? addHistory; + final bool Function(MasterKeyModel)? isServiceSelected; + final List? masterList; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchWidget( - {Key key, + {Key? key, this.model, this.addSelectedHistories, this.removeHistory, @@ -39,11 +39,11 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { class _MasterKeyCheckboxSearchWidgetState extends State { - List items = List(); + List items = []; @override void initState() { - items.addAll(widget.masterList); + items.addAll(widget.masterList!); super.initState(); } @@ -74,7 +74,7 @@ class _MasterKeyCheckboxSearchWidgetState children: [ AppTextFieldCustom( height: MediaQuery.of(context).size.height * 0.070, - hintText: TranslationBase.of(context).searchHistory, + hintText: TranslationBase.of(context)!.searchHistory, isTextFieldHasSuffix: true, hasBorder: false, // controller: filteredSearchController, @@ -82,6 +82,7 @@ class _MasterKeyCheckboxSearchWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: null, icon: Icon( Icons.search, color: Colors.black, @@ -99,10 +100,10 @@ class _MasterKeyCheckboxSearchWidgetState InkWell( onTap: () { setState(() { - if (widget.isServiceSelected(historyInfo)) { - widget.removeHistory(historyInfo); + if (widget.isServiceSelected!(historyInfo)) { + widget.removeHistory!(historyInfo); } else { - widget.addHistory(historyInfo); + widget.addHistory!(historyInfo); } }); }, @@ -110,15 +111,15 @@ class _MasterKeyCheckboxSearchWidgetState children: [ Checkbox( value: widget - .isServiceSelected(historyInfo), + .isServiceSelected!(historyInfo), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isServiceSelected( + if (widget.isServiceSelected!( historyInfo)) { - widget.removeHistory(historyInfo); + widget.removeHistory!(historyInfo); } else { - widget.addHistory(historyInfo); + widget.addHistory!(historyInfo); } }); }), @@ -161,13 +162,13 @@ class _MasterKeyCheckboxSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); - dummySearchList.addAll(widget.masterList); + List dummySearchList = []; + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || - item.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || + item.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -179,7 +180,7 @@ class _MasterKeyCheckboxSearchWidgetState } else { setState(() { items.clear(); - items.addAll(widget.masterList); + items.addAll(widget.masterList!); }); } } diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index 32232628..e5c7fd1c 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -7,10 +7,10 @@ import 'app_loader_widget.dart'; import 'errors/error_message.dart'; class NetworkBaseView extends StatelessWidget { - final BaseViewModel baseViewModel; - final Widget child; + final BaseViewModel? baseViewModel; + final Widget? child; - NetworkBaseView({Key key, this.baseViewModel, this.child}); + NetworkBaseView({Key? key, this.baseViewModel, this.child}); @override Widget build(BuildContext context) { @@ -21,7 +21,7 @@ class NetworkBaseView extends StatelessWidget { } buildBaseViewWidget() { - switch (baseViewModel.state) { + switch (baseViewModel!.state) { case ViewState.ErrorLocal: case ViewState.Idle: case ViewState.BusyLocal: @@ -31,7 +31,7 @@ class NetworkBaseView extends StatelessWidget { return AppLoaderWidget(); break; case ViewState.Error: - return ErrorMessage(error: baseViewModel.error ,); + return ErrorMessage(error: baseViewModel!.error ,); break; } } diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index 3db93f9d..580943ca 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -10,13 +10,13 @@ import 'package:flutter/material.dart'; *@desc: Profile Image Widget class */ class ProfileImageWidget extends StatelessWidget { - String url; - String name; - String des; - double height; - double width; + String? url; + String? name; + String? des; + double? height; + double? width; Color color; - double fontsize; + double? fontsize; ProfileImageWidget( {this.url, this.name, @@ -42,7 +42,7 @@ class ProfileImageWidget extends StatelessWidget { borderRadius:BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 8364bb79..f1617610 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -1,11 +1,11 @@ import 'package:flutter/material.dart'; class RoundedContainer extends StatefulWidget { - final double width; - final double height; + final double? width; + final double? height; final double raduis; final Color backgroundColor; - final EdgeInsets margin; + final EdgeInsets? margin; final double elevation; final bool showBorder; final Color borderColor; @@ -21,7 +21,7 @@ class RoundedContainer extends StatefulWidget { final double borderWidth; RoundedContainer( - {@required this.child, + {required this.child, this.width, this.height, this.raduis = 10, diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index dad7e2d1..bf877444 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -15,7 +15,7 @@ class SpeechToText { static var dialog; static stt.SpeechToText speech = stt.SpeechToText(); SpeechToText({ - @required this.context, + required this.context, }); showAlertDialog(BuildContext context) { @@ -44,7 +44,7 @@ typedef Disposer = void Function(); class MyStatefulBuilder extends StatefulWidget { const MyStatefulBuilder({ // @required this.builder, - @required this.dispose, + required this.dispose, }); //final StatefulWidgetBuilder builder; @@ -57,12 +57,12 @@ class MyStatefulBuilder extends StatefulWidget { class _MyStatefulBuilderState extends State { var event = RobotProvider(); var searchText; - static StreamSubscription streamSubscription; + static StreamSubscription? streamSubscription; static var isClosed = false; @override void initState() { streamSubscription = event.controller.stream.listen((p) { - if ((p['searchText'] != 'null' && + if ((p!['searchText'] != 'null' && p['searchText'] != null && p['searchText'] != "" && isClosed == false) && @@ -83,8 +83,8 @@ class _MyStatefulBuilderState extends State { Widget build(BuildContext context) => AlertDialog( content: Container( color: Colors.white, - height: SizeConfig.realScreenHeight * 0.5, - width: SizeConfig.realScreenWidth * 0.8, + height: SizeConfig.realScreenHeight! * 0.5, + width: SizeConfig.realScreenWidth! * 0.8, child: Container( child: Column(children: [ Row( @@ -124,9 +124,9 @@ class _MyStatefulBuilderState extends State { child: Center( child: AppText( searchText == null - ? TranslationBase.of(context).trySaying + ? TranslationBase.of(context)!.trySaying : searchText == 'null' - ? TranslationBase.of(context).didntCatch + ? TranslationBase.of(context)!.didntCatch : searchText, fontSize: 14, ))), @@ -135,7 +135,7 @@ class _MyStatefulBuilderState extends State { child: InkWell( child: Container( decoration: BoxDecoration( - border: Border.all(color: Colors.grey[300])), + border: Border.all(color: Colors.grey[300]!)), padding: EdgeInsets.all(5), child: AppText( 'Try Again', diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 7e13f411..9a8e663a 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -10,21 +10,21 @@ import '../app_texts_widget.dart'; class AppTextFieldCustom extends StatefulWidget { final double height; - final Function onClick; - final String hintText; - final TextEditingController controller; + final Function? onClick; + final String? hintText; + final TextEditingController? controller; final bool isTextFieldHasSuffix; final bool hasBorder; - final String dropDownText; - final IconButton suffixIcon; - final Color dropDownColor; + final String? dropDownText; + final IconButton? suffixIcon; + final Color? dropDownColor; final bool enabled; - final TextInputType inputType; + final TextInputType? inputType; final int minLines; final int maxLines; - final List inputFormatters; - final Function(String) onChanged; - final String validationError; + final List? inputFormatters; + final Function(String)? onChanged; + final String? validationError; final bool isPrscription; final bool isSecure; @@ -74,7 +74,7 @@ class _AppTextFieldCustomState extends State { padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), child: InkWell( - onTap: widget.onClick ?? null, + onTap: widget.onClick as void Function()? ?? null, child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -88,7 +88,7 @@ class _AppTextFieldCustomState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ if ((widget.controller != null && - widget.controller.text != "") || + widget.controller!.text != "") || widget.dropDownText != null) AppText( widget.hintText, @@ -131,7 +131,7 @@ class _AppTextFieldCustomState extends State { onChanged: (value) { setState(() {}); if (widget.onChanged != null) { - widget.onChanged(value); + widget.onChanged!(value); } }, obscureText: widget.isSecure @@ -149,7 +149,7 @@ class _AppTextFieldCustomState extends State { ), widget.isTextFieldHasSuffix ? widget.suffixIcon != null - ? widget.suffixIcon + ? widget.suffixIcon! : InkWell( child: Icon( Icons.keyboard_arrow_down, diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index cf5f0abf..9420e33a 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart'; class AppTextFormField extends FormField { AppTextFormField( - {FormFieldSetter onSaved, - String inputFormatter, - FormFieldValidator validator, - ValueChanged onChanged, - GestureTapCallback onTap, + {FormFieldSetter? onSaved, + String? inputFormatter, + FormFieldValidator? validator, + ValueChanged? onChanged, + GestureTapCallback? onTap, bool obscureText = false, - TextEditingController controller, + TextEditingController? controller, bool autovalidate = true, - TextInputType textInputType, - String hintText, - FocusNode focusNode, + TextInputType? textInputType, + String? hintText, + FocusNode? focusNode, TextInputAction textInputAction=TextInputAction.done, - ValueChanged onFieldSubmitted, - IconButton prefix, - String labelText, - IconData suffixIcon, + ValueChanged? onFieldSubmitted, + IconButton? prefix, + String? labelText, + IconData? suffixIcon, bool readOnly = false, borderColor}) : super( @@ -83,7 +83,7 @@ class AppTextFormField extends FormField { ), state.hasError ? Text( - state.errorText, + state.errorText!, style: TextStyle(color: Colors.red), ) : Container() diff --git a/lib/widgets/shared/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/text_fields/auto_complete_text_field.dart index 3b563f3f..3d16c142 100644 --- a/lib/widgets/shared/text_fields/auto_complete_text_field.dart +++ b/lib/widgets/shared/text_fields/auto_complete_text_field.dart @@ -4,11 +4,11 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils. import 'package:flutter/material.dart'; class CustomAutoCompleteTextField extends StatelessWidget { - final bool isShowError; - final Widget child; + final bool? isShowError; + final Widget? child; const CustomAutoCompleteTextField({ - Key key, + Key? key, this.isShowError, this.child, }) : super(key: key); @@ -23,15 +23,15 @@ class CustomAutoCompleteTextField extends StatelessWidget { Container( decoration: TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), - isShowError ? Colors.red.shade700 : Color(0xFFEFEFEF), + isShowError! ? Colors.red.shade700 : Color(0xFFEFEFEF), ), padding: EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), child: child, ), - if (isShowError) + if (isShowError!) TextFieldsError( - error: TranslationBase.of(context).emptyMessage, + error: TranslationBase.of(context)!.emptyMessage, ) ], ), diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart new file mode 100644 index 00000000..193fb3b0 --- /dev/null +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -0,0 +1,50 @@ +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:html_editor_enhanced/html_editor.dart'; + +class HtmlRichEditor extends StatelessWidget { + const HtmlRichEditor({ + Key? key, + this.hint = "Your text here...", + this.initialText, + this.height =400, + this.decoration, this.darkMode =false, this.showBottomToolbar =false, this.toolbar, this.controller, + }) : super(key: key); + final String hint; + final String? initialText; + final double height; + final BoxDecoration? decoration; + final bool darkMode; + final bool showBottomToolbar; + final List? toolbar; + final HtmlEditorController? controller; + + @override + Widget build(BuildContext context) { + return HtmlEditor( + hint: hint, + // height: height, + // initialText: initialText, + // showBottomToolbar: showBottomToolbar, + // darkMode: darkMode, + // decoration:decoration , + controller: controller!, + toolbar:toolbar?? const [ + Style(), + Font(buttons: [ + FontButtons.bold, + FontButtons.underline, + FontButtons.clear + ]), + // ColorBar(buttons: [ColorButtons.color]), + Paragraph(buttons: [ + ParagraphButtons.ul, + ParagraphButtons.ol, + ParagraphButtons.paragraph + ]), + // Insert(buttons: [InsertButtons.link, InsertButtons.picture, InsertButtons.video, InsertButtons.table]), + // Misc(buttons: [MiscButtons.fullscreen, MiscButtons.codeview, MiscButtons.help]) + ], + ); + } +} diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart index 9917b04f..a5e3165f 100644 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ b/lib/widgets/shared/text_fields/new_text_Field.dart @@ -41,7 +41,7 @@ final _mobileFormatter = NumberTextInputFormatter(); class NewTextFields extends StatefulWidget { NewTextFields( - {Key key, + {Key? key, this.type, this.hintText, this.suffixIcon, @@ -77,41 +77,41 @@ class NewTextFields extends StatefulWidget { this.isEnabled = true}) : super(key: key); - final String hintText; + final String? hintText; // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; + final String? type; + final bool? autoFocus; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final Function? onSaved; + final Function? onSuffixTap; + final Function? onChanged; + final Function? onSubmit; final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; + final int? maxLength; + final int? minLines; + final int? maxLines; final bool maxLengthEnforced; final bool bare; final bool isEnabled; - final TextInputAction inputAction; + final TextInputAction? inputAction; final double fontSize; final FontWeight fontWeight; final bool keepPadding; final TextCapitalization textCapitalization; - final List inputFormatters; + final List? inputFormatters; final bool autoValidate; - final EdgeInsets padding; + final EdgeInsets? padding; final bool focus; final bool borderOnlyError; - final Color hintColor; - final String initialValue; + final Color? hintColor; + final String? initialValue; @override _NewTextFieldsState createState() => _NewTextFieldsState(); } @@ -176,16 +176,16 @@ class _NewTextFieldsState extends State { textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null - ? widget.onSubmit + ? widget.onSubmit as void Function(String)? : (val) { _focusNode.nextFocus(); }) - : widget.onSubmit, + : widget.onSubmit as void Function(String)?, textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, + onChanged: widget.onChanged as void Function(String)?, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, @@ -194,8 +194,8 @@ class _NewTextFieldsState extends State { obscureText: widget.type == "password" && !view ? true : false, autofocus: widget.autoFocus ?? false, validator: widget.validator, - onSaved: widget.onSaved, - style: Theme.of(context).textTheme.body2.copyWith( + onSaved: widget.onSaved as void Function(String?)?, + style: Theme.of(context).textTheme.body2!.copyWith( fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), inputFormatters: widget.keyboardType == TextInputType.phone ? [ diff --git a/lib/widgets/shared/text_fields/text_field_error.dart b/lib/widgets/shared/text_fields/text_field_error.dart index ee22a6a4..c96381d6 100644 --- a/lib/widgets/shared/text_fields/text_field_error.dart +++ b/lib/widgets/shared/text_fields/text_field_error.dart @@ -6,11 +6,11 @@ import '../app_texts_widget.dart'; class TextFieldsError extends StatelessWidget { const TextFieldsError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); - final String error; + final String? error; @override diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 54c7e494..867af80d 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -17,8 +17,8 @@ class TextFieldsUtils{ } static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData suffixIcon, Color dropDownColor}) { + String? hintText, String? selectedText, bool isDropDown, + {IconData? suffixIcon, Color? dropDownColor}) { return InputDecoration( isDense: true, contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), diff --git a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart index 8a4891fd..ab5d3287 100644 --- a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart +++ b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart @@ -28,9 +28,9 @@ import 'package:flutter/material.dart'; /// class AnchoredOverlay extends StatelessWidget { final bool showOverlay; - final Widget Function(BuildContext, Rect anchorBounds, Offset anchor) + final Widget Function(BuildContext, Rect anchorBounds, Offset anchor)? overlayBuilder; - final Widget child; + final Widget? child; AnchoredOverlay({ key, @@ -60,7 +60,7 @@ class AnchoredOverlay extends StatelessWidget { bottomRight.dy, ); final anchorCenter = box.size.center(topLeft); - return overlayBuilder(overlayContext, anchorBounds, anchorCenter); + return overlayBuilder!(overlayContext, anchorBounds, anchorCenter); }, child: child, ); @@ -84,8 +84,8 @@ class AnchoredOverlay extends StatelessWidget { // class OverlayBuilder extends StatefulWidget { final bool showOverlay; - final Widget Function(BuildContext) overlayBuilder; - final Widget child; + final Widget Function(BuildContext)? overlayBuilder; + final Widget? child; OverlayBuilder({ key, @@ -99,27 +99,27 @@ class OverlayBuilder extends StatefulWidget { } class _OverlayBuilderState extends State { - OverlayEntry _overlayEntry; + OverlayEntry? _overlayEntry; @override void initState() { super.initState(); if (widget.showOverlay) { - WidgetsBinding.instance.addPostFrameCallback((_) => showOverlay()); + WidgetsBinding.instance!.addPostFrameCallback((_) => showOverlay()); } } @override void didUpdateWidget(OverlayBuilder oldWidget) { super.didUpdateWidget(oldWidget); - WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); + WidgetsBinding.instance!.addPostFrameCallback((_) => syncWidgetAndOverlay()); } @override void reassemble() { super.reassemble(); - WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); + WidgetsBinding.instance!.addPostFrameCallback((_) => syncWidgetAndOverlay()); } @override @@ -137,9 +137,9 @@ class _OverlayBuilderState extends State { if (_overlayEntry == null) { // Create the overlay. _overlayEntry = OverlayEntry( - builder: widget.overlayBuilder, + builder: widget.overlayBuilder!, ); - addToOverlay(_overlayEntry); + addToOverlay(_overlayEntry!); } else { // Rebuild overlay. buildOverlay(); @@ -147,16 +147,16 @@ class _OverlayBuilderState extends State { } void addToOverlay(OverlayEntry overlayEntry) async { - Overlay.of(context).insert(overlayEntry); + Overlay.of(context)!.insert(overlayEntry); final overlay = Overlay.of(context); if (overlayEntry == null) - WidgetsBinding.instance - .addPostFrameCallback((_) => overlay.insert(overlayEntry)); + WidgetsBinding.instance! + .addPostFrameCallback((_) => overlay!.insert(overlayEntry)); } void hideOverlay() { if (_overlayEntry != null) { - _overlayEntry.remove(); + _overlayEntry!.remove(); _overlayEntry = null; } } @@ -170,7 +170,7 @@ class _OverlayBuilderState extends State { } void buildOverlay() async { - WidgetsBinding.instance + WidgetsBinding.instance! .addPostFrameCallback((_) => _overlayEntry?.markNeedsBuild()); } @@ -178,6 +178,6 @@ class _OverlayBuilderState extends State { Widget build(BuildContext context) { buildOverlay(); - return widget.child; + return widget.child!; } } diff --git a/lib/widgets/shared/user-guid/app_get_position.dart b/lib/widgets/shared/user-guid/app_get_position.dart index c0430994..407a9bd1 100644 --- a/lib/widgets/shared/user-guid/app_get_position.dart +++ b/lib/widgets/shared/user-guid/app_get_position.dart @@ -11,12 +11,12 @@ Customized By: Ibrahim Albitar import 'package:flutter/material.dart'; class GetPosition { - final GlobalKey key; + final GlobalKey? key; GetPosition({this.key}); Rect getRect() { - RenderBox box = key.currentContext.findRenderObject(); + RenderBox box = key!.currentContext!.findRenderObject() as RenderBox; final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); final bottomRight = @@ -33,7 +33,7 @@ class GetPosition { ///Get the bottom position of the widget double getBottom() { - RenderBox box = key.currentContext.findRenderObject(); + RenderBox box = key!.currentContext!.findRenderObject() as RenderBox; final bottomRight = box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); return bottomRight.dy; @@ -41,21 +41,21 @@ class GetPosition { ///Get the top position of the widget double getTop() { - RenderBox box = key.currentContext.findRenderObject(); + RenderBox box = key!.currentContext!.findRenderObject() as RenderBox; final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); return topLeft.dy; } ///Get the left position of the widget double getLeft() { - RenderBox box = key.currentContext.findRenderObject(); + RenderBox box = key!.currentContext!.findRenderObject() as RenderBox; final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); return topLeft.dx; } ///Get the right position of the widget double getRight() { - RenderBox box = key.currentContext.findRenderObject(); + RenderBox box = key!.currentContext!.findRenderObject() as RenderBox; final bottomRight = box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); return bottomRight.dx; diff --git a/lib/widgets/shared/user-guid/app_shape_painter.dart b/lib/widgets/shared/user-guid/app_shape_painter.dart index 925d18d0..2513fdda 100644 --- a/lib/widgets/shared/user-guid/app_shape_painter.dart +++ b/lib/widgets/shared/user-guid/app_shape_painter.dart @@ -13,12 +13,12 @@ import 'package:flutter/material.dart'; class ShapePainter extends CustomPainter { Rect rect; - final ShapeBorder shapeBorder; - final Color color; - final double opacity; + final ShapeBorder? shapeBorder; + final Color? color; + final double? opacity; ShapePainter({ - @required this.rect, + required this.rect, this.color, this.shapeBorder, this.opacity, @@ -27,7 +27,7 @@ class ShapePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { final paint = Paint(); - paint.color = color.withOpacity(opacity); + paint.color = color!.withOpacity(opacity!); RRect outer = RRect.fromLTRBR(0, 0, size.width, size.height, Radius.circular(0)); diff --git a/lib/widgets/shared/user-guid/app_showcase.dart b/lib/widgets/shared/user-guid/app_showcase.dart index 38625279..16dbaf64 100644 --- a/lib/widgets/shared/user-guid/app_showcase.dart +++ b/lib/widgets/shared/user-guid/app_showcase.dart @@ -21,32 +21,32 @@ import 'app_tool_tip_widget.dart'; class AppShowcase extends StatefulWidget { final Widget child; - final String title; - final String description; - final ShapeBorder shapeBorder; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final GlobalKey key; + final String? title; + final String? description; + final ShapeBorder? shapeBorder; + final TextStyle? titleTextStyle; + final TextStyle? descTextStyle; + final GlobalKey? key; final Color overlayColor; final double overlayOpacity; - final Widget container; + final Widget? container; final Color showcaseBackgroundColor; final Color textColor; final bool showArrow; - final double height; - final double width; + final double? height; + final double? width; final Duration animationDuration; - final VoidCallback onToolTipClick; - final VoidCallback onTargetClick; - final VoidCallback onSkipClick; - final bool disposeOnTap; + final VoidCallback? onToolTipClick; + final VoidCallback? onTargetClick; + final VoidCallback? onSkipClick; + final bool? disposeOnTap; final bool disableAnimation; const AppShowcase( - {@required this.key, - @required this.child, + {required this.key, + required this.child, this.title, - @required this.description, + required this.description, this.shapeBorder, this.overlayColor = Colors.black, this.overlayOpacity = 0.75, @@ -92,10 +92,10 @@ class AppShowcase extends StatefulWidget { const AppShowcase.withWidget( {this.key, - @required this.child, - @required this.container, - @required this.height, - @required this.width, + required this.child, + required this.container, + required this.height, + required this.width, this.title, this.description, this.shapeBorder, @@ -134,10 +134,10 @@ class AppShowcase extends StatefulWidget { class _AppShowcaseState extends State with TickerProviderStateMixin { bool _showShowCase = false; - Animation _slideAnimation; - AnimationController _slideAnimationController; + Animation? _slideAnimation; + late AnimationController _slideAnimationController; - GetPosition position; + GetPosition? position; @override void initState() { @@ -181,7 +181,7 @@ class _AppShowcaseState extends State /// show overlay if there is any target widget /// void showOverlay() { - GlobalKey activeStep = ShowCaseWidget.activeTargetWidget(context); + GlobalKey? activeStep = ShowCaseWidget.activeTargetWidget(context); setState(() { _showShowCase = activeStep == widget.key; }); @@ -205,7 +205,7 @@ class _AppShowcaseState extends State } _nextIfAny() { - ShowCaseWidget.of(context).completed(widget.key); + ShowCaseWidget.of(context)!.completed(widget.key); if (!widget.disableAnimation) { _slideAnimationController.forward(); } @@ -215,11 +215,11 @@ class _AppShowcaseState extends State if (widget.disposeOnTap == true) { return widget.onTargetClick == null ? () { - ShowCaseWidget.of(context).dismiss(); + ShowCaseWidget.of(context)!.dismiss(); } : () { - ShowCaseWidget.of(context).dismiss(); - widget.onTargetClick(); + ShowCaseWidget.of(context)!.dismiss(); + widget.onTargetClick!(); }; } else { return widget.onTargetClick ?? _nextIfAny; @@ -230,11 +230,11 @@ class _AppShowcaseState extends State if (widget.disposeOnTap == true) { return widget.onToolTipClick == null ? () { - ShowCaseWidget.of(context).dismiss(); + ShowCaseWidget.of(context)!.dismiss(); } : () { - ShowCaseWidget.of(context).dismiss(); - widget.onToolTipClick(); + ShowCaseWidget.of(context)!.dismiss(); + widget.onToolTipClick!(); }; } else { return widget.onToolTipClick ?? () {}; @@ -261,7 +261,7 @@ class _AppShowcaseState extends State child: CustomPaint( painter: ShapePainter( opacity: widget.overlayOpacity, - rect: position.getRect(), + rect: position!.getRect(), shapeBorder: widget.shapeBorder, color: widget.overlayColor), ), @@ -307,14 +307,14 @@ class _AppShowcaseState extends State class _TargetWidget extends StatelessWidget { final Offset offset; - final Size size; - final Animation widthAnimation; - final VoidCallback onTap; - final ShapeBorder shapeBorder; + final Size? size; + final Animation? widthAnimation; + final VoidCallback? onTap; + final ShapeBorder? shapeBorder; _TargetWidget({ - Key key, - @required this.offset, + Key? key, + required this.offset, this.size, this.widthAnimation, this.onTap, @@ -331,8 +331,8 @@ class _TargetWidget extends StatelessWidget { child: GestureDetector( onTap: onTap, child: Container( - height: size.height + 16, - width: size.width + 16, + height: size!.height + 16, + width: size!.width + 16, decoration: ShapeDecoration( shape: shapeBorder ?? RoundedRectangleBorder( diff --git a/lib/widgets/shared/user-guid/app_showcase_widget.dart b/lib/widgets/shared/user-guid/app_showcase_widget.dart index 07577b3b..d7725b10 100644 --- a/lib/widgets/shared/user-guid/app_showcase_widget.dart +++ b/lib/widgets/shared/user-guid/app_showcase_widget.dart @@ -13,18 +13,18 @@ import 'package:flutter/material.dart'; class ShowCaseWidget extends StatefulWidget { final Builder builder; - final VoidCallback onFinish; + final VoidCallback? onFinish; - const ShowCaseWidget({@required this.builder, this.onFinish}); + const ShowCaseWidget({required this.builder, this.onFinish}); static activeTargetWidget(BuildContext context) { return context - .dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>() + .dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>()! .activeWidgetIds; } - static ShowCaseWidgetState of(BuildContext context) { - ShowCaseWidgetState state = + static ShowCaseWidgetState? of(BuildContext context) { + ShowCaseWidgetState? state = context.findAncestorStateOfType(); if (state != null) { return context.findAncestorStateOfType(); @@ -38,8 +38,8 @@ class ShowCaseWidget extends StatefulWidget { } class ShowCaseWidgetState extends State { - List ids; - int activeWidgetId; + List? ids; + int? activeWidgetId; void startShowCase(List widgetIds) { setState(() { @@ -48,15 +48,15 @@ class ShowCaseWidgetState extends State { }); } - void completed(GlobalKey id) { - if (ids != null && ids[activeWidgetId] == id) { + void completed(GlobalKey? id) { + if (ids != null && ids![activeWidgetId!] == id) { setState(() { ++activeWidgetId; - if (activeWidgetId >= ids.length) { + if (activeWidgetId! >= ids!.length) { _cleanupAfterSteps(); if (widget.onFinish != null) { - widget.onFinish(); + widget.onFinish!(); } } }); @@ -78,17 +78,17 @@ class ShowCaseWidgetState extends State { Widget build(BuildContext context) { return _InheritedShowCaseView( child: widget.builder, - activeWidgetIds: ids?.elementAt(activeWidgetId), + activeWidgetIds: ids?.elementAt(activeWidgetId!), ); } } class _InheritedShowCaseView extends InheritedWidget { - final GlobalKey activeWidgetIds; + final GlobalKey? activeWidgetIds; _InheritedShowCaseView({ - @required this.activeWidgetIds, - @required child, + required this.activeWidgetIds, + required child, }) : super(child: child); @override diff --git a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart index 285caa8e..c55b8d37 100644 --- a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart +++ b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart @@ -16,22 +16,22 @@ import 'package:flutter/material.dart'; import 'app_get_position.dart'; class AppToolTipWidget extends StatelessWidget { - final GetPosition position; - final Offset offset; - final Size screenSize; - final String title; - final String description; - final Animation animationOffset; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final Widget container; - final Color tooltipColor; - final Color textColor; - final bool showArrow; - final double contentHeight; - final double contentWidth; - static bool isArrowUp; - final VoidCallback onTooltipTap; + final GetPosition? position; + final Offset? offset; + final Size? screenSize; + final String? title; + final String? description; + final Animation? animationOffset; + final TextStyle? titleTextStyle; + final TextStyle? descTextStyle; + final Widget? container; + final Color? tooltipColor; + final Color? textColor; + final bool? showArrow; + final double? contentHeight; + final double? contentWidth; + static late bool isArrowUp; + final VoidCallback? onTooltipTap; AppToolTipWidget({ this.position, @@ -52,11 +52,11 @@ class AppToolTipWidget extends StatelessWidget { }); bool isCloseToTopOrBottom(Offset position) { - double height = 120; + double? height = 120; if (contentHeight != null) { height = contentHeight; } - return (screenSize.height - position.dy) <= height; + return (screenSize!.height - position.dy) <= height!; } String findPositionForContent(Offset position) { @@ -68,8 +68,8 @@ class AppToolTipWidget extends StatelessWidget { } double _getTooltipWidth() { - double titleLength = title == null ? 0 : (title.length * 10.0); - double descriptionLength = (description.length * 7.0); + double titleLength = title == null ? 0 : (title!.length * 10.0); + double descriptionLength = (description!.length * 7.0); if (titleLength > descriptionLength) { return titleLength + 10; } else { @@ -78,51 +78,51 @@ class AppToolTipWidget extends StatelessWidget { } bool _isLeft() { - double screenWidth = screenSize.width / 3; - return !(screenWidth <= position.getCenter()); + double screenWidth = screenSize!.width / 3; + return !(screenWidth <= position!.getCenter()); } bool _isRight() { - double screenWidth = screenSize.width / 3; - return ((screenWidth * 2) <= position.getCenter()); + double screenWidth = screenSize!.width / 3; + return ((screenWidth * 2) <= position!.getCenter()); } - double _getLeft() { + double? _getLeft() { if (_isLeft()) { - double leftPadding = position.getCenter() - (_getTooltipWidth() * 0.1); - if (leftPadding + _getTooltipWidth() > screenSize.width) { - leftPadding = (screenSize.width - 20) - _getTooltipWidth(); + double leftPadding = position!.getCenter() - (_getTooltipWidth() * 0.1); + if (leftPadding + _getTooltipWidth() > screenSize!.width) { + leftPadding = (screenSize!.width - 20) - _getTooltipWidth(); } if (leftPadding < 20) { leftPadding = 14; } return leftPadding; } else if (!(_isRight())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); + return position!.getCenter() - (_getTooltipWidth() * 0.5); } else { return null; } } - double _getRight() { + double? _getRight() { if (_isRight()) { - double rightPadding = position.getCenter() + (_getTooltipWidth() / 2); - if (rightPadding + _getTooltipWidth() > screenSize.width) { + double rightPadding = position!.getCenter() + (_getTooltipWidth() / 2); + if (rightPadding + _getTooltipWidth() > screenSize!.width) { rightPadding = 14; } return rightPadding; } else if (!(_isLeft())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); + return position!.getCenter() - (_getTooltipWidth() * 0.5); } else { return null; } } double _getSpace() { - double space = position.getCenter() - (contentWidth / 2); - if (space + contentWidth > screenSize.width) { - space = screenSize.width - contentWidth - 8; - } else if (space < (contentWidth / 2)) { + double space = position!.getCenter() - (contentWidth! / 2); + if (space + contentWidth! > screenSize!.width) { + space = screenSize!.width - contentWidth! - 8; + } else if (space < (contentWidth! / 2)) { space = 16; } return space; @@ -130,20 +130,20 @@ class AppToolTipWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final contentOrientation = findPositionForContent(offset); + final contentOrientation = findPositionForContent(offset!); final contentOffsetMultiplier = contentOrientation == "BELOW" ? 1.0 : -1.0; isArrowUp = contentOffsetMultiplier == 1.0 ? true : false; final contentY = isArrowUp - ? position.getBottom() + (contentOffsetMultiplier * 3) - : position.getTop() + (contentOffsetMultiplier * 3); + ? position!.getBottom() + (contentOffsetMultiplier * 3) + : position!.getTop() + (contentOffsetMultiplier * 3); - final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); + final num contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); double paddingTop = isArrowUp ? 22 : 0; double paddingBottom = isArrowUp ? 0 : 27; - if (!showArrow) { + if (!showArrow!) { paddingTop = 10; paddingBottom = 10; } @@ -151,18 +151,18 @@ class AppToolTipWidget extends StatelessWidget { if (container == null) { return Stack( children: [ - showArrow ? _getArrow(contentOffsetMultiplier) : Container(), + showArrow! ? _getArrow(contentOffsetMultiplier) : Container(), Positioned( top: contentY, left: _getLeft(), right: _getRight(), child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), + translation: Offset(0.0, contentFractionalOffset as double), child: SlideTransition( position: Tween( begin: Offset(0.0, contentFractionalOffset / 10), end: Offset(0.0, 0.100), - ).animate(animationOffset), + ).animate(animationOffset!), child: Material( color: Colors.transparent, child: Container( @@ -231,12 +231,12 @@ class AppToolTipWidget extends StatelessWidget { left: _getSpace(), top: contentY - 10, child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), + translation: Offset(0.0, contentFractionalOffset as double), child: SlideTransition( position: Tween( begin: Offset(0.0, contentFractionalOffset / 5), end: Offset(0.0, 0.100), - ).animate(animationOffset), + ).animate(animationOffset!), child: Material( color: Colors.transparent, child: GestureDetector( @@ -263,15 +263,15 @@ class AppToolTipWidget extends StatelessWidget { Widget _getArrow(contentOffsetMultiplier) { final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); return Positioned( - top: isArrowUp ? position.getBottom() : position.getTop() - 1, - left: position.getCenter() - 24, + top: isArrowUp ? position!.getBottom() : position!.getTop() - 1, + left: position!.getCenter() - 24, child: FractionalTranslation( translation: Offset(0.0, contentFractionalOffset), child: SlideTransition( position: Tween( begin: Offset(0.0, contentFractionalOffset / 5), end: Offset(0.0, 0.150), - ).animate(animationOffset), + ).animate(animationOffset!), child: isArrowUp ? Icon( Icons.arrow_drop_up, diff --git a/lib/widgets/shared/user-guid/custom_validation_error.dart b/lib/widgets/shared/user-guid/custom_validation_error.dart index a05d52a2..f0ac56ae 100644 --- a/lib/widgets/shared/user-guid/custom_validation_error.dart +++ b/lib/widgets/shared/user-guid/custom_validation_error.dart @@ -5,16 +5,16 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class CustomValidationError extends StatelessWidget { - String error; + String? error; CustomValidationError({ - Key key, this.error, + Key? key, this.error, }) : super(key: key); @override Widget build(BuildContext context) { if(error == null ) error = TranslationBase - .of(context) + .of(context)! .emptyMessage; return Column( children: [ diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart index 9197a4a1..372fa8b5 100644 --- a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -7,15 +7,15 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class InPatientDoctorCard extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final Function? onTap; final bool isPrescriptions; - final String clinic; + final String? clinic; final createdBy; InPatientDoctorCard( @@ -47,7 +47,7 @@ class InPatientDoctorCard extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(15.0), child: InkWell( - onTap: onTap, + onTap: onTap as void Function()?, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -70,7 +70,7 @@ class InPatientDoctorCard extends StatelessWidget { ), if (!isPrescriptions) AppText( - '${AppDateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate!)}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 97a37ce1..0e43461d 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; /// FadePage animation /// [page] class FadePage extends PageRouteBuilder { - final Widget page; + final Widget? page; FadePage({this.page}) : super( opaque: false, @@ -15,7 +15,7 @@ class FadePage extends PageRouteBuilder { Animation animation, Animation secondaryAnimation, ) => - page, + page!, transitionDuration: Duration(milliseconds: 300), transitionsBuilder: ( BuildContext context, diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index 2c138b9e..65ad06f1 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart'; /// [fullscreenDialog] show the widget as full screen dialog /// [opaque] When an opaque route's entrance transition is complete, the routes behind the opaque route will not be built to save resources. class SlideUpPageRoute extends PageRouteBuilder { - final Widget widget; + final Widget? widget; final bool fullscreenDialog; final bool opaque; @@ -18,7 +18,7 @@ class SlideUpPageRoute extends PageRouteBuilder { Animation animation, Animation secondaryAnimation, ) { - return widget; + return widget!; }, fullscreenDialog: fullscreenDialog, opaque: opaque, diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index ee31002d..00000000 --- a/pubspec.lock +++ /dev/null @@ -1,1102 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "12.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.40.6" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.13" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.0-nullsafety.1" - autocomplete_textfield: - dependency: "direct main" - description: - name: autocomplete_textfield - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.3" - barcode_scan: - dependency: "direct main" - description: - name: barcode_scan - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - bazel_worker: - dependency: transitive - description: - name: bazel_worker - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.25" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.1" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.2" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.5" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.7" - build_modules: - dependency: transitive - description: - name: build_modules - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.7" - build_web_compilers: - dependency: "direct dev" - description: - name: build_web_compilers - url: "https://pub.dartlang.org" - source: hosted - version: "2.12.2" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.2" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.3" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - charts_common: - dependency: transitive - description: - name: charts_common - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - chewie: - dependency: transitive - description: - name: chewie - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.10" - chewie_audio: - dependency: transitive - description: - name: chewie_audio - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0+1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.1" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.7.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0-nullsafety.3" - connectivity: - dependency: "direct main" - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9+5" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+4" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0+7" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - css_colors: - dependency: transitive - description: - name: css_colors - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.10" - date_time_picker: - dependency: "direct main" - description: - name: date_time_picker - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - device_info: - dependency: "direct main" - description: - name: device_info - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2+10" - device_info_platform_interface: - dependency: transitive - description: - name: device_info_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - dropdown_search: - dependency: "direct main" - description: - name: dropdown_search - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9" - equatable: - dependency: transitive - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.6" - eva_icons_flutter: - dependency: "direct main" - description: - name: eva_icons_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - expandable: - dependency: "direct main" - description: - name: expandable - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.4" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "5.2.1" - firebase_core: - dependency: transitive - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.3" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1+1" - firebase_messaging: - dependency: "direct main" - description: - name: firebase_messaging - url: "https://pub.dartlang.org" - source: hosted - version: "7.0.3" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.11" - fl_chart: - dependency: "direct main" - description: - name: fl_chart - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.3" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_device_type: - dependency: "direct main" - description: - name: flutter_device_type - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - flutter_flexible_toast: - dependency: "direct main" - description: - name: flutter_flexible_toast - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - flutter_gifimage: - dependency: "direct main" - description: - name: flutter_gifimage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_html: - dependency: "direct main" - description: - name: flutter_html - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_page_indicator: - dependency: transitive - description: - name: flutter_page_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.11" - flutter_staggered_grid_view: - dependency: "direct main" - description: - name: flutter_staggered_grid_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.4" - flutter_svg: - dependency: transitive - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "0.18.1" - flutter_swiper: - dependency: "direct main" - description: - name: flutter_swiper - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - font_awesome_flutter: - dependency: "direct main" - description: - name: font_awesome_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "8.12.0" - get_it: - dependency: "direct main" - description: - name: get_it - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.4" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - hexcolor: - dependency: "direct main" - description: - name: hexcolor - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - html: - dependency: "direct main" - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+4" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.2" - http_interceptor: - dependency: "direct main" - description: - name: http_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.4" - imei_plugin: - dependency: "direct main" - description: - name: imei_plugin - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.2" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.1" - local_auth: - dependency: "direct main" - description: - name: local_auth - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3+4" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - maps_launcher: - dependency: "direct main" - description: - name: maps_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.2+2" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10-nullsafety.1" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.3" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - open_iconic_flutter: - dependency: transitive - description: - name: open_iconic_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety.1" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.1+1" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+2" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.2" - percent_indicator: - dependency: "direct main" - description: - name: percent_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.9+1" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.0+2" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.13" - progress_hud_v2: - dependency: "direct main" - description: - name: progress_hud_v2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - protobuf: - dependency: transitive - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.3" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.3" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - scratch_space: - dependency: transitive - description: - name: scratch_space - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - screen: - dependency: transitive - description: - name: screen - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.5" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.12+4" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2+4" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+11" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+7" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2+3" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.9" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.4+1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.9" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety.2" - speech_to_text: - dependency: "direct main" - description: - path: speech_to_text - relative: true - source: path - version: "0.0.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0-nullsafety.1" - sticky_headers: - dependency: "direct main" - description: - name: sticky_headers - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8+1" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.1" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.1" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.19-nullsafety.2" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+3" - transformer_page_view: - dependency: transitive - description: - name: transformer_page_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.6" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.3" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "5.7.10" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+4" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+9" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.9" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5+3" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+3" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.3" - video_player: - dependency: transitive - description: - name: video_player - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.12+5" - video_player_platform_interface: - dependency: transitive - description: - name: video_player_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - video_player_web: - dependency: transitive - description: - name: video_player_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+1" - wakelock: - dependency: transitive - description: - name: wakelock - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+2" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - webview_flutter: - dependency: transitive - description: - name: webview_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.24" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.4+1" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "4.5.1" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.10.0 <2.11.0" - flutter: ">=1.22.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 29c3f7b1..e6cc8c5f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,11 +14,11 @@ description: A new Flutter project. version: 1.2.2+2 environment: - sdk: ">=2.8.0 <3.0.0" + sdk: '>=2.12.0 <3.0.0' -#dependency_overrides: -# intl: 0.17.0-nullsafety.2 +dependency_overrides: + intl: 0.17.0-nullsafety.2 dependencies: @@ -90,6 +90,9 @@ dependencies: speech_to_text: path: speech_to_text + #html Editor Enhanced + html_editor_enhanced: ^1.4.0 + dev_dependencies: flutter_test: sdk: flutter