From d4cb4d7ad3ec2577aa24262d878bdbb5021963c8 Mon Sep 17 00:00:00 2001 From: Aamir Date: Mon, 11 Dec 2023 09:33:05 +0300 Subject: [PATCH] Null Safety --- ios/Runner.xcodeproj/project.pbxproj | 32 +- ios/Runner/Info.plist | 2 + lib/client/base_app_client.dart | 60 +- .../doctor_ER_sign_assessment_req_model.dart | 6 +- .../post_assessment_request_model.dart | 46 +- .../post_progress_note_request_model.dart | 15 +- .../admissionRequest/admission-request.dart | 100 +- ...on_code_for_doctor_app_response_model.dart | 122 +- lib/core/model/dashboard/doctor_schedule.dart | 73 +- lib/core/model/doctor/clinic_model.dart | 27 +- .../hospitals/VidaPlusProjectListModel.dart | 2 +- .../get_hospitals_request_model.dart | 44 +- lib/core/model/labs/patient_lab_orders.dart | 80 +- .../get_doctor_by_clinic_id_request.dart | 26 +- .../vital_sign/patient-vital-sign-data.dart | 52 +- ...rvention_medication_history_res_model.dart | 74 +- lib/core/model/radiology/final_radiology.dart | 35 +- lib/core/service/AnalyticsService.dart | 4 +- lib/core/service/VideoCallService.dart | 55 +- lib/core/service/authentication_service.dart | 14 +- .../service/hospitals/hospitals_service.dart | 4 +- .../ER_signin/ER_signin_service.dart | 37 +- .../lab_order/labs_service.dart | 88 +- .../radiology/radiology_service.dart | 5 +- lib/core/service/pending_order_service.dart | 42 +- .../ER_sign_in/ER_sign_in_view_model.dart | 19 +- lib/core/viewModel/SOAP_view_model.dart | 102 +- .../viewModel/authentication_view_model.dart | 89 +- lib/core/viewModel/dashboard_view_model.dart | 42 +- .../viewModel/doctor_replay_view_model.dart | 41 +- lib/core/viewModel/labs_view_model.dart | 129 +- .../patient-admission-request-viewmodel.dart | 20 +- .../viewModel/patient-ucaf-viewmodel.dart | 35 +- lib/core/viewModel/procedure_View_model.dart | 77 +- lib/core/viewModel/project_view_model.dart | 2 +- lib/core/viewModel/radiology_view_model.dart | 9 +- lib/screens/ER_singin/ER_singin_screen.dart | 18 +- lib/screens/auth/login_screen.dart | 30 +- .../auth/verification_methods_screen.dart | 48 +- .../doctor_schedule/doctor_schedule.dart | 531 ++--- lib/screens/live_care/video_call.dart | 20 +- .../medical-file/medical_file_details.dart | 151 +- .../medicine/medicine_search_screen.dart | 154 +- .../patients/DischargedPatientPage.dart | 25 +- lib/screens/patients/ECGPage.dart | 15 +- .../out_patient/out_patient_screen.dart | 29 +- .../profile/UCAF/ucaf_detail_screen.dart | 70 +- .../profile/UCAF/ucaf_input_screen.dart | 6 +- .../admission_request_first_screen.dart | 44 +- .../admission_request_second_screen.dart | 2 +- .../line_chart_for_diabetic.dart | 141 +- .../line_chart_curved_lab_history.dart | 108 +- .../laboratory_result_page.dart | 34 +- .../laboratory_result_widget.dart | 90 +- .../notes/note/progress_note_screen.dart | 37 +- .../profile/notes/note/update_note.dart | 160 +- .../update_operation_report.dart | 372 ++-- .../patient_profile_screen.dart | 52 +- .../profile_gird_for_other.dart | 16 +- .../radiology/radiology_details_page.dart | 22 +- .../radiology/radiology_home_page.dart | 23 +- .../referred_patient_detail_in-paint.dart | 78 +- .../assessment/add_assessment_details.dart | 210 +- .../assessment/update_assessment_page.dart | 36 +- .../objective/update_objective_page.dart | 44 +- .../soap_update/plan/update_plan_page.dart | 29 +- .../profile/soap_update/soap_utils.dart | 2 +- .../subjective/allergies/add_allergies.dart | 21 +- ..._key_checkbox_search_allergies_widget.dart | 40 +- .../subjective/medication/add_medication.dart | 66 +- .../medication/update_medication_widget.dart | 2 +- .../subjective/update_subjective_page.dart | 50 +- .../LineChartCurvedBloodPressure.dart | 161 +- .../profile/vital_sign/line_chart_curved.dart | 167 +- .../line_chart_curved_blood_pressure.dart | 129 +- .../vital_sign/vital_sign_details_screen.dart | 54 +- .../vital_sign_item_details_screen.dart | 21 +- .../add_drug/drug_to_drug.dart | 12 +- .../prescription_form_widget.dart | 51 +- .../prescription/old_prescriptions_page.dart | 15 +- .../prescription_checkout_screen.dart | 111 +- .../procedures/add_procedure_page.dart | 80 +- .../base_add_procedure_tab_page.dart | 39 +- .../entity_list_checkbox_search_widget.dart | 115 +- .../add_favourite_procedure.dart | 5 +- .../entity_list_fav_procedure.dart | 3 +- lib/screens/procedures/update_procedure.dart | 43 +- .../reschedule_leaves/reschedule_leave.dart | 153 +- .../translations_delegate_base_utils.dart | 1727 +++++++---------- lib/utils/utils.dart | 26 +- .../app_bar/patient-profile-app-bar.dart | 68 +- ...ent-profile-header-new-design-app-bar.dart | 38 +- lib/widgets/shared/app_scaffold_widget.dart | 52 +- lib/widgets/shared/app_texts_widget.dart | 47 +- .../shared/dialogs/dailog-list-select.dart | 26 +- .../shared/dialogs/master_key_dailog.dart | 14 +- .../dialogs/search-drugs-dailog-list.dart | 2 +- .../shared/text_fields/TextFields.dart | 76 +- .../shared/text_fields/html_rich_editor.dart | 34 +- pubspec.yaml | 97 +- 100 files changed, 3471 insertions(+), 4281 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 2475931a..8ba9b615 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -210,7 +210,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -256,10 +256,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -292,6 +294,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -342,13 +345,10 @@ "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", "${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences_ios/shared_preferences_ios.framework", + "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework", "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", - "${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework", - "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework", - "${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -383,13 +383,10 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_ios.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -501,7 +498,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -637,7 +637,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -668,7 +671,10 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 31c95209..5fc389f9 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -67,5 +67,7 @@ CADisableMinimumFrameDurationOnPhone + UIApplicationSupportsIndirectInputEvents + diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 2faae2c9..51a10e79 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -1,5 +1,3 @@ -//@dart=2.9 - import 'dart:convert'; import 'dart:io' show Platform; @@ -24,9 +22,9 @@ Utils helpers = new Utils(); 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, + {Map? body, + required Function(dynamic response, int statusCode) onSuccess, + required Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isLiveCare = false, bool isFallLanguage = false}) async { @@ -38,24 +36,24 @@ class BaseAppClient { bool callLog = true; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) { - body['DoctorID'] = doctorProfile?.doctorID; + if (body!['DoctorID'] == null) { + body['DoctorID'] = doctorProfile.doctorID; } if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; + body['ProjectID'] = doctorProfile.projectID; } - if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile.clinicID; } else { - String doctorID = await sharedPref.getString(DOCTOR_ID); - if (body['DoctorID'] == '') { + String? doctorID = await sharedPref.getString(DOCTOR_ID); + if (body!['DoctorID'] == '') { body['DoctorID'] = null; } else if (doctorID != null) body['DoctorID'] = int.parse(doctorID); } @@ -74,7 +72,7 @@ class BaseAppClient { } if (!isFallLanguage) { - String lang = await sharedPref.getString(APP_Language); + String? lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') body['LanguageID'] = 1; else @@ -167,12 +165,11 @@ class BaseAppClient { } } - postPatient(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - @required PatiantInformtion patient, + {Map? body, + required Function(dynamic response, int statusCode) onSuccess, + required Function(String error, int statusCode) onFailure, + PatiantInformtion? patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; @@ -180,19 +177,19 @@ class BaseAppClient { Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; String token = await sharedPref.getString(TOKEN); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) { - body['DoctorID'] = doctorProfile?.doctorID; + if (body!['DoctorID'] == null) { + body['DoctorID'] = doctorProfile.doctorID; } } - if (body['DoctorID'] == 0) { + if (body!['DoctorID'] == 0) { body['DoctorID'] = null; } var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); - body['SetupID'] = body.containsKey('SetupID') + body['SetupID'] = body!.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] : await sharedPref.getString(DOCTOR_SETUP_ID) @@ -223,7 +220,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; @@ -231,13 +228,13 @@ 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; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token; - body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient.patientId ?? patient.patientMRN; + body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -347,11 +344,10 @@ class BaseAppClient { } return error; } - get({String endPoint, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure}) async{ + + get({required String endPoint, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure}) async { String token = await sharedPref.getString(TOKEN); - String url = DOCTOR_ROTATION + endPoint+'&token='+token; + String url = DOCTOR_ROTATION + endPoint + '&token=' + token; final response = await http.get(Uri.parse(url)); final int statusCode = response.statusCode; @@ -359,7 +355,7 @@ class BaseAppClient { onFailure(Utils.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); - onSuccess(parsed,statusCode); + onSuccess(parsed, statusCode); } } } diff --git a/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart b/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart index b0d56669..3016d2d3 100644 --- a/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart +++ b/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart @@ -1,8 +1,8 @@ class DoctorErSignAssessmentReqModel { // String setupID; - int signInType; - int loginDoctorID; - int patientID; + int? signInType; + int? loginDoctorID; + int? patientID; DoctorErSignAssessmentReqModel( { diff --git a/lib/core/model/SOAP/assessment/post_assessment_request_model.dart b/lib/core/model/SOAP/assessment/post_assessment_request_model.dart index c71ed174..28457018 100644 --- a/lib/core/model/SOAP/assessment/post_assessment_request_model.dart +++ b/lib/core/model/SOAP/assessment/post_assessment_request_model.dart @@ -1,29 +1,23 @@ class PostAssessmentRequestModel { - int patientMRN; - int appointmentNo; - int episodeId; - String createdByName; - int createdBy; - List icdCodeDetails; + int? patientMRN; + int? appointmentNo; + int? episodeId; + String? createdByName; + int? createdBy; + List? icdCodeDetails; - PostAssessmentRequestModel( - {this.patientMRN, - this.appointmentNo, - this.episodeId, - this.createdByName, - this.createdBy, - this.icdCodeDetails}); + PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.createdByName, this.createdBy, this.icdCodeDetails}); PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; createdByName = json['CreatedByName']; - createdBy= json['CreatedBy']; + createdBy = json['CreatedBy']; if (json['icdCodeDetails'] != null) { - icdCodeDetails = new List(); + icdCodeDetails = []; json['icdCodeDetails'].forEach((v) { - icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); + icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); }); } } @@ -36,26 +30,20 @@ class PostAssessmentRequestModel { data['CreatedByName'] = this.createdByName; data['CreatedBy'] = this.createdBy; if (this.icdCodeDetails != null) { - data['icdCodeDetails'] = - this.icdCodeDetails.map((v) => v.toJson()).toList(); + data['icdCodeDetails'] = 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, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks}); IcdCodeDetails.fromJson(Map json) { icdcode10Id = json['icdcode10Id']; diff --git a/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart b/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart index 64071736..b5bc7aa3 100644 --- a/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart +++ b/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart @@ -5,19 +5,10 @@ class PostProgressNoteRequestModel { String? planNote; dynamic doctorID; dynamic editedBy; - String createdByName; - int createdBy; + String? createdByName; + int? createdBy; - PostProgressNoteRequestModel( - {this.appointmentNo, - this.episodeId, - this.patientMRN, - this.planNote, - this.doctorID, - this.editedBy, - this.createdByName, - this.createdBy - }); + PostProgressNoteRequestModel({this.appointmentNo, this.episodeId, this.patientMRN, this.planNote, this.doctorID, this.editedBy, this.createdByName, this.createdBy}); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index dc78f7af..371bb110 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,46 +1,46 @@ 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; - String diagnosis; - 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; + String? diagnosis; + 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, @@ -76,7 +76,7 @@ class AdmissionRequest { this.elementsForImprovement, this.isPackagePatient = false, this.complications = "", - this.otherDepartmentInterventions = "", + this.otherDepartmentinterventions = "", this.otherProcedures = "", this.pastMedicalHistory = "", this.pastSurgicalHistory = "", @@ -120,22 +120,22 @@ class AdmissionRequest { elementsForImprovement = json['elementsForImprovement']; isPackagePatient = json['isPackagePatient']; complications = json['complications']; - otherDepartmentInterventions = json['otherDepartmentInterventions']; + otherDepartmentinterventions = json['otherDepartmentInterventions']; otherProcedures = json['otherProcedures']; 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)); }); @@ -180,7 +180,7 @@ class AdmissionRequest { data['elementsForImprovement'] = this.elementsForImprovement; data['isPackagePatient'] = this.isPackagePatient; data['complications'] = this.complications; - data['otherDepartmentInterventions'] = this.otherDepartmentInterventions; + data['otherDepartmentInterventions'] = this.otherDepartmentinterventions; data['otherProcedures'] = this.otherProcedures; data['pastMedicalHistory'] = this.pastMedicalHistory; data['pastSurgicalHistory'] = this.pastSurgicalHistory; @@ -189,7 +189,7 @@ class AdmissionRequest { // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); } if (this.admissionRequestProcedures != null) { - data['admissionRequestProcedures'] = this.admissionRequestProcedures.map((v) => v.toJson()).toList(); + data['admissionRequestProcedures'] = this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; 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 1bb10d1f..fa3a18b4 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,79 +1,62 @@ import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { - String authenticationTokenID; - List listDoctorsClinic; - List listDoctorProfile; - MemberInformation memberInformation; - String vidaAuthTokenID; - String vidaRefreshTokenID; - - CheckActivationCodeForDoctorAppResponseModel( - {this.authenticationTokenID, - this.listDoctorsClinic, - this.memberInformation, - this.listDoctorProfile, - this.vidaAuthTokenID, - this.vidaRefreshTokenID}); - - CheckActivationCodeForDoctorAppResponseModel.fromJson( - Map json) { + String? authenticationTokenID; + List? listDoctorsClinic; + List? listDoctorProfile; + MemberInformation? memberInformation; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + + CheckActivationCodeForDoctorAppResponseModel({this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation, this.listDoctorProfile, this.vidaAuthTokenID, this.vidaRefreshTokenID}); + + CheckActivationCodeForDoctorAppResponseModel.fromJson(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)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; - memberInformation = json['memberInformation'] != null - ? new MemberInformation.fromJson(json['memberInformation']) - : null; + memberInformation = json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null; } Map toJson() { final Map data = new Map(); data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { - data['List_DoctorsClinic'] = - this.listDoctorsClinic.map((v) => v.toJson()).toList(); + data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { - data['List_DoctorProfile'] = - this.listDoctorProfile.map((v) => v.toJson()).toList(); + data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { - data['memberInformation'] = this.memberInformation.toJson(); + data['memberInformation'] = this.memberInformation!.toJson(); } return data; } } class ListDoctorsClinic { - String setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; - - ListDoctorsClinic( - {this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + String? setupID; + int? projectID; + int? doctorID; + int? clinicID; + bool? isActive; + String? clinicName; + + ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ListDoctorsClinic.fromJson(Map json) { setupID = json['SetupID']; @@ -97,32 +80,23 @@ class ListDoctorsClinic { } class MemberInformation { - List clinics; - int doctorId; - String email; - int employeeId; - int memberId; - Null memberName; - Null memberNameArabic; - String preferredLanguage; - List roles; - - MemberInformation( - {this.clinics, - this.doctorId, - this.email, - this.employeeId, - this.memberId, - this.memberName, - this.memberNameArabic, - this.preferredLanguage, - this.roles}); + List? clinics; + int? doctorId; + String? email; + int? employeeId; + int? memberId; + dynamic memberName; + dynamic memberNameArabic; + String? preferredLanguage; + List? roles; + + MemberInformation({this.clinics, this.doctorId, this.email, this.employeeId, this.memberId, this.memberName, this.memberNameArabic, this.preferredLanguage, this.roles}); 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']; @@ -133,9 +107,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)); }); } } @@ -143,7 +117,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; @@ -153,16 +127,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}); @@ -182,8 +156,8 @@ class Clinics { } class Roles { - String name; - int roleId; + String? name; + int? roleId; Roles({this.name, this.roleId}); diff --git a/lib/core/model/dashboard/doctor_schedule.dart b/lib/core/model/dashboard/doctor_schedule.dart index ab8cf192..22bf324b 100644 --- a/lib/core/model/dashboard/doctor_schedule.dart +++ b/lib/core/model/dashboard/doctor_schedule.dart @@ -1,14 +1,15 @@ import 'dart:convert'; + List doctorScheduleFromJson(String str) => List.from(json.decode(str).map((x) => DoctorSchedule.fromJson(x))); String doctorScheduleToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); class DoctorSchedule { - int scheduledid; - int status; - String clinicname; - int clinicid; - List scheduleforuser; + int? scheduledid; + int? status; + String? clinicname; + int? clinicid; + List? scheduleforuser; DoctorSchedule({ this.scheduledid, @@ -19,26 +20,26 @@ class DoctorSchedule { }); factory DoctorSchedule.fromJson(Map json) => DoctorSchedule( - scheduledid: json["scheduledid"], - status: json["status"], - clinicname: json["clinicname"], - clinicid: json["clinicid"], - scheduleforuser: List.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))), - ); + scheduledid: json["scheduledid"], + status: json["status"], + clinicname: json["clinicname"], + clinicid: json["clinicid"], + scheduleforuser: List.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))), + ); Map toJson() => { - "scheduledid": scheduledid, - "status": status, - "clinicname": clinicname, - "clinicid": clinicid, - "scheduleforuser": List.from(scheduleforuser.map((x) => x.toJson())), - }; + "scheduledid": scheduledid, + "status": status, + "clinicname": clinicname, + "clinicid": clinicid, + "scheduleforuser": List.from(scheduleforuser!.map((x) => x.toJson())), + }; } class Scheduleforuser { - DateTime days; - int duration; - List shiftforuser; + DateTime? days; + int? duration; + List? shiftforuser; Scheduleforuser({ this.days, @@ -47,21 +48,21 @@ class Scheduleforuser { }); factory Scheduleforuser.fromJson(Map json) => Scheduleforuser( - days: DateTime.parse(json["days"]), - duration: json["duration"], - shiftforuser: List.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))), - ); + days: DateTime.parse(json["days"]), + duration: json["duration"], + shiftforuser: List.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))), + ); Map toJson() => { - "days": days.toIso8601String(), - "duration": duration, - "shiftforuser": List.from(shiftforuser.map((x) => x.toJson())), - }; + "days": days!.toIso8601String(), + "duration": duration, + "shiftforuser": List.from(shiftforuser!.map((x) => x.toJson())), + }; } class Shiftforuser { - int fromtime; - int totime; + int? fromtime; + int? totime; Shiftforuser({ this.fromtime, @@ -69,12 +70,12 @@ class Shiftforuser { }); factory Shiftforuser.fromJson(Map json) => Shiftforuser( - fromtime: json["fromtime"], - totime: json["totime"], - ); + fromtime: json["fromtime"], + totime: json["totime"], + ); Map toJson() => { - "fromtime": fromtime, - "totime": totime, - }; + "fromtime": fromtime, + "totime": totime, + }; } diff --git a/lib/core/model/doctor/clinic_model.dart b/lib/core/model/doctor/clinic_model.dart index 4ea7636c..319a925d 100644 --- a/lib/core/model/doctor/clinic_model.dart +++ b/lib/core/model/doctor/clinic_model.dart @@ -1,25 +1,12 @@ -/* - *@author: Elham Rababah - *@Date:17/5/2020 - *@param: - *@return: - *@desc: Clinic Model - */ class ClinicModel { - String setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; + String? setupID; + int? projectID; + int? doctorID; + int? clinicID; + bool? isActive; + String? clinicName; - ClinicModel( - {this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ClinicModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/core/model/hospitals/VidaPlusProjectListModel.dart b/lib/core/model/hospitals/VidaPlusProjectListModel.dart index e56b82db..75978110 100644 --- a/lib/core/model/hospitals/VidaPlusProjectListModel.dart +++ b/lib/core/model/hospitals/VidaPlusProjectListModel.dart @@ -1,5 +1,5 @@ class VidaPlusProjectListModel { - int projectID; + int? projectID; VidaPlusProjectListModel({this.projectID}); diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 03485aa2..fb78cb51 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -1,27 +1,27 @@ class GetHospitalsRequestModel { - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - String memberID; - String doctorID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + String? memberID; + String? doctorID; - GetHospitalsRequestModel( - {this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.memberID, - this.doctorID, - }); + GetHospitalsRequestModel({ + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.memberID, + this.doctorID, + }); GetHospitalsRequestModel.fromJson(Map json) { languageID = json['LanguageID']; diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index d4d621b0..16f1ebd7 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -1,42 +1,42 @@ import 'package:doctor_app_flutter/utils/date-utils.dart'; class PatientLabOrders { - int actualDoctorRate; - String clinicDescription; - String clinicDescriptionEnglish; - Null clinicDescriptionN; - 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; - DateTime createdOn; - String orderNo; - String patientID; - String projectID; - String projectName; - Null projectNameN; - String qR; - String setupID; - List speciality; - bool isLiveCareAppointment; - String invoiceType; + int? actualDoctorRate; + String? clinicDescription; + String? clinicDescriptionEnglish; + dynamic clinicDescriptionN; + int? clinicID; + int? doctorID; + String? doctorImageURL; + String? doctorName; + String? doctorNameEnglish; + dynamic 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; + DateTime? createdOn; + String? orderNo; + String? patientID; + String? projectID; + String? projectName; + dynamic projectNameN; + String? qR; + String? setupID; + List? speciality; + bool? isLiveCareAppointment; + String? invoiceType; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -72,8 +72,7 @@ class PatientLabOrders { this.setupID, this.speciality, this.isLiveCareAppointment, - this.invoiceType - }); + this.invoiceType}); PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; @@ -157,10 +156,9 @@ class PatientLabOrders { class PatientLabOrdersList { String filterName = ""; - List patientLabOrdersList = List(); + List patientLabOrdersList = []; - PatientLabOrdersList( - {this.filterName, PatientLabOrders patientDoctorAppointment}) { + PatientLabOrdersList({required this.filterName, required PatientLabOrders patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/patient/get_doctor_by_clinic_id_request.dart b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart index 2dff34a5..3853ad7a 100644 --- a/lib/core/model/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/core/model/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 doctorID; - 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? doctorID; + int? gender; + bool? isGetNearAppointment; + bool? isVoiceCommand; + int? latitude; + int? longitude; + bool? license; + bool? isDentalAllowedBackend; DoctorsByClinicIdRequest({ this.clinicID, diff --git a/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart index 25104d07..708fa77f 100644 --- a/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/core/model/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; - num 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; + dynamic respirationBeatPerMinute; + int? respirationPattern; + int? sao2; + int? status; var temperatureCelcius; - int temperatureCelciusMethod; + int? temperatureCelciusMethod; var waistSizeInch; var weightKg; diff --git a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart index e753ad62..cec79b1d 100644 --- a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart +++ b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart @@ -1,21 +1,21 @@ class InterventionMedicationHistoryResModel { - String setupId; - String projectId; - int patientId; - int admissionNo; - int prescriptionId; - int orderNo; - int id; - int interventionId; + String? setupId; + String? projectId; + int? patientId; + int? admissionNo; + int? prescriptionId; + int? orderNo; + int? id; + int? interventionId; dynamic intervention; - String remark; - int commentedBy; - bool isDoctor; - bool isActive; - int createdBy; - String createdByName; - String createdByNameN; - String createdOn; + String? remark; + int? commentedBy; + bool? isDoctor; + bool? isActive; + int? createdBy; + String? createdByName; + String? createdByNameN; + String? createdOn; dynamic editedBy; dynamic editedByName; dynamic editedByNameN; @@ -23,26 +23,26 @@ class InterventionMedicationHistoryResModel { InterventionMedicationHistoryResModel( {this.setupId, - this.projectId, - this.patientId, - this.admissionNo, - this.prescriptionId, - this.orderNo, - this.id, - this.interventionId, - this.intervention, - this.remark, - this.commentedBy, - this.isDoctor, - this.isActive, - this.createdBy, - this.createdByName, - this.createdByNameN, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedByNameN, - this.editedOn}); + this.projectId, + this.patientId, + this.admissionNo, + this.prescriptionId, + this.orderNo, + this.id, + this.interventionId, + this.intervention, + this.remark, + this.commentedBy, + this.isDoctor, + this.isActive, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn}); InterventionMedicationHistoryResModel.fromJson(Map json) { setupId = json['SetupId']; @@ -93,4 +93,4 @@ class InterventionMedicationHistoryResModel { data['EditedOn'] = this.editedOn; return data; } -} \ No newline at end of file +} diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index f5fae7c6..7149ff2f 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -9,17 +9,17 @@ class FinalRadiology { dynamic invoiceNo_VP; 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; @@ -29,8 +29,8 @@ class FinalRadiology { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool isActiveDoctorProfile; - bool isExecludeDoctor; + bool? isActiveDoctorProfile; + bool? isExecludeDoctor; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; dynamic nationalityFlagURL; @@ -40,12 +40,13 @@ class FinalRadiology { dynamic qR; dynamic reportDataHTML; dynamic reportDataTextdynamic; - List speciality; - bool isCVI; - bool isRadMedicalReport; - bool isLiveCareAppodynamicment; - bool isRecordFromVidaPlus; - String invoiceType; + List? speciality; + bool? isCVI; + bool? isRadMedicalReport; + bool? isLiveCareAppodynamicment; + bool? isRecordFromVidaPlus; + String? invoiceType; + FinalRadiology( {this.setupID, this.projectID, @@ -89,7 +90,9 @@ class FinalRadiology { this.speciality, this.isCVI, this.isRadMedicalReport, - this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus, this.invoiceType}); + this.isLiveCareAppodynamicment, + this.isRecordFromVidaPlus, + this.invoiceType}); FinalRadiology.fromJson(Map json) { try { @@ -187,16 +190,16 @@ class FinalRadiology { data['isCVI'] = this.isCVI; data['isRadMedicalReport'] = this.isRadMedicalReport; data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus; - data["InvoiceType"] =invoiceType; + data["InvoiceType"] = invoiceType; return data; } } class FinalRadiologyList { dynamic filterName = ""; - List finalRadiologyList = List(); + List finalRadiologyList = []; - FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + FinalRadiologyList({this.filterName, required FinalRadiology finalRadiology}) { finalRadiologyList.add(finalRadiology); } } diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index b2290299..9ff219bc 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -1,6 +1,4 @@ import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_analytics/observer.dart'; -import 'package:flutter/cupertino.dart'; class AnalyticsService { // final FirebaseAnalytics _analytics = FirebaseAnalytics(); @@ -8,7 +6,7 @@ class AnalyticsService { static FirebaseAnalytics analytics = FirebaseAnalytics.instance; FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: analytics); - Future logEvent({@required String eventCategory, @required String eventAction}) async { + Future logEvent({required String eventCategory, required String eventAction}) async { await analytics.logEvent(name: 'event', parameters: { "eventCategory": eventCategory, "eventAction": eventAction, diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 0aa770ca..666b5ce1 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/video_channel_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -17,40 +17,29 @@ import '../../routes.dart'; import 'NavigationService.dart'; class VideoCallService extends BaseService { - StartCallRes startCallRes; - PatiantInformtion patient; - LiveCarePatientServices _liveCarePatientServices = - locator(); + late StartCallRes startCallRes; + late PatiantInformtion patient; + LiveCarePatientServices _liveCarePatientServices = locator(); - openVideo( - StartCallRes startModel, - PatiantInformtion patientModel, - bool isRecording, - VoidCallback onCallConnected, - VoidCallback onCallDisconnected) async { + openVideo(StartCallRes startModel, PatiantInformtion patientModel, bool isRecording, VoidCallback onCallConnected, VoidCallback onCallDisconnected) async { this.startCallRes = startModel; this.patient = patientModel; - DoctorProfileModel doctorProfile = - await getDoctorProfile(isGetProfile: true); + DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( // TODO MOSA TEST kApiKey: '46209962', - kToken: startCallRes.openTokenID, kSessionId: startCallRes.openSessionID, // // kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", // kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4", - vcId: patient.vcId, + vcId: patient.vcId!, isRecording: isRecording, - patientName: patient.fullName ?? - (patient.firstName != null - ? "${patient.firstName} ${patient.lastName}" - : "-"), + patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), generalId: GENERAL_ID, - doctorId: doctorProfile.doctorID, + doctorId: doctorProfile.doctorID!, onFailure: (String error) { DrAppToastMsg.showErrorToast(error); }, @@ -58,19 +47,16 @@ class VideoCallService extends BaseService { onCallDisconnected: onCallDisconnected, onCallEnd: () { WidgetsBinding.instance.addPostFrameCallback((_) async { - GifLoaderDialogUtils.showMyDialog( - locator().navigatorKey.currentContext); + GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!); endCall( - patient.vcId, + patient.vcId!, false, ).then((value) { - GifLoaderDialogUtils.hideDialog( - locator().navigatorKey.currentContext); + GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); } else - locator() - .navigateTo(PATIENTS_END_Call, arguments: { + locator().navigateTo(PATIENTS_END_Call, arguments: { "patient": patient, }); }); @@ -78,19 +64,16 @@ class VideoCallService extends BaseService { }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog( - locator().navigatorKey.currentContext); + GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!); endCall( - patient.vcId, + patient.vcId!, sessionStatusModel.sessionStatus == 3, ).then((value) { - GifLoaderDialogUtils.hideDialog( - locator().navigatorKey.currentContext); + GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); } else { - locator() - .navigateTo(PATIENTS_END_Call, arguments: { + locator().navigateTo(PATIENTS_END_Call, arguments: { "patient": patient, }); } @@ -103,7 +86,7 @@ class VideoCallService extends BaseService { hasError = false; await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile.doctorID; + endCallReq.doctorId = doctorProfile!.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index b25dbcc6..9538c3d9 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -48,7 +48,7 @@ class AuthenticationService extends BaseService { }, body: {"IMEI": imei}); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -64,7 +64,7 @@ class AuthenticationService extends BaseService { }, body: userInfo.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -80,7 +80,7 @@ class AuthenticationService extends BaseService { }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -96,7 +96,7 @@ class AuthenticationService extends BaseService { }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -112,7 +112,7 @@ class AuthenticationService extends BaseService { }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -128,7 +128,7 @@ class AuthenticationService extends BaseService { }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error.toString(); } } @@ -146,7 +146,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/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index 09e5a365..c3bac631 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -5,8 +5,8 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { - List hospitals = List(); - List vidaPlusProjectListModel = List(); + List hospitals = []; + List vidaPlusProjectListModel = []; Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; diff --git a/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart b/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart index 4d953350..1294d44f 100644 --- a/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart +++ b/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart @@ -1,46 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; -import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; -import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:flutter/cupertino.dart'; class ERSignInService extends LookupService { - - - Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async { + Future signInERPatient({required DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async { hasError = false; - await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { + await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: doctorErSignAssessmentReqModel.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 0e0e99c0..cd113840 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 @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart'; -import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart'; +import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_result.dart'; @@ -13,22 +13,20 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; class LabsService extends BaseService { - List patientLabOrdersList = List(); - List _allSpecialLab = List(); + List patientLabOrdersList = []; + List _allSpecialLab = []; List get allSpecialLab => _allSpecialLab; - AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = - AllSpecialLabResultRequestModel(); + AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(); - Future getPatientLabOrdersList( - PatiantInformtion patient, bool isInpatient) async { + Future getPatientLabOrdersList(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; @@ -36,8 +34,7 @@ class LabsService extends BaseService { } patientLabOrdersList = []; patientLabOrdersList.clear(); - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabOrdersList = []; if (!isInpatient) { response['ListPLO'].forEach((hospital) { @@ -55,21 +52,14 @@ class LabsService extends BaseService { }, body: body); } - RequestPatientLabSpecialResult _requestPatientLabSpecialResult = - RequestPatientLabSpecialResult(); - - List patientLabSpecialResult = List(); - List labResultList = List(); - List labOrdersResultsList = List(); - List labOrdersResultHistoryList = List(); - - Future getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, - bool isInpatient = false}) async { + RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); + + List patientLabSpecialResult = []; + List labResultList = []; + List labOrdersResultsList = []; + List labOrdersResultHistoryList = []; + + Future getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, required PatiantInformtion patient, bool isInpatient = false}) async { hasError = false; Map body = Map(); @@ -79,8 +69,7 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.orderNo = orderNo; body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); response['ListPLSR'].forEach((hospital) { @@ -92,10 +81,7 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabResult( - {PatientLabOrders patientLabOrder, - PatiantInformtion patient, - bool isInpatient}) async { + Future getPatientLabResult({required PatientLabOrders patientLabOrder, required PatiantInformtion patient, bool isInpatient = false}) async { hasError = false; String url = ""; @@ -112,9 +98,8 @@ class LabsService extends BaseService { body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; - body['InvoiceType'] = patientLabOrder.invoiceType ??""; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + body['InvoiceType'] = patientLabOrder.invoiceType ?? ""; + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult = []; labResultList = []; @@ -123,8 +108,7 @@ class LabsService extends BaseService { labResultList.add(LabResult.fromJson(hospital)); }); response['List_GetLabSpecial'].forEach((hospital) { - patientLabSpecialResult - .add(PatientLabSpecialResult.fromJson(hospital)); + patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); }); } else { response['ListPLR'].forEach((lab) { @@ -137,10 +121,7 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + Future getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, required String procedure, required PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -152,8 +133,7 @@ class LabsService extends BaseService { } body['isDentalAllowedBackend'] = false; body['Procedure'] = procedure; - await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); @@ -164,10 +144,9 @@ class LabsService extends BaseService { }, body: body); } - RequestSendLabReportEmail _requestSendLabReportEmail = - RequestSendLabReportEmail(); + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { + Future sendLabReportEmail({required PatientLabOrders patientLabOrder}) async { // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; @@ -191,10 +170,7 @@ class LabsService extends BaseService { // }, body: _requestSendLabReportEmail.toJson()); } - Future getPatientLabOrdersResultHistoryByDescription( - {PatientLabOrders patientLabOrder, - String procedureDescription, - PatiantInformtion patient}) async { + Future getPatientLabOrdersResultHistoryByDescription({PatientLabOrders? patientLabOrder, String? procedureDescription, required PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -204,9 +180,7 @@ class LabsService extends BaseService { } body['isDentalAllowedBackend'] = false; body['ProcedureDescription'] = procedureDescription; - await baseAppClient.postPatient( - GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultHistoryList.clear(); response['ListGeneralResultHistory'].forEach((lab) { labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); @@ -217,7 +191,7 @@ class LabsService extends BaseService { }, body: body); } - Future getAllSpecialLabResult({int mrn}) async { + Future getAllSpecialLabResult({required int mrn}) async { _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( patientID: mrn, patientType: 1, @@ -225,12 +199,10 @@ class LabsService extends BaseService { ); hasError = false; _allSpecialLab.clear(); - await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, onSuccess: (dynamic response, int statusCode) { response['ListPLSRALL'].forEach((lab) { var labs = AllSpecialLabResultModel.fromJson(lab); - if (labs.invoiceNo != "0") - _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab)); + if (labs.invoiceNo != "0") _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab)); }); }, onFailure: (String error, int statusCode) { hasError = true; 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 1dca2462..bca644dc 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -1,16 +1,15 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class RadiologyService extends BaseService { - List finalRadiologyList = List(); + List finalRadiologyList = []; String url = ''; bool isRadiologyVIDAPlus = false; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient,String invoiceType}) async { + Future getRadImageURL({required invoiceNo, required int lineItem, required int projectId, bool isVidaPlus = false, required PatiantInformtion patient, String? invoiceType}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index 8f148f21..6572f24c 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -1,33 +1,29 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_model.dart'; import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_request_model.dart'; import 'package:doctor_app_flutter/core/model/pending_orders/pending_order_request_model.dart'; import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PendingOrderService extends BaseService { - List _pendingOrderList = List(); + List _pendingOrderList = []; List get pendingOrderList => _pendingOrderList; - List _admissionOrderList = List(); + List _admissionOrderList = []; List get admissionOrderList => _admissionOrderList; - Future getPendingOrders( - {PendingOrderRequestModel pendingOrderRequestModel, - int patientId, - int admissionNo}) async { + Future getPendingOrders({PendingOrderRequestModel? pendingOrderRequestModel, int? patientId, int? admissionNo}) async { pendingOrderRequestModel = PendingOrderRequestModel( - patientID: patientId, - admissionNo: admissionNo, - patientTypeID: 1, - patientType: 1, - ); + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + ); hasError = false; - await baseAppClient.post(GET_PENDING_ORDERS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PENDING_ORDERS, onSuccess: (dynamic response, int statusCode) { print("Success"); _pendingOrderList.clear(); response['List_PendingOrders'].forEach( @@ -41,20 +37,16 @@ class PendingOrderService extends BaseService { }, body: pendingOrderRequestModel.toJson()); } - Future getAdmissionOrders( - {AdmissionOrdersRequestModel admissionOrdersRequestModel, - int patientId, - int admissionNo}) async { + Future getAdmissionOrders({AdmissionOrdersRequestModel? admissionOrdersRequestModel, int? patientId, int? admissionNo}) async { admissionOrdersRequestModel = AdmissionOrdersRequestModel( - patientID: patientId, - admissionNo: admissionNo, - patientTypeID: 1, - patientType: 1, - ); + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + ); hasError = false; - await baseAppClient.post(GET_ADMISSION_ORDERS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ADMISSION_ORDERS, onSuccess: (dynamic response, int statusCode) { print("Success"); //admissionOrderList.clear(); response['List_AdmissionOrders'].forEach( diff --git a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart index f1e9104f..097dfd62 100644 --- a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart +++ b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart @@ -1,33 +1,18 @@ -import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:flutter/cupertino.dart'; class ERSignInViewModel extends BaseViewModel { bool hasError = false; ERSignInService _ERSignInService = locator(); - Future signInERPatient({int patientId, int signInType}) async { + Future signInERPatient({required int patientId, required int signInType}) async { hasError = false; await getDoctorProfile(); - DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile.doctorID, patientID: patientId); + DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile!.doctorID, patientID: patientId); setState(ViewState.BusyLocal); await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel); if (_ERSignInService.hasError) { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 866321fe..a23752dd 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1,40 +1,39 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Allergy/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart'; import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_res_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/get_episode_for_inpatient_req_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_list_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/in_patient/get_episode_for_inpatient_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Allergy/post_allergy_request_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; -import 'package:flutter/material.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -79,7 +78,7 @@ class SOAPViewModel extends BaseViewModel { List get patientAssessmentList => _SOAPService.patientAssessmentList; - int get episodeID => _SOAPService.episodeID; + int get episodeID => _SOAPService.episodeID!; bool isAddProgress = true; bool isAddExamInProgress = true; @@ -98,7 +97,7 @@ class SOAPViewModel extends BaseViewModel { List get allMedicationList => _prescriptionService.allMedicationList; - SubjectiveCallBack subjectiveCallBack; + late SubjectiveCallBack subjectiveCallBack; setSubjectiveCallBack(SubjectiveCallBack callBack) { this.subjectiveCallBack = callBack; @@ -108,7 +107,7 @@ class SOAPViewModel extends BaseViewModel { subjectiveCallBack.nextFunction(model); } - ObjectiveCallBack objectiveCallBack; + late ObjectiveCallBack objectiveCallBack; setObjectiveCallBack(ObjectiveCallBack callBack) { this.objectiveCallBack = callBack; @@ -118,7 +117,7 @@ class SOAPViewModel extends BaseViewModel { objectiveCallBack.nextFunction(model); } - AssessmentCallBack assessmentCallBack; + late AssessmentCallBack assessmentCallBack; setAssessmentCallBack(AssessmentCallBack callBack) { this.assessmentCallBack = callBack; @@ -128,7 +127,7 @@ class SOAPViewModel extends BaseViewModel { assessmentCallBack.nextFunction(model); } - PlanCallBack planCallBack; + late PlanCallBack planCallBack; setPlanCallBack(PlanCallBack callBack) { this.planCallBack = callBack; @@ -250,8 +249,8 @@ class SOAPViewModel extends BaseViewModel { String getAllergicNames(isArabic) { String allergiesString = ''; patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - if (selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + ' , '; + MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!)!; + if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ')!; }); return allergiesString; } @@ -268,8 +267,8 @@ class SOAPViewModel extends BaseViewModel { patientInfo.appointmentNo.toString(), ), ); - if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) - getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); + if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty) + getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!); else getPhysicalExamReqModel.admissionNo = 0; setState(ViewState.Busy); @@ -303,7 +302,7 @@ class SOAPViewModel extends BaseViewModel { Future getEpisodeForInpatient(PatiantInformtion patient) async { setState(ViewState.BusyLocal); - GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo), patientTypeID: 1); + GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo!), patientTypeID: 1); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; @@ -315,7 +314,7 @@ class SOAPViewModel extends BaseViewModel { } // ignore: missing_return - MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) { + MasterKeyModel? getOneMasterKey({required MasterKeysService masterKeys, dynamic id, int? typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { @@ -406,7 +405,28 @@ class SOAPViewModel extends BaseViewModel { return result.first; } break; - break; + case MasterKeysService.physiotherapyGoals: + return MasterKeyModel(); + case MasterKeysService.TemperatureMethods: + return MasterKeyModel(); + case MasterKeysService.Speciality: + return MasterKeyModel(); + case MasterKeysService.MedicationStrength: + return MasterKeyModel(); + case MasterKeysService.MedicationDuration: + return MasterKeyModel(); + case MasterKeysService.MedicationRoute: + return MasterKeyModel(); + case MasterKeysService.MedicationFrequency: + return MasterKeyModel(); + case MasterKeysService.MedicationDoseTime: + return MasterKeyModel(); + case MasterKeysService.MedicationIndications: + return MasterKeyModel(); + case MasterKeysService.AdmissionRequestType: + return MasterKeyModel(); + case MasterKeysService.DiagnosisSelectionType: + return MasterKeyModel(); } } @@ -421,7 +441,7 @@ class SOAPViewModel extends BaseViewModel { onUpdateSubjectStepStart(PatiantInformtion patientInfo) async { GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( - admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, + admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo!) : null, patientMRN: patientInfo.patientMRN, appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null, episodeId: patientInfo.episodeNo, @@ -541,7 +561,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError || _prescriptionService.hasError) { - error = _SOAPService.error + _prescriptionService.error; + error = _SOAPService.error! + _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -601,11 +621,11 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List myHistoryList, List myAllergiesList}) async { + postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List? myHistoryList, List? myAllergiesList}) async { var services; PostChiefComplaintRequestModel postChiefComplaintRequestModel = - createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText); + createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!); if (patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)]; @@ -614,7 +634,7 @@ class SOAPViewModel extends BaseViewModel { services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)]; } - if (myHistoryList.length != 0) { + if (myHistoryList!.length != 0) { PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList); if (patientHistoryList.isEmpty) { @@ -624,7 +644,7 @@ class SOAPViewModel extends BaseViewModel { } } - if (myAllergiesList.length != 0) { + if (myAllergiesList!.length != 0) { PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo); if (patientAllergiesList.isEmpty) { services.add(_SOAPService.postAllergy(postAllergyRequestModel)); @@ -642,7 +662,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) { + PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) { return new PostChiefComplaintRequestModel( admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, patientMRN: patientInfo.patientMRN, @@ -657,17 +677,17 @@ class SOAPViewModel extends BaseViewModel { numberOfWeeks: 0); } - PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List myHistoryList}) { + PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List? myHistoryList}) { PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); - myHistoryList.forEach((history) { + myHistoryList!.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: patientInfo.appointmentNo, remarks: "", - historyId: history.selectedHistory.id, - historyType: history.selectedHistory.typeId, + historyId: history.selectedHistory!.id, + historyType: history.selectedHistory!.typeId, isChecked: history.isChecked, )); }); @@ -679,7 +699,7 @@ class SOAPViewModel extends BaseViewModel { PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); myAllergiesList.forEach((allergy) { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, patientMRN: patientInfo.patientMRN, @@ -687,9 +707,9 @@ class SOAPViewModel extends BaseViewModel { appointmentNo: patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdBy: allergy.createdBy ?? doctorProfile!.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, + editedBy: doctorProfile!.doctorID, editedOn: DateTime.now().toIso8601String(), isChecked: allergy.isChecked, isUpdatedByNurse: false)); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index aec315c8..a0674f0f 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -27,11 +27,10 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/services.dart'; -import 'package:local_auth/auth_strings.dart'; - // import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; // import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; +import 'package:local_auth_ios/local_auth_ios.dart'; enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED } @@ -55,12 +54,12 @@ class AuthenticationViewModel extends BaseViewModel { List get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel; - NewLoginInformationModel loggedUser; - GetIMEIDetailsModel user; + NewLoginInformationModel loggedUser = NewLoginInformationModel(); + GetIMEIDetailsModel user = GetIMEIDetailsModel(); UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); - List _availableBiometrics; + List _availableBiometrics = []; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; bool isLogin = false; @@ -88,7 +87,7 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; @@ -96,12 +95,12 @@ class AuthenticationViewModel extends BaseViewModel { insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); - insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; - insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; + insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID; + insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; - insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()); + insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser!.listMemberInformation![0].employeeID : int.parse(user!.editedBy.toString()); await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { @@ -119,11 +118,11 @@ class AuthenticationViewModel extends BaseViewModel { 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); } } @@ -132,17 +131,17 @@ class AuthenticationViewModel extends BaseViewModel { Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( - iMEI: user.iMEI, - facilityId: user.projectID, - memberID: user.doctorID, - loginDoctorID: int.parse(user.editedBy.toString()), - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, + iMEI: user!.iMEI, + facilityId: user!.projectID, + memberID: user!.doctorID, + loginDoctorID: int.parse(user!.editedBy.toString()), + zipCode: user!.outSA == true ? '971' : '966', + mobileNumber: user!.mobile, oTPSendType: authMethodType.getTypeIdService(), isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); - await sharedPref.setString(DOCTOR_ID, user.editedBy.toString()); + vidaAuthTokenID: user!.vidaAuthTokenID, + vidaRefreshTokenID: user!.vidaRefreshTokenID); + await sharedPref.setString(DOCTOR_ID, user!.editedBy.toString()); await _authService.sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { @@ -153,28 +152,28 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async { + Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser.listMemberInformation[0].memberID, - loginDoctorID: loggedUser.listMemberInformation[0].employeeID, + memberID: loggedUser.listMemberInformation![0].memberID, + loginDoctorID: loggedUser.listMemberInformation![0].employeeID, otpSendType: authMethodType.getTypeIdService().toString(), ); - await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation[0].employeeID).toString()); + await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation![0].employeeID).toString()); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); + await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!); setState(ViewState.Idle); } } /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp({String? activationCode, bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( @@ -183,12 +182,12 @@ class AuthenticationViewModel extends BaseViewModel { projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID, logInTokenID: await sharedPref.getString(TOKEN), activationCode: activationCode ?? '0000', - memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID, + memberID: userInfo.userID != null ? int.parse(userInfo.userID!) : user.doctorID, password: userInfo.password, facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(), oTPSendType: await sharedPref.getInt(OTP_TYPE), iMEI: localToken, - loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()), + loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation![0].employeeID : int.parse(user.editedBy.toString()), ///loggedUser.listMemberInformation[0].employeeID, // loggedUser.listMemberInformation[0].employeeID, @@ -242,10 +241,10 @@ class AuthenticationViewModel extends BaseViewModel { setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); await sharedPref.setString( - DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); - await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); + DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic![0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic![0].setupID! : ""); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); + await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!); } saveObjToString(String key, value) async { @@ -254,10 +253,16 @@ class AuthenticationViewModel extends BaseViewModel { /// ask user to add his biometric showIOSAuthMessages() async { - const iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID'); - + const iosStrings = IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID'); try { - await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings); + await auth.authenticate( + localizedReason: 'Scan your fingerprint to authenticate', + authMessages: [iosStrings], + options: AuthenticationOptions( + useErrorDialogs: true, + stickyAuth: true, + ), + ); } on PlatformException catch (e) { DrAppToastMsg.showErrorToast(e.toString()); } @@ -285,12 +290,12 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { - sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); - if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { - localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); + sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); + if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { + localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); } else { sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); - ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); + ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } @@ -350,8 +355,8 @@ class AuthenticationViewModel extends BaseViewModel { if (_authService.dashboardItemsList.length > 0) { user = _authService.dashboardItemsList[0]; sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID!); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID!); this.unverified = true; } setState(ViewState.Idle); @@ -405,7 +410,7 @@ class AuthenticationViewModel extends BaseViewModel { } deleteUser() { - user = null; + user = GetIMEIDetailsModel(); unverified = false; isLogin = false; } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 76e4efcd..bfee098b 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,12 +1,11 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; -import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import '../../locator.dart'; @@ -16,23 +15,20 @@ import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); - SpecialClinicsService _specialClinicsService = - locator(); + SpecialClinicsService _specialClinicsService = locator(); DoctorReplyService _doctorReplyService = locator(); - List get dashboardItemsList => - _dashboardService.dashboardItemsList; + List get dashboardItemsList => _dashboardService.dashboardItemsList; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; - String get sServiceID => _dashboardService.sServiceID; + String? get sServiceID => _dashboardService.sServiceID; int get notRepliedCount => _doctorReplyService.notRepliedCount; - List get specialClinicalCareList => - _specialClinicsService.specialClinicalCareList; - Future startHomeScreenServices(ProjectViewModel projectsProvider, - AuthenticationViewModel authProvider) async { + List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; + + Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { setState(ViewState.Busy); await getDoctorProfile(isGetProfile: true); @@ -53,14 +49,13 @@ class DashboardViewModel extends BaseViewModel { } Future setFirebaseNotification(AuthenticationViewModel authProvider) async { - _firebaseMessaging.requestPermission( - sound: true, badge: true, alert: true, provisional: true); + _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); - _firebaseMessaging.getToken().then((String token) async { + _firebaseMessaging.getToken().then((String? token) async { if (token != '') { // DEVICE_TOKEN = token; ///TODO Elham* return it back - authProvider.insertDeviceImei(token); + authProvider.insertDeviceImei(token); } }); } @@ -85,14 +80,13 @@ class DashboardViewModel extends BaseViewModel { // setState(ViewState.Idle); } - Future changeClinic( - int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID, clinicID: clinicId, - projectID: doctorProfile.projectID, + projectID: doctorProfile!.projectID, ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { @@ -102,13 +96,13 @@ 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(); } GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) { - GetSpecialClinicalCareListResponseModel special; + GetSpecialClinicalCareListResponseModel special = GetSpecialClinicalCareListResponseModel(); specialClinicalCareList.forEach((element) { if (element.clinicID == clinicId) { special = element; @@ -130,6 +124,4 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Idle); } } - - } diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 86c04528..8b43bd91 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/replay/request_create_doctor_response.dart'; import 'package:doctor_app_flutter/core/model/doctor/replay/request_doctor_reply.dart'; +import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -10,30 +10,21 @@ import 'base_view_model.dart'; class DoctorReplayViewModel extends BaseViewModel { DoctorReplyService _doctorReplyService = locator(); - List get listDoctorWorkingHoursTable => - _doctorReplyService.listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => _doctorReplyService.listDoctorWorkingHoursTable; - List get listDoctorNotRepliedQuestions => - _doctorReplyService.listDoctorNotRepliedQuestions; + List get listDoctorNotRepliedQuestions => _doctorReplyService.listDoctorNotRepliedQuestions; - Future getDoctorReply( - {int pageSize = 10, - int pageIndex = 1, - bool isLocalBusy = true, - bool isGettingNotReply = false}) async { + Future getDoctorReply({int pageSize = 10, int pageIndex = 1, bool isLocalBusy = true, bool isGettingNotReply = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } await getDoctorProfile(); - RequestDoctorReply _requestDoctorReply = - RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize); - if (isGettingNotReply) - _requestDoctorReply.infoStatus = 99; //to get the not replied only + RequestDoctorReply _requestDoctorReply = RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize); + if (isGettingNotReply) _requestDoctorReply.infoStatus = 99; //to get the not replied only - await _doctorReplyService.getDoctorReply(_requestDoctorReply, - clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply); + await _doctorReplyService.getDoctorReply(_requestDoctorReply, clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply); if (_doctorReplyService.hasError) { error = _doctorReplyService.error; if (isLocalBusy) { @@ -45,17 +36,15 @@ class DoctorReplayViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future createDoctorResponse( - String response, ListGtMyPatientsQuestions model) async { + Future createDoctorResponse(String response, ListGtMyPatientsQuestions model) async { await getDoctorProfile(); - CreateDoctorResponseModel createDoctorResponseModel = - CreateDoctorResponseModel( - transactionNo: model.transactionNo.toString(), - doctorResponse: response, - infoStatus: 6, - createdBy: this.doctorProfile.doctorID, - infoEnteredBy: this.doctorProfile.doctorID, - ); + CreateDoctorResponseModel createDoctorResponseModel = CreateDoctorResponseModel( + transactionNo: model.transactionNo.toString(), + doctorResponse: response, + infoStatus: 6, + createdBy: this.doctorProfile!.doctorID, + infoEnteredBy: this.doctorProfile!.doctorID, + ); setState(ViewState.BusyLocal); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); if (_doctorReplyService.hasError) { diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index f15ee42f..db524c2c 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -1,14 +1,14 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart'; -import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart'; +import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'base_view_model.dart'; @@ -17,22 +17,16 @@ class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; LabsService _labsService = locator(); - List get labOrdersResultsList => - _labsService.labOrdersResultsList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; - List get allSpecialLabList => - _labsService.allSpecialLab; + List get allSpecialLabList => _labsService.allSpecialLab; - List _patientLabOrdersListClinic =[]; - List _patientLabOrdersListHospital =[]; + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; - List get patientLabOrdersList => - filterType == FilterType.Clinic - ? _patientLabOrdersListClinic - : _patientLabOrdersListHospital; + List get patientLabOrdersList => filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; - List get labOrdersResultHistoryList => - _labsService.labOrdersResultHistoryList; + List get labOrdersResultHistoryList => _labsService.labOrdersResultHistoryList; void getLabs(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -42,41 +36,25 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { - List patientLabOrdersClinic = - _patientLabOrdersListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List patientLabOrdersClinic = _patientLabOrdersListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList(); if (patientLabOrdersClinic.length != 0) { - _patientLabOrdersListClinic[_patientLabOrdersListClinic - .indexOf(patientLabOrdersClinic[0])] - .patientLabOrdersList - .add(element); + _patientLabOrdersListClinic[_patientLabOrdersListClinic.indexOf(patientLabOrdersClinic[0])].patientLabOrdersList.add(element); } else { - _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription!, - patientDoctorAppointment: element)); + _patientLabOrdersListClinic.add(PatientLabOrdersList(filterName: element.clinicDescription!, patientDoctorAppointment: element)); } // doctor list sort via project - List patientLabOrdersHospital = - _patientLabOrdersListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List patientLabOrdersHospital = _patientLabOrdersListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (patientLabOrdersHospital.length != 0) { - _patientLabOrdersListHospital[_patientLabOrdersListHospital - .indexOf(patientLabOrdersHospital[0])] - .patientLabOrdersList - .add(element); + _patientLabOrdersListHospital[_patientLabOrdersListHospital.indexOf(patientLabOrdersHospital[0])].patientLabOrdersList.add(element); } else { - _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName!, - patientDoctorAppointment: element)); + _patientLabOrdersListHospital.add(PatientLabOrdersList(filterName: element.projectName!, patientDoctorAppointment: element)); } }); @@ -89,28 +67,15 @@ class LabsViewModel extends BaseViewModel { notifyListeners(); } - List get patientLabSpecialResult => - _labsService.patientLabSpecialResult; + List get patientLabSpecialResult => _labsService.patientLabSpecialResult; List get labResultList => _labsService.labResultList; - List labResultLists =[]; + List labResultLists = []; - getLaboratoryResult( - {String? projectID, - int? clinicID, - String? invoiceNo, - String? orderNo, - PatiantInformtion? patient, - bool? isInpatient}) async { + getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient, bool? isInpatient}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult( - invoiceNo: invoiceNo, - orderNo: orderNo, - projectID: projectID, - clinicID: clinicID, - patient: patient, - isInpatient: isInpatient); + await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient!, isInpatient: isInpatient!); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -119,15 +84,9 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResult( - {PatientLabOrders? patientLabOrder, - PatiantInformtion? patient, - bool? isInpatient}) async { + getPatientLabResult({PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder, - patient: patient, - isInpatient: isInpatient!); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder!, patient: patient!, isInpatient: isInpatient!); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -138,31 +97,19 @@ class LabsViewModel extends BaseViewModel { void setLabResultDependOnFilterName() { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = labResultLists - .where( - (elementClinic) => elementClinic.filterName == element.testCode) - .toList(); + List patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); if (patientLabOrdersClinic.length != 0) { - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); } else { - labResultLists - .add(LabResultList(filterName: element.testCode!, lab: element)); + labResultLists.add(LabResultList(filterName: element.testCode!, lab: element)); } }); } - getPatientLabOrdersResults( - {PatientLabOrders? patientLabOrder, - String? procedure, - PatiantInformtion? patient}) async { + getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, - procedure: procedure, - patient: patient); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure!, patient: patient!); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -170,9 +117,7 @@ class LabsViewModel extends BaseViewModel { bool isShouldClear = false; 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(); @@ -180,15 +125,9 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResultHistoryByDescription( - {PatientLabOrders? patientLabOrder, - String? procedureDescription, - PatiantInformtion? patient}) async { + getPatientLabResultHistoryByDescription({PatientLabOrders? patientLabOrder, String? procedureDescription, PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResultHistoryByDescription( - patientLabOrder: patientLabOrder, - procedureDescription: procedureDescription, - patient: patient); + await _labsService.getPatientLabOrdersResultHistoryByDescription(patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient!); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -198,7 +137,7 @@ class LabsViewModel extends BaseViewModel { } sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder!); if (_labsService.hasError) { error = _labsService.error; } else diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index dd543642..95d51409 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -7,8 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import '../../locator.dart'; class AdmissionRequestViewModel extends BaseViewModel { - AdmissionRequestService _admissionRequestService = - locator(); + AdmissionRequestService _admissionRequestService = locator(); List get clinicList => _admissionRequestService.clinicList; @@ -20,26 +19,21 @@ class AdmissionRequestViewModel extends BaseViewModel { List get wardList => _admissionRequestService.wardList; - List get roomCategoryList => - _admissionRequestService.roomCategoryList; + List get roomCategoryList => _admissionRequestService.roomCategoryList; - List get admissionTypeList => - _admissionRequestService.listOfAdmissionType; + List get admissionTypeList => _admissionRequestService.listOfAdmissionType; - List get diagnosisTypesList => - _admissionRequestService.diagnosisTypesList; + List get diagnosisTypesList => _admissionRequestService.diagnosisTypesList; - List get allergiesList => - _admissionRequestService.allergiesLookupList; + List get allergiesList => _admissionRequestService.allergiesLookupList; List get dietTypesList => _admissionRequestService.dietTypesList; List get icdCodes => _admissionRequestService.icdCodes; - List get listOfDiagnosisSelectionTypes => - _admissionRequestService.listOfDiagnosisSelectionTypes; + List get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes; - AdmissionRequest? admissionRequestData; + AdmissionRequest admissionRequestData = AdmissionRequest(); Future getSpecialityList() async { await getMasterLookup(MasterKeysService.Speciality); diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 741344b2..853749c0 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -4,23 +4,22 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; -import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/order-procedure.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/procedure/order-procedure.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:flutter/material.dart'; import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); - List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; + List? get patientChiefComplaintList => _ucafService.patientChiefComplaintList; - List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; + List? get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; List get patientAssessmentList => _ucafService.patientAssessmentList; @@ -28,13 +27,13 @@ class UcafViewModel extends BaseViewModel { List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; - PrescriptionModel get prescriptionList => _ucafService.prescriptionList; + PrescriptionModel? get prescriptionList => _ucafService.prescriptionList; - List get orderProcedures => _ucafService.orderProcedureList; + List? get orderProcedures => _ucafService.orderProcedureList; - Function saveUCAFOnTap; + late Function saveUCAFOnTap; - String selectedLanguage; + String selectedLanguage = 'en'; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -60,8 +59,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'); } @@ -77,7 +76,7 @@ class UcafViewModel extends BaseViewModel { error = _ucafService.error; setState(ViewState.Error); } else { - patientVitalSignsHistory.forEach((element) { + patientVitalSignsHistory!.forEach((element) { if (heightCm == "0" || heightCm == null || heightCm == 'null') { heightCm = element.heightCm.toString(); } @@ -132,7 +131,7 @@ class UcafViewModel extends BaseViewModel { } Future getOrderProcedures(PatiantInformtion patient) async { - if (orderProcedures.isEmpty) { + if (orderProcedures!.isEmpty) { // setState(ViewState.Busy); await _ucafService.getOrderProcedures(patient); if (_ucafService.hasError) { @@ -157,7 +156,7 @@ 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) { @@ -166,7 +165,7 @@ class UcafViewModel extends BaseViewModel { if (result.isNotEmpty) { return result.first; } - return null; + return MasterKeyModel(); case MasterKeysService.DiagnosisType: List result = diagnosisTypes.where((element) { return element.id == id && element.typeId == masterKeys.getMasterKeyService(); @@ -174,9 +173,9 @@ class UcafViewModel extends BaseViewModel { if (result.isNotEmpty) { return result.first; } - return null; + return MasterKeyModel(); default: - return null; + return MasterKeyModel(); } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 005d095d..0186fa26 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -5,9 +5,10 @@ import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; @@ -22,11 +23,9 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/p import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; class ProcedureViewModel extends BaseViewModel { @@ -44,8 +43,8 @@ class ProcedureViewModel extends BaseViewModel { List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); LabsService _labsService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; @@ -56,7 +55,7 @@ class ProcedureViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List get procedureTemplate => _procedureService.templateList; - List templateList = List(); + List templateList = []; List get procedureTemplateDetails => _procedureService.templateDetailsList; @@ -64,7 +63,7 @@ class ProcedureViewModel extends BaseViewModel { bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; - Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async { + Future getProcedure({required int mrn, String? patientType, int? appointmentNo, bool isLocalBusy = false}) async { hasError = false; await getDoctorProfile(); if (isLocalBusy) @@ -82,7 +81,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async { + Future getProcedureCategory({String? categoryName, String? categoryID, patientId, bool isLocalBusy = false}) async { if (categoryName == null) return; hasError = false; if (isLocalBusy) @@ -109,7 +108,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async { + Future getProcedureTemplate({String? categoryID, bool isLocalBusy = false, BuildContext? context}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { @@ -140,7 +139,7 @@ class ProcedureViewModel extends BaseViewModel { int tempId = 0; - Future getProcedureTemplateDetails({int templateId}) async { + Future getProcedureTemplateDetails({required int templateId}) async { tempId = templateId; hasError = false; //_insuranceCardService.clearInsuranceCard(); @@ -185,7 +184,7 @@ class ProcedureViewModel extends BaseViewModel { } } - Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async { + Future updateProcedure({required UpdateProcedureRequestModel updateProcedureRequestModel, int? mrn, bool isLocalBusy = false}) async { hasError = false; if (isLocalBusy) setState(ViewState.BusyLocal); @@ -200,7 +199,7 @@ class ProcedureViewModel extends BaseViewModel { //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, isInPatient: isInPatient); _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; @@ -240,7 +239,7 @@ class ProcedureViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + getRadImageURL({int? invoiceNo, int lineItem = 0, int projectId = 0, required PatiantInformtion patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { @@ -259,7 +258,7 @@ class ProcedureViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; @@ -276,7 +275,7 @@ class ProcedureViewModel extends BaseViewModel { } } - getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { + getLaboratoryResult({required String projectID, required int clinicID, required String invoiceNo, required String orderNo, required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); if (_labsService.hasError) { @@ -287,7 +286,7 @@ class ProcedureViewModel extends BaseViewModel { } } - getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { + getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, required String procedure, required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { @@ -297,7 +296,7 @@ class ProcedureViewModel extends BaseViewModel { bool isShouldClear = false; 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(); @@ -305,7 +304,7 @@ class ProcedureViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + sendLabReportEmail({required PatientLabOrders patientLabOrder, required String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { error = _labsService.error; @@ -314,11 +313,11 @@ class ProcedureViewModel extends BaseViewModel { } Future preparePostProcedure({ - String remarks, - String orderType, - PatiantInformtion patient, - List entityList, - ProcedureType procedureType, + String? remarks, + String? orderType, + required PatiantInformtion patient, + List? entityList, + ProcedureType? procedureType, bool isLocalBusy = false, }) async { ///TODO Roaa Move it to function @@ -333,15 +332,15 @@ class ProcedureViewModel extends BaseViewModel { procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + entityList!.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId!]; + List controls = []; controls.add( Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); @@ -354,12 +353,12 @@ class ProcedureViewModel extends BaseViewModel { postProcedureReqModel.procedures = controlsProcedure; await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy); if (state == ViewState.Idle) { - if (valadteProcedureList[0].entityList.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy); + if (valadteProcedureList[0].entityList!.length == 0) { + await postProcedure(postProcedureReqModel, patient.patientMRN!, isLocalBusy: isLocalBusy); if (state == ViewState.ErrorLocal) { Utils.showErrorToast(error); - getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy); + getProcedure(mrn: patient.patientMRN!, isLocalBusy: isLocalBusy); } else if (state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX); @@ -368,9 +367,9 @@ class ProcedureViewModel extends BaseViewModel { } else { if (state == ViewState.ErrorLocal) { Utils.showErrorToast(error); - getProcedure(mrn: patient.patientMRN); + getProcedure(mrn: patient.patientMRN!); } else if (state == ViewState.Idle) { - Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages); + Utils.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -400,7 +399,7 @@ class ProcedureViewModel extends BaseViewModel { } else { setState(ViewState.Busy); } - List entityList = List(); + List entityList = []; items.forEach((element) { entityList.add( cpe.EntityList( @@ -419,12 +418,12 @@ class ProcedureViewModel extends BaseViewModel { } Future filterSearchResults(String query, List masterList, List items) async { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(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); } }); @@ -437,12 +436,12 @@ class ProcedureViewModel extends BaseViewModel { } void filterProcedureSearchResults(String query, List masterList, List items) { - List dummySearchList = List(); + List dummySearchList = []; if (masterList != null) dummySearchList.addAll(masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.templateName.toLowerCase().contains(query.toLowerCase())) { + if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 72206475..123482d7 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -35,7 +35,7 @@ class ProjectViewModel with ChangeNotifier { bool get isArabic => _isArabic; late StreamSubscription subscription; - List _vidaPlusProjectListModel = List(); + List _vidaPlusProjectListModel = []; List get vidaPlusProjectList => _vidaPlusProjectListModel; diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index a5241ed9..c4fe87a0 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -1,9 +1,8 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:flutter/foundation.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -12,8 +11,8 @@ class RadiologyViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; RadiologyService _radiologyService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; @@ -53,7 +52,7 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient, String invoiceType}) async { + getRadImageURL({required int invoiceNo, required int lineItem, required int projectId, required bool isVidaPlus, required PatiantInformtion patient, required String invoiceType}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient, invoiceType: invoiceType); if (_radiologyService.hasError) { diff --git a/lib/screens/ER_singin/ER_singin_screen.dart b/lib/screens/ER_singin/ER_singin_screen.dart index b4f6a363..b2e515ab 100644 --- a/lib/screens/ER_singin/ER_singin_screen.dart +++ b/lib/screens/ER_singin/ER_singin_screen.dart @@ -1,26 +1,22 @@ import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../routes.dart'; import '../base/base_view.dart'; Utils helpers = Utils(); @@ -31,7 +27,7 @@ class ErSignInScreen extends StatefulWidget { } class _ErSignInScreenState extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -45,7 +41,7 @@ class _ErSignInScreenState extends State { ), 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( @@ -111,7 +107,7 @@ class _ErSignInScreenState extends State { } } - signInERPatient({BuildContext context, ERSignInViewModel model, patientId, signInType}) async { + signInERPatient({required BuildContext context, required ERSignInViewModel model, patientId, signInType}) async { GifLoaderDialogUtils.showMyDialog(context); await model.signInERPatient(patientId: patientId, signInType: signInType); if (model.state == ViewState.ErrorLocal) { @@ -126,9 +122,9 @@ class _ErSignInScreenState extends State { /// TODO Elham* Make this as custom Dialog showMyDialog({ - BuildContext context, - Function firstAction, - Function secondAction, + required BuildContext context, + required Function firstAction, + required Function secondAction, }) { showDialog( context: context, diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index c1ce9c3c..cb613263 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -4,8 +4,8 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -21,7 +21,7 @@ class LoginScreen extends StatefulWidget { } class _LoginScreenState extends State { - String platformImei; + String? platformImei; bool allowCallApi = true; //TODO change AppTextFormField to AppTextFormFieldCustom @@ -32,8 +32,8 @@ class _LoginScreenState extends State { List projectsList = []; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -74,11 +74,11 @@ class _LoginScreenState extends State { ), Text( TranslationBase.of(context).drSulaimanAlHabib, - style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontFamily: 'Poppins'), + style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth! * 0.029, fontFamily: 'Poppins'), ), Text( "Doctor App", - style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)), + style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth! * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)), ), ]), ], @@ -92,8 +92,8 @@ class _LoginScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - width: SizeConfig.realScreenWidth * 0.90, - height: SizeConfig.realScreenHeight * 0.65, + width: SizeConfig.realScreenWidth! * 0.90, + height: SizeConfig.realScreenHeight! * 0.65, child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ buildSizedBox(), AppTextFieldCustom( @@ -106,6 +106,7 @@ class _LoginScreenState extends State { authenticationViewModel.userInfo.userID = value.trim(); }); }, + onFieldSubmitted: () {}, ), buildSizedBox(), AppTextFieldCustom( @@ -126,6 +127,7 @@ class _LoginScreenState extends State { // } }, onClick: () {}, + onFieldSubmitted: () {}, ), buildSizedBox(), AppTextFieldCustom( @@ -137,6 +139,8 @@ class _LoginScreenState extends State { onClick: () { Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); }, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), buildSizedBox() ]), @@ -187,8 +191,8 @@ 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) { @@ -213,10 +217,10 @@ class _LoginScreenState extends State { onSelectProject(index) { setState(() { authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; - projectIdController.text = projectsList[index].facilityName; + projectIdController.text = projectsList[index].facilityName!; }); - primaryFocus.unfocus(); + primaryFocus!.unfocus(); } String memberID = ""; @@ -231,7 +235,7 @@ class _LoginScreenState extends State { setState(() { projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList); authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; - projectIdController.text = projectsList[0].facilityName; + projectIdController.text = projectsList[0].facilityName!; }); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 06b5d2ec..b305b48e 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -39,12 +39,12 @@ class VerificationMethodsScreen extends StatefulWidget { } class _VerificationMethodsScreenState extends State { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - AuthMethodTypes fingerPrintBefore; - AuthMethodTypes selectedOption; - AuthenticationViewModel authenticationViewModel; + AuthMethodTypes? fingerPrintBefore; + AuthMethodTypes? selectedOption; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -63,7 +63,7 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 6 : 4), ), if (authenticationViewModel.isFromLogin) InkWell( @@ -78,7 +78,7 @@ class _VerificationMethodsScreenState extends State { Column( children: [ SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 3 : 4), ), authenticationViewModel.user != null && isMoreOption == false ? Column( @@ -93,14 +93,14 @@ class _VerificationMethodsScreenState extends State { letterSpacing: -0.72, ), AppText( - Utils.convertToTitleCase(authenticationViewModel.user.doctorName), + Utils.convertToTitleCase(authenticationViewModel.user.doctorName!), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, letterSpacing: -1.44, ), SizedBox( - height: SizeConfig.heightMultiplier * 4, + height: SizeConfig.heightMultiplier! * 4, ), AppText( TranslationBase.of(context).accountInfo, @@ -109,7 +109,7 @@ class _VerificationMethodsScreenState extends State { fontWeight: FontWeight.w600, letterSpacing: -0.64, ), - SizedBox(height: SizeConfig.heightMultiplier * 4), + SizedBox(height: SizeConfig.heightMultiplier! * 4), Container( padding: EdgeInsets.all(15), decoration: BoxDecoration( @@ -124,7 +124,7 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: SizeConfig.realScreenWidth * .5, + width: SizeConfig.realScreenWidth! * .5, padding: EdgeInsets.all(0), child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -172,9 +172,9 @@ class _VerificationMethodsScreenState extends State { children: [ AppText( authenticationViewModel.user.editedOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn), isMonthShort: true) + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn!), isMonthShort: true) : authenticationViewModel.user.createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true) + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn!), isMonthShort: true) : '--', textAlign: TextAlign.right, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, @@ -184,9 +184,9 @@ class _VerificationMethodsScreenState extends State { ), AppText( authenticationViewModel.user.editedOn != null - ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn)) + ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn!)) : authenticationViewModel.user.createdOn != null - ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn)) + ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn!)) : '--', textAlign: TextAlign.right, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -201,7 +201,7 @@ class _VerificationMethodsScreenState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier * 3, + height: SizeConfig.heightMultiplier! * 3, ), Row( children: [ @@ -216,7 +216,7 @@ class _VerificationMethodsScreenState extends State { ], ), SizedBox( - height: SizeConfig.heightMultiplier * 2, + height: SizeConfig.heightMultiplier! * 2, ), ], ) @@ -250,7 +250,7 @@ class _VerificationMethodsScreenState extends State { }, child: VerificationMethodsList( authenticationViewModel: authenticationViewModel, - authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID), + authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), )), ), @@ -351,7 +351,7 @@ class _VerificationMethodsScreenState extends State { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password); + await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password!); if (authenticationViewModel.state == ViewState.ErrorLocal) { Utils.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); @@ -375,7 +375,7 @@ class _VerificationMethodsScreenState extends State { GifLoaderDialogUtils.hideDialog(context); Utils.showErrorToast(authenticationViewModel.error); } else { - await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); + await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!); if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType, isSilentLogin: true); @@ -407,7 +407,7 @@ class _VerificationMethodsScreenState extends State { default: break; } - sharedPref.setInt(OTP_TYPE, selectedOption.getTypeIdService()); + sharedPref.setInt(OTP_TYPE, selectedOption!.getTypeIdService()); } sendActivationCode(AuthMethodTypes authMethodType) async { @@ -418,7 +418,7 @@ class _VerificationMethodsScreenState extends State { } } - startSMSService(AuthMethodTypes type, {isSilentLogin: false}) { + startSMSService(AuthMethodTypes type, {isSilentLogin = false}) { new SMSOTP( context, type, @@ -443,8 +443,8 @@ class _VerificationMethodsScreenState extends State { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && - (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint || - SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { + (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!) == AuthMethodTypes.Fingerprint || + SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!) == AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -454,7 +454,7 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({String value, bool isSilentLogin = false}) async { + checkActivationCode({String? value, bool isSilentLogin = false}) async { await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); diff --git a/lib/screens/doctor_schedule/doctor_schedule.dart b/lib/screens/doctor_schedule/doctor_schedule.dart index 9bdd4b62..19173987 100644 --- a/lib/screens/doctor_schedule/doctor_schedule.dart +++ b/lib/screens/doctor_schedule/doctor_schedule.dart @@ -1,20 +1,19 @@ import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; -import 'package:flutter_svg/flutter_svg.dart'; + import '../../core/viewModel/project_view_model.dart'; import '../../core/viewModel/schedule_view_model.dart'; import '../../icons_app/doctor_app_icons.dart'; import '../../utils/date-utils.dart'; -import '../../utils/dr_app_toast_msg.dart'; import '../../utils/translations_delegate_base_utils.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/errors/error_message.dart'; import '../base/base_view.dart'; -import '../patients/register_patient/CustomEditableText.dart'; class DoctorSchedulePage extends StatefulWidget { @override @@ -22,19 +21,21 @@ class DoctorSchedulePage extends StatefulWidget { } class _DoctorSchedulePageState extends State { - DashboardService service; + late DashboardService service; PageController _pageController = PageController(); double currentPage = 0; int selectedindex = 0; List weeks = []; + // List doctorScheduleResponse = []; int weekMS = 604800 * 1000; + // DoctorList? doctorList; List freeSlots = []; bool isPageChange = false; String fromDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); - String toDate = - DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30))); + String toDate = DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30))); + // AppSharedPreferences sharedPref = AppSharedPreferences(); @override @@ -75,196 +76,100 @@ class _DoctorSchedulePageState extends State { Text( TranslationBase.of(context).dateFrom + " " + - DateFormat("dd-MMM").format( - DateFormat('yyyy-MM-dd') - .parse(fromDate)) + + DateFormat("dd-MMM").format(DateFormat('yyyy-MM-dd').parse(fromDate)) + " " + TranslationBase.of(context).to + " " + - DateFormat("dd-MMM").format( - DateFormat('yyyy-MM-dd') - .parse(toDate)), + DateFormat("dd-MMM").format(DateFormat('yyyy-MM-dd').parse(toDate)), style: TextStyle(fontWeight: FontWeight.w600), ), Row( children: [ IconButton( onPressed: () { - - model.getDoctorRota(fromDate, toDate,); + model.getDoctorRota( + fromDate, + toDate, + ); }, - icon: SvgPicture.asset( - 'assets/images/svgs/prev.svg', - height: 25, - width: 10)), - IconButton( - onPressed: () {}, - icon: SvgPicture.asset( - 'assets/images/svgs/next.svg', - height: 25, - width: 10)) + icon: SvgPicture.asset('assets/images/svgs/prev.svg', height: 25, width: 10)), + IconButton(onPressed: () {}, icon: SvgPicture.asset('assets/images/svgs/next.svg', height: 25, width: 10)) ], ), ], )), ], ), - model.getDoctorRotation.length ==0 ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, - )) : - Container( - margin: EdgeInsets.only(top: 45), - child: PageView.builder( - controller: _pageController, - itemCount: model.getDoctorRotation.length, - onPageChanged: (index) { - setState(() { - isPageChange = true; - this.currentPage = index.toDouble(); - }); - }, - itemBuilder: (context, index) { - return Container( - child: ListView.builder( - itemCount: model.getDoctorRotation[index] - .scheduleforuser.length, - itemBuilder: (context, index2) => InkWell( - onTap: () { - // final weekDay = weeks[index][index2]['DayName']; - }, - child: Row( - children: [ - Expanded( - flex: 1, - child: Padding( - padding: - projectViewModel.isArabic - ? EdgeInsets.only( - right: 17) - : EdgeInsets.only( - left: 17), - child: Row(children: [ - Column( - children: [ - Text(DateFormat('EEEE') - .format(model - .getDoctorRotation[ - index] - .scheduleforuser[ - index2] - .days) + model.getDoctorRotation.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) + : Container( + margin: EdgeInsets.only(top: 45), + child: PageView.builder( + controller: _pageController, + itemCount: model.getDoctorRotation.length, + onPageChanged: (index) { + setState(() { + isPageChange = true; + this.currentPage = index.toDouble(); + }); + }, + itemBuilder: (context, index) { + return Container( + child: ListView.builder( + itemCount: model.getDoctorRotation[index].scheduleforuser!.length, + itemBuilder: (context, index2) => InkWell( + onTap: () { + // final weekDay = weeks[index][index2]['DayName']; + }, + child: Row( + children: [ + Expanded( + flex: 1, + child: Padding( + padding: projectViewModel.isArabic ? EdgeInsets.only(right: 17) : EdgeInsets.only(left: 17), + child: Row(children: [ + Column( + children: [ + Text(DateFormat('EEEE').format(model.getDoctorRotation[index].scheduleforuser![index2].days!) - // fontSize: 13, - // fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500, - ), - Text(getDayMonths(model - .getDoctorRotation[ - index] - .scheduleforuser[ - index2] - .days)) + // fontSize: 13, + // fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500, + ), + Text(getDayMonths(model.getDoctorRotation[index].scheduleforuser![index2].days)) - // fontWeight: FontWeight.bold, - // fontSize: 18, - ], - ) - ])), - ), - Expanded( - flex: 3, - child: ClipRRect( - borderRadius: - const BorderRadius.all( - Radius.circular( - 20.0)), - child: Container( - padding: EdgeInsets.only( - left: 10, - right: 10, - top: 15, - bottom: 20), - margin: EdgeInsets.only( - left: 20, - right: 20, - top: 7, - bottom: 7), - decoration: BoxDecoration( - boxShadow: [ - model - .getDoctorRotation[ - index] - .scheduleforuser[ - index2] - .days - .toString() - .substring( - 0, - 10) == - DateTime.now() - .toString() - .substring( - 0, 10) - ? BoxShadow( - color: Colors - .green, - offset: Offset( - projectViewModel.isArabic - ? 5 - : -5, - 0)) + // fontWeight: FontWeight.bold, + // fontSize: 18, + ], + ) + ])), + ), + Expanded( + flex: 3, + child: ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(20.0)), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, top: 15, bottom: 20), + margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7), + decoration: BoxDecoration(boxShadow: [ + model.getDoctorRotation[index].scheduleforuser![index2].days.toString().substring(0, 10) == DateTime.now().toString().substring(0, 10) + ? BoxShadow(color: Colors.green, offset: Offset(projectViewModel.isArabic ? 5 : -5, 0)) : BoxShadow( - color: Colors - .grey[ - 100], - blurRadius: - 5, - spreadRadius: - 4, - offset: - Offset( - 0, - 10), + color: Colors.grey[100]!, + blurRadius: 5, + spreadRadius: 4, + offset: Offset(0, 10), ), - ], - borderRadius: - const BorderRadius.all( - Radius.circular( - 10.0)), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - model - .getDoctorRotation[ - index] - .scheduleforuser[ - index2] - .days - .toString() - .substring( - 0, - 10) == - DateTime.now() - .toString() - .substring( - 0, - 10) - ? Text( - TranslationBase.of( - context) - .today, - style: - TextStyle( - color: Colors - .green, - fontWeight: - FontWeight - .w600, - fontSize: - 12, + ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + model.getDoctorRotation[index].scheduleforuser![index2].days.toString().substring(0, 10) == DateTime.now().toString().substring(0, 10) + ? Text(TranslationBase.of(context).today, + style: TextStyle( + color: Colors.green, + fontWeight: FontWeight.w600, + fontSize: 12, )) : SizedBox(), // : SizedBox(), @@ -272,15 +177,9 @@ class _DoctorSchedulePageState extends State { children: [ Expanded( child: Text( - model - .getDoctorRotation[ - index] - .clinicname, - style: - TextStyle( - fontWeight: - FontWeight - .w600, + model.getDoctorRotation[index].clinicname!, + style: TextStyle( + fontWeight: FontWeight.w600, ), ), ), @@ -289,30 +188,21 @@ class _DoctorSchedulePageState extends State { ), Container( height: 45, - child: ListView - .builder( - itemCount: model - .getDoctorRotation[ - index] - .scheduleforuser[ - index2] - .shiftforuser - .length, - itemBuilder: (context, - index3) => - Row(children: [ - Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].fromtime.toString()), - Text(" To "), - Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].totime.toString()) - ]))) + child: ListView.builder( + itemCount: model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser!.length, + itemBuilder: (context, index3) => Row(children: [ + Text(model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser![index3].fromtime.toString()), + Text(" To "), + Text(model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser![index3].totime.toString()) + ]))) // ],) ]))), - ), - ], - )))); - }, - )), + ), + ], + )))); + }, + )), // PageViewIndicator( // isActive: true, // currentPage: this.currentPage, @@ -328,138 +218,109 @@ class _DoctorSchedulePageState extends State { showDialog( context: context, builder: (BuildContext context) { - return StatefulBuilder( - builder:(context, setState) { - return - AlertDialog( - title: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).search, - style: TextStyle(fontSize: 22), - ), - Text( - TranslationBase.of(context).searchFindSchedule, - style: TextStyle(fontSize: 16), - ) - ], - ), - content: Container( - height: 150, - child: Column(children: [ - InkWell( - onTap: () { - DatePicker.showDatePicker( - context, - showTitleActions: true, - minTime: DateTime(DateTime.now().year - 1, 1, 1), - maxTime: DateTime.now().add(Duration(days:365)), - onConfirm: (date) { - setState(() { - fromDate = DateFormat('yyyy-MM-dd').format(date); - }); - }, - ); - }, - child: Container( - padding: - EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), - width: double.infinity, - height: 55, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - boxShadow: [ - BoxShadow( - blurRadius: .26, - spreadRadius: 1 * 1.5, - color: Colors.black.withOpacity(.05)) - ]), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).dateFrom, - style: TextStyle(fontSize: 12), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(fromDate), - Icon(Icons.calendar_month_outlined) - ]) - ], - ))), - SizedBox(height: 20,), - InkWell( - onTap: () { - DatePicker.showDatePicker( - context, - showTitleActions: true, - minTime: DateTime(DateTime.now().year - 1, 1, 1), - maxTime: DateTime.now().add(Duration(days:365)), - onConfirm: (date) { - setState(() { - toDate = DateFormat('yyyy-MM-dd').format(date); - }); - }, - ); - }, - child: Container( - padding: - EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), - width: double.infinity, - height: 55, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - boxShadow: [ - BoxShadow( - blurRadius: .26, - spreadRadius: 1 * 1.5, - color: Colors.black.withOpacity(.05)) - ]), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).toDate, - style: TextStyle(fontSize: 12), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(toDate), - Icon(Icons.calendar_month_outlined) - ]) - ], - ))) - ]), - ), - actions: [ - AppButton( - title:TranslationBase.of(context).search, - onPressed: () { - setState((){ - model.getDoctorRota(fromDate, toDate); - Navigator.pop(context); - }); - }, - ) - ], - ); - ; - } - ); - + return StatefulBuilder(builder: (context, setState) { + return AlertDialog( + title: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).search, + style: TextStyle(fontSize: 22), + ), + Text( + TranslationBase.of(context).searchFindSchedule, + style: TextStyle(fontSize: 16), + ) + ], + ), + content: Container( + height: 150, + child: Column(children: [ + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now().add(Duration(days: 365)), + onConfirm: (date) { + setState(() { + fromDate = DateFormat('yyyy-MM-dd').format(date); + }); + }, + ); + }, + child: Container( + padding: EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), + width: double.infinity, + height: 55, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), color: Colors.white, boxShadow: [BoxShadow(blurRadius: .26, spreadRadius: 1 * 1.5, color: Colors.black.withOpacity(.05))]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).dateFrom, + style: TextStyle(fontSize: 12), + ), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [Text(fromDate), Icon(Icons.calendar_month_outlined)]) + ], + ))), + SizedBox( + height: 20, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now().add(Duration(days: 365)), + onConfirm: (date) { + setState(() { + toDate = DateFormat('yyyy-MM-dd').format(date); + }); + }, + ); + }, + child: Container( + padding: EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), + width: double.infinity, + height: 55, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), color: Colors.white, boxShadow: [BoxShadow(blurRadius: .26, spreadRadius: 1 * 1.5, color: Colors.black.withOpacity(.05))]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).toDate, + style: TextStyle(fontSize: 12), + ), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [Text(toDate), Icon(Icons.calendar_month_outlined)]) + ], + ))) + ]), + ), + actions: [ + AppButton( + title: TranslationBase.of(context).search, + onPressed: () { + setState(() { + model.getDoctorRota(fromDate, toDate); + Navigator.pop(context); + }); + }, + ) + ], + ); + ; + }); }, ); } - String getDayMonths(DateTime dateTime) { - String dateFormat = - '${dateTime.day} ${AppDateUtils.getMonth(dateTime.month).toString().substring(0, 3)}'; + String getDayMonths(DateTime? dateTime) { + String dateFormat = '${dateTime!.day} ${AppDateUtils.getMonth(dateTime.month).toString().substring(0, 3)}'; return dateFormat; } } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 146519c6..6d67e7c3 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -2,14 +2,14 @@ import 'dart:async'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/video_channel_utils.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -19,7 +19,7 @@ class VideoCallPage extends StatefulWidget { final listContext; final LiveCarePatientViewModel model; - VideoCallPage({this.patientData, this.listContext, this.model}); + VideoCallPage({required this.patientData, this.listContext, required this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -28,10 +28,10 @@ class VideoCallPage extends StatefulWidget { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class _VideoCallPageState extends State { - Timer _timmerInstance; + late Timer _timmerInstance; int _start = 0; String _timmer = ''; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; bool _isInit = true; var _tokenData; bool isTransfer = false; @@ -68,9 +68,9 @@ class _VideoCallPageState extends State { kSessionId: tokenData.openSessionID, //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', - vcId: widget.patientData.vcId, - isRecording: tokenData != null ? tokenData.isRecording : false, - patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", + vcId: widget.patientData.vcId!, + isRecording: tokenData != null ? tokenData.isRecording! : false, + patientName: widget.patientData.fullName!.isNotEmpty && widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", @@ -136,7 +136,7 @@ class _VideoCallPageState extends State { height: MediaQuery.of(context).size.height * 0.02, ), Text( - widget.patientData.fullName, + widget.patientData.fullName!, style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20), ), SizedBox( diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 1f2666ff..bfffa7f0 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -16,52 +16,52 @@ import 'package:provider/provider.dart'; import '../../widgets/shared/errors/error_message.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, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName, - age: age, - lastName: lastName, - gender: gender, - encounterNumber: encounterNumber, - pp: pp, - patient: patient, - clinicName: clinicName, - doctorName: doctorName, - episode: episode, - vistDate: vistDate, - doctorImage: doctorImage, + firstName: firstName!, + age: age!, + lastName: lastName!, + gender: gender!, + encounterNumber: encounterNumber!, + pp: pp!, + patient: patient!, + clinicName: clinicName!, + doctorName: doctorName!, + episode: episode!, + vistDate: vistDate!, + doctorImage: doctorImage!, ); } 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, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); @@ -77,20 +77,20 @@ class _MedicalFileDetailsState extends State { return BaseView( onModelReady: (model) async { if (model.medicalFileList.length == 0) { - model.getMedicalFile(mrn: pp); + model.getMedicalFile(mrn: pp!); } }, - builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( appBar: PatientProfileAppBar( - patient, - doctorName: doctorName, - profileUrl: doctorImage, - clinic: clinicName, + patient!, + doctorName: doctorName!, + profileUrl: doctorImage!, + clinic: clinicName!, isPrescriptions: true, isMedicalFile: true, - episode: episode, + episode: episode!, visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, + vistDate!, ), isArabic: projectViewModel.isArabic)}', isAppointmentHeader: true, ), @@ -103,14 +103,14 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0 + model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0 ? Padding( padding: EdgeInsets.all(10.0), child: Container( child: Column( children: [ SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -120,7 +120,7 @@ class _MedicalFileDetailsState extends State { 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: Padding( padding: const EdgeInsets.all(15.0), @@ -147,7 +147,7 @@ class _MedicalFileDetailsState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint.length, + itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint!.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -159,7 +159,7 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint[index].hOPI + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint![index].hOPI! .trim(), ), ), @@ -182,7 +182,7 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -192,7 +192,7 @@ class _MedicalFileDetailsState extends State { 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: Padding( padding: const EdgeInsets.all(15.0), @@ -219,7 +219,7 @@ class _MedicalFileDetailsState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments.length, + itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments!.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -234,7 +234,8 @@ class _MedicalFileDetailsState extends State { fontSize: 13.0, ), AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(), + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10! + .trim(), fontSize: 13.5, fontWeight: FontWeight.w700, ), @@ -249,7 +250,8 @@ class _MedicalFileDetailsState extends State { ), Expanded( child: AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] + .condition! .trim(), fontSize: 13.0, fontWeight: FontWeight.w700, @@ -261,7 +263,8 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description, + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] + .description!, fontWeight: FontWeight.w700, fontSize: 15.0, ), @@ -276,7 +279,7 @@ class _MedicalFileDetailsState extends State { ), Expanded( child: AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].type, + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].type!, fontSize: 16.0, fontWeight: FontWeight.w700, ), @@ -287,7 +290,8 @@ class _MedicalFileDetailsState extends State { height: 15.0, ), AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(), + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks! + .trim(), ), Divider( height: 1, @@ -310,7 +314,7 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -320,7 +324,7 @@ class _MedicalFileDetailsState extends State { 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: Padding( padding: const EdgeInsets.all(15.0), @@ -347,7 +351,7 @@ class _MedicalFileDetailsState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure.length, + itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure!.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -363,7 +367,8 @@ class _MedicalFileDetailsState extends State { 'Procedure ID: ', ), AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] + .procedureId! .trim(), fontSize: 13.5, fontWeight: FontWeight.w700, @@ -378,7 +383,8 @@ class _MedicalFileDetailsState extends State { ), AppText( AppDateUtils.getDateFormatted(DateTime.parse( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] + .orderDate! .trim(), )), fontSize: 13.5, @@ -395,7 +401,7 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procName, + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].procName!, fontWeight: FontWeight.w700, ), ) @@ -407,7 +413,7 @@ class _MedicalFileDetailsState extends State { 'CPT Code : ', ), AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].patientID + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].patientID .toString(), fontWeight: FontWeight.w700, ), @@ -437,7 +443,7 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -447,7 +453,7 @@ class _MedicalFileDetailsState extends State { 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: Padding( padding: const EdgeInsets.all(15.0), @@ -474,7 +480,7 @@ class _MedicalFileDetailsState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam.length, + itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam!.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -485,7 +491,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText(TranslationBase.of(context).examType + ": "), AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, + model + .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, fontWeight: FontWeight.w700, ), ], @@ -493,7 +500,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, + model + .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, fontWeight: FontWeight.w700, ) ], @@ -502,7 +510,8 @@ class _MedicalFileDetailsState extends State { children: [ AppText(TranslationBase.of(context).abnormal + ": "), AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].abnormal, + model + .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].abnormal!, fontWeight: FontWeight.w700, ), ], @@ -511,7 +520,7 @@ class _MedicalFileDetailsState extends State { height: 15.0, ), AppText( - model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].remarks, + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].remarks!, ), Divider( height: 1, diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index b7e49ca5..8c591b6f 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -1,4 +1,5 @@ import 'dart:math'; + import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; @@ -6,11 +7,11 @@ import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; -import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -25,10 +26,10 @@ import 'package:speech_to_text/speech_to_text.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); -class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { +class MedicineSearchScreen extends StatefulWidget implements DrAppToastMsg { MedicineSearchScreen({this.changeLoadingState}); - final Function changeLoadingState; + final Function? changeLoadingState; @override _MedicineSearchState createState() => _MedicineSearchState(); @@ -42,27 +43,22 @@ class _MedicineSearchState extends State { String _currentLocaleId = ""; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - GlobalKey key = - new GlobalKey>(); + GlobalKey key = new GlobalKey>(); - String lastError; + String? lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String recognizedWord; + String recognizedWord = ''; @override void didChangeDependencies() { super.didChangeDependencies(); } - Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); - _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' - ? 'en-GB' - : 'ar-SA'; // systemLocale.localeId; + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; if (!mounted) return; setState(() { @@ -70,54 +66,51 @@ class _MedicineSearchState extends State { }); } - @override void dispose() { super.dispose(); - } @override Widget build(BuildContext context) { - return BaseView(onModelReady: (model) async { - }, builder: (_, model, w) { - // myController.text = model.searchText; - return AppScaffold( - // baseViewModel: model, - isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).searchMedicine, - ), - body: SingleChildScrollView( - child: Column( + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) { + // myController.text = model.searchText; + return AppScaffold( + // baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).searchMedicine, + ), + body: SingleChildScrollView( + child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( height: 10, ), AppTextFieldCustomSearch( - hintText: - TranslationBase.of(context).searchMedicineNameHere, + hintText: TranslationBase.of(context).searchMedicineNameHere, searchController: myController, onFieldSubmitted: (value) { searchMedicine(context, model); }, marginTop: 5, + onChangeFun: (String val) {}, ), Container( margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), - child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: AppText( TranslationBase.of(context).youCanFind + - (myController.text != '' - ? model.pharmacyItemsList.length.toString() - : '0') + + (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + " " + - TranslationBase.of(context).medicineSearchResult +" '${myController.text}'", + TranslationBase.of(context).medicineSearchResult + + " '${myController.text}'", fontHeight: 1.4, color: AppGlobal.appTextColor, textAlign: TextAlign.start, @@ -134,33 +127,23 @@ class _MedicineSearchState extends State { if (myController.text != '') Container( margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), - height: MediaQuery.of(context).size.height * 0.6, child: ListView.builder( padding: const EdgeInsets.only(top: 20), scrollDirection: Axis.vertical, - itemCount: model.pharmacyItemsList == null - ? 0 - : model.pharmacyItemsList.length, + itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length, itemBuilder: (BuildContext context, int index) { return InkWell( child: MedicineItemWidget( - label: model.pharmacyItemsList[index] - ["ItemDescription"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"], + label: model.pharmacyItemsList[index]["ItemDescription"], + url: model.pharmacyItemsList[index]["ImageSRCUrl"], ), onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => PharmaciesListScreen( - itemID: model.pharmacyItemsList[index] - ["ItemID"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"]), - settings: RouteSettings( - name: 'PharmaciesListScreen'), + builder: (context) => PharmaciesListScreen(itemID: model.pharmacyItemsList[index]["ItemID"], url: model.pharmacyItemsList[index]["ImageSRCUrl"]), + settings: RouteSettings(name: 'PharmaciesListScreen'), ), ); }, @@ -170,45 +153,44 @@ class _MedicineSearchState extends State { ), ], )), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - title: TranslationBase.of(context).search, - onPressed: () async { - await searchMedicine(context, model); - }, - color: AppGlobal.appRedColor, + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + title: TranslationBase.of(context).search, + onPressed: () async { + await searchMedicine(context, model); + }, + color: AppGlobal.appRedColor, + ), + ), ), ), - ), - ), - SizedBox( - height: 5, + SizedBox( + height: 5, + ), + ], ), - ], - ), - ), - - ); - }); + ), + ); + }); } searchMedicine(context, MedicineViewModel model) async { @@ -247,8 +229,7 @@ class _MedicineSearchState extends State { recognizedWord = result.recognizedWords; lastStatus = ''; myController.text = recognizedWord; - Future.delayed(const Duration(seconds: 2), () { - }); + Future.delayed(const Duration(seconds: 2), () {}); }); } @@ -265,7 +246,6 @@ class _MedicineSearchState extends State { }); } - void soundLevelListener(double level) { minSoundLevel = min(minSoundLevel, level); maxSoundLevel = max(maxSoundLevel, level); diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 546a331b..67525c03 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -3,12 +3,11 @@ import 'package:doctor_app_flutter/core/viewModel/DischargedPatientViewModel.dar import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.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/text_fields/app_text_field_custom_serach.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../routes.dart'; @@ -29,7 +28,7 @@ class _DischargedPatientState extends State { builder: (_, model, w) => AppScaffold( //appBarTitle: 'Discharged Patient', //subtitle: "Last Three Months", - backgroundColor: Colors.grey[200], + backgroundColor: Colors.grey[200]!, isShowAppBar: false, baseViewModel: model, body: model.myDischargedPatient.isEmpty @@ -59,7 +58,9 @@ class _DischargedPatientState extends State { color: Colors.black, ), iconSize: 20, + onPressed: () {}, ), + onFieldSubmitted: () {}, ), SizedBox( height: 5, @@ -115,11 +116,11 @@ 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 + ? model.filterData[index].nationalityId! : "", fontWeight: FontWeight.bold, fontSize: 14, @@ -129,10 +130,10 @@ class _DischargedPatientState extends State { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL : '', + model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL! : '', height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return AppText( '', fontSize: 10, @@ -172,7 +173,7 @@ class _DischargedPatientState extends State { Container( child: RichText( text: new TextSpan( - style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier!, color: Colors.black), children: [ new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')), new TextSpan( @@ -186,7 +187,7 @@ class _DischargedPatientState extends State { child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier!, color: Colors.black, fontFamily: 'Poppins', ), @@ -207,7 +208,7 @@ class _DischargedPatientState extends State { child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier!, color: Colors.black, fontFamily: 'Poppins', ), @@ -230,7 +231,7 @@ class _DischargedPatientState extends State { fontWeight: FontWeight.w300, ), AppText( - "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index e65b0c1d..14468b55 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; @@ -10,7 +10,6 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -18,7 +17,7 @@ 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; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; @@ -57,7 +56,7 @@ class ECGPage extends StatelessWidget { model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { - Uri ecgImageURL = Uri.parse(model.patientMuseResultsModelList[index].imageURL); + Uri ecgImageURL = Uri.parse(model.patientMuseResultsModelList[index].imageURL!); await canLaunchUrl(ecgImageURL).then((value) async { await launchUrl(ecgImageURL); }).catchError((err) { @@ -92,7 +91,7 @@ class ECGPage extends StatelessWidget { SizedBox(height: 3), RichText( text: TextSpan( - style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier!, color: Colors.black), children: [ new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( @@ -109,15 +108,15 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime!, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}', + '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime!)}', fontWeight: FontWeight.w600, - color: Colors.grey[700], + color: Colors.grey[700]!, fontSize: 14, ), ], diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 237a1b3b..7e543740 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -30,13 +30,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, @@ -57,21 +57,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; + int? clinicId; + late AuthenticationViewModel authenticationViewModel; List _times = []; int _activeLocation = 1; - String patientType; - String patientTypeTitle; + String? patientType; + String? patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + String arrivalType = ''; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + PatientModel patient = PatientModel(); OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; bool isSortDes = true; @@ -89,7 +89,7 @@ class _OutPatientsScreenState extends State { return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel!); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -196,6 +196,7 @@ class _OutPatientsScreenState extends State { isSortDes = !isSortDes; }, ), + onFieldSubmitted: () {}, ), Expanded( child: Container( @@ -215,7 +216,7 @@ class _OutPatientsScreenState extends State { padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType, + patientType: patientType!, arrivalType: arrivalType, isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, @@ -224,8 +225,8 @@ class _OutPatientsScreenState extends State { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": model.filterData[index], "patientType": "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, + "from": widget.patientSearchRequestModel!.from, + "to": widget.patientSearchRequestModel!.from, "isSearch": false, "isInpatient": false, "arrivalType": "7", diff --git a/lib/screens/patients/profile/UCAF/ucaf_detail_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_detail_screen.dart index 6d753285..77036e70 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_detail_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_detail_screen.dart @@ -15,7 +15,6 @@ import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - class UcafDetailScreen extends StatefulWidget { final PatiantInformtion patient; final UcafViewModel model; @@ -24,8 +23,7 @@ class UcafDetailScreen extends StatefulWidget { UcafDetailScreen(this.patient, this.model, {this.changeLoadingState}); @override - _UcafDetailScreenState createState() => - _UcafDetailScreenState(this.patient, this.model); + _UcafDetailScreenState createState() => _UcafDetailScreenState(this.patient, this.model); } class _UcafDetailScreenState extends State { @@ -45,8 +43,7 @@ class _UcafDetailScreenState extends State { await ucafModel.postUCAF(patient); widget.changeLoadingState!(false); if (ucafModel.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).postUcafSuccessMsg); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).postUcafSuccessMsg); Navigator.of(context).popUntil((route) { return route.settings.name == PATIENTS_PROFILE; }); @@ -80,18 +77,15 @@ class _UcafDetailScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - treatmentStepsBar( - context, model, screenSize, patient), + treatmentStepsBar(context, model, screenSize, patient), Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Column( children: [ SizedBox( height: 16, ), - ...getSelectedTreatmentStepItem( - context, model), + ...getSelectedTreatmentStepItem(context, model), ], ), ), @@ -105,9 +99,8 @@ class _UcafDetailScreenState extends State { )); } - Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, - Size screenSize, PatiantInformtion patient) { - ProjectViewModel projectViewModel= Provider.of(context); + Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) { + ProjectViewModel projectViewModel = Provider.of(context); List __treatmentSteps = [ TranslationBase.of(context).diagnosis, TranslationBase.of(context).medications, @@ -126,10 +119,13 @@ class _UcafDetailScreenState extends State { child: Center( child: Container( height: screenSize.height * 0.070, - decoration: TabUtils.getBoxTabsBoxDecoration(projectViewModel: projectViewModel, isActive:_isActive, isFirst:__treatmentSteps.indexOf(item) == 0, isLast: __treatmentSteps.indexOf(item) == 2, isMiddle: __treatmentSteps.indexOf(item) == 1 ), - child: Center( - child: TabUtils.getTabText(title: item, isActive: _isActive) - )), + decoration: TabUtils.getBoxTabsBoxDecoration( + projectViewModel: projectViewModel, + isActive: _isActive, + isFirst: __treatmentSteps.indexOf(item) == 0, + isLast: __treatmentSteps.indexOf(item) == 2, + isMiddle: __treatmentSteps.indexOf(item) == 1), + child: Center(child: TabUtils.getTabText(title: item, isActive: _isActive))), ), onTap: () async { print(__treatmentSteps.indexOf(item)); @@ -158,8 +154,7 @@ class _UcafDetailScreenState extends State { ); } - List getSelectedTreatmentStepItem( - BuildContext _context, UcafViewModel model) { + List getSelectedTreatmentStepItem(BuildContext _context, UcafViewModel model) { switch (_activeTap) { case 0: if (model.patientAssessmentList != null) { @@ -170,8 +165,7 @@ class _UcafDetailScreenState extends State { physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { - return DiagnosisWidget( - model, model.patientAssessmentList[index]); + return DiagnosisWidget(model, model.patientAssessmentList[index]); }) ]; } else { @@ -181,36 +175,33 @@ class _UcafDetailScreenState extends State { } break; case 1: - if (model.prescriptionList != null && model.prescriptionList.entityList != null && model.prescriptionList.entityList!.isNotEmpty) { + if (model.prescriptionList != null && model.prescriptionList!.entityList != null && model.prescriptionList!.entityList!.isNotEmpty) { return [ - ListView.builder( - itemCount: model.prescriptionList != null - ? model.prescriptionList.entityList!.length - : 0, - scrollDirection: Axis.vertical, - physics: ScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, index) { - return MedicationWidget( - model, model.prescriptionList.entityList![index]); - }) - - ];} else { + ListView.builder( + itemCount: model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return MedicationWidget(model, model.prescriptionList!.entityList![index]); + }) + ]; + } else { return [ ErrorMessage(error: TranslationBase.of(context).noItem), ]; } break; case 2: - if (model.orderProcedures != null && model.orderProcedures.isNotEmpty) { + if (model.orderProcedures != null && model.orderProcedures!.isNotEmpty) { return [ ListView.builder( - itemCount: model.orderProcedures.length, + itemCount: model.orderProcedures!.length, scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { - return ProceduresWidget(model, model.orderProcedures[index]); + return ProceduresWidget(model, model.orderProcedures![index]); }) ]; } else { @@ -226,4 +217,3 @@ class _UcafDetailScreenState extends State { } } } - diff --git a/lib/screens/patients/profile/UCAF/ucaf_input_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_input_screen.dart index 1fecc2b7..bbbe2501 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_input_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_input_screen.dart @@ -66,7 +66,7 @@ class _UCAFInputScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - body: model.patientVitalSignsHistory != null && model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 + body: model.patientVitalSignsHistory != null && model.patientVitalSignsHistory!.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList!.length > 0 ? Column( children: [ Expanded( @@ -168,7 +168,7 @@ class _UCAFInputScreenState extends State { ), AppTextFieldCustom( hintText: TranslationBase.of(context).instruction, - dropDownText: Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint! + '\n'), + dropDownText: Utils.parseHtmlString(model.patientChiefComplaintList![0].chiefComplaint! + '\n'), controller: _additionalComplaintsController, inputType: TextInputType.multiline, enabled: false, @@ -192,7 +192,7 @@ class _UCAFInputScreenState extends State { : model.patientChiefComplaintList != null || model.patientVitalSignsHistory != null ? Center( child: ErrorMessage( - error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 + error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory!.length == 0 ? TranslationBase.of(context).vitalSignEmptyMsg : TranslationBase.of(context).chiefComplaintEmptyMsg)) : Container(), 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 4668222a..91b027c9 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 @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -19,9 +19,9 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; + import '../../../../routes.dart'; class AdmissionRequestFirstScreen extends StatefulWidget { @@ -42,16 +42,16 @@ class _AdmissionRequestThirdScreenState extends State timeSeries1; - final int indexes; + final String? title; + final List? timeSeries1; + final int? indexes; final bool isOX; LineChartForDiabetic({this.title, this.timeSeries1, this.indexes, this.isOX = false}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; @override Widget build(BuildContext context) { @@ -37,8 +37,8 @@ class LineChartForDiabetic extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - title, - fontSize: SizeConfig.textMultiplier * 2.1, + title!, + fontSize: SizeConfig.textMultiplier! * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', textAlign: TextAlign.center, @@ -54,7 +54,7 @@ class LineChartForDiabetic extends StatelessWidget { padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), - swapAnimationDuration: const Duration(milliseconds: 250), + duration: const Duration(milliseconds: 250), ), ), ), @@ -68,9 +68,9 @@ class LineChartForDiabetic 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); } } @@ -82,45 +82,80 @@ class LineChartForDiabetic extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - //touchCallback: (LineTouchResponse touchResponse) {}, + touchCallback: (FlTouchEvent event, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( - bottomTitles: SideTitles( + bottomTitles: AxisTitles( + sideTitles: SideTitles( showTitles: true, - getTextStyles: (context, value) { - return TextStyle( - color: Colors.black, - fontSize: 10, - ); - }, - rotateAngle: -65, - //rotateAngle:-65, - interval: 100, - margin: 22, - getTitles: (value) { - if (timeSeries1.length < 15) { - if (timeSeries1.length > value.toInt()) { - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + getTitlesWidget: (value, meta) { + if (timeSeries1!.length < 15) { + if (timeSeries1!.length > value.toInt()) { + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); } else - return ''; + return Text(""); } 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}'; + if (value.toInt() == 0) + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + if (value.toInt() == timeSeries1!.length - 1) + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); if (xAxixs.contains(value.toInt())) { - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); } } - return ''; + return Text( + "", + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); }, - ), - leftTitles: SideTitles( + // rotateAngle: -65, + //rotateAngle:-65, + interval: 100, + reservedSize: 22, + // getTitles: (value) { + // + // }, + )), + leftTitles: AxisTitles( + sideTitles: SideTitles( showTitles: true, - getTextStyles: (context, value) { - return TextStyle( - color: Colors.black, - fontSize: 10, + // getTextStyles: + getTitlesWidget: (val, MetaVal) { + return Text( + "", + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), ); }, interval: getMaxY() - getMinY() <= 500 @@ -128,8 +163,8 @@ class LineChartForDiabetic extends StatelessWidget { : getMaxY() - getMinY() <= 1000 ? 100 : 200, - margin: 12, - ), + reservedSize: 12, + )), ), borderData: FlBorderData( show: true, @@ -150,7 +185,7 @@ class LineChartForDiabetic extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries1.length - 1).toDouble(), + maxX: (timeSeries1!.length - 1).toDouble(), maxY: getMaxY() + 0.3, minY: getMinY(), lineBarsData: getData(context), @@ -159,8 +194,8 @@ class LineChartForDiabetic 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) { @@ -172,9 +207,9 @@ class LineChartForDiabetic extends StatelessWidget { } double getMinY() { - double min = timeSeries1[0].sales; - timeSeries1.forEach((element) { - double resultValueDouble = element.sales; + double min = timeSeries1![0].sales!; + timeSeries1!.forEach((element) { + double resultValueDouble = element.sales!; if (resultValueDouble < min) min = resultValueDouble; }); // timeSeries2.forEach((element) { @@ -188,12 +223,12 @@ class LineChartForDiabetic extends StatelessWidget { } 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(); + List spots2 = []; // for (int index = 0; index < timeSeries2.length; index++) { // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); // } @@ -201,7 +236,7 @@ class LineChartForDiabetic extends StatelessWidget { final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - colors: [Colors.red], + color: Colors.red, barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -214,7 +249,7 @@ class LineChartForDiabetic extends StatelessWidget { final LineChartBarData lineChartBarData2 = LineChartBarData( spots: spots2, isCurved: true, - colors: [Colors.red], + color: Colors.red, barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -225,7 +260,7 @@ class LineChartForDiabetic extends StatelessWidget { ), ); - List lineChartData = List(); + List lineChartData = []; if (spots.isNotEmpty) { lineChartData.add(lineChartBarData1); } diff --git a/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart b/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart index f23f973a..d2c4e4f3 100644 --- a/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart +++ b/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart @@ -9,22 +9,20 @@ class LineChartCurvedLabHistory extends StatefulWidget { final String title; final List labResultHistory; - LineChartCurvedLabHistory({this.title, this.labResultHistory}); + LineChartCurvedLabHistory({required this.title, required this.labResultHistory}); @override State createState() => LineChartCurvedLabHistoryState(); } class LineChartCurvedLabHistoryState extends State { - bool isShowingMainData; - List xAxixs = List(); + List xAxixs = []; int indexes = 0; @override void initState() { super.initState(); getXaxix(); - isShowingMainData = true; } getXaxix() { @@ -56,7 +54,7 @@ class LineChartCurvedLabHistoryState extends State { ), AppText( widget.title, - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig.textMultiplier! * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', textAlign: TextAlign.center, @@ -69,7 +67,7 @@ class LineChartCurvedLabHistoryState extends State { padding: const EdgeInsets.only(right: 16.0, left: 8.0), child: LineChart( sampleData1(), - swapAnimationDuration: const Duration(milliseconds: 250), + duration: const Duration(milliseconds: 250), ), ), ), @@ -90,53 +88,73 @@ class LineChartCurvedLabHistoryState extends State { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - // touchCallback: (LineTouchResponse touchResponse) {}, + touchCallback: (event, touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( - bottomTitles: SideTitles( + bottomTitles: AxisTitles( + sideTitles: SideTitles( showTitles: true, - getTextStyles: (context, value) { - return TextStyle( - color: Colors.black, - fontSize: 10, - ); - }, - margin: 28, - rotateAngle: -65, - getTitles: (value) { - print(value); - DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime); + reservedSize: 28, + // rotateAngle: -65, + getTitlesWidget: (value, meta) { + DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime!); if (widget.labResultHistory.length < 8) { if (widget.labResultHistory.length > value.toInt()) { - return '${date.day}/ ${date.year}'; + return Text( + '${date.day}/ ${date.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); } else - return ''; + return Text(""); } else { - if (value.toInt() == 0) return '${date.day}/ ${date.year}'; - if (value.toInt() == widget.labResultHistory.length - 1) return '${date.day}/ ${date.year}'; + if (value.toInt() == 0) + return Text( + '${date.day}/ ${date.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + if (value.toInt() == widget.labResultHistory.length - 1) + return Text( + '${date.day}/ ${date.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); if (xAxixs.contains(value.toInt())) { - return '${date.day}/ ${date.year}'; + return Text( + '${date.day}/ ${date.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); } } - return ''; + return Text(""); }, - ), - leftTitles: SideTitles( - showTitles: true, - getTextStyles: (context, value) { - return TextStyle( - color: Colors.black, - fontSize: 10, - ); - }, - getTitles: (value) { - return '${value.toInt()}'; - }, - margin: 8, - //reservedSize: 30, + )), + leftTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + getTitlesWidget: (value, meta) { + return Text('${value.toInt()}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + )); + }, + reservedSize: 8, + //reservedSize: 30, + ), ), ), borderData: FlBorderData( @@ -169,7 +187,7 @@ class LineChartCurvedLabHistoryState extends State { double max = 0; widget.labResultHistory.forEach((element) { try { - double resultValueDouble = double.parse(element.resultValue); + double resultValueDouble = double.parse(element.resultValue!); if (resultValueDouble > max) max = resultValueDouble; } catch (e) { print(e); @@ -182,10 +200,10 @@ class LineChartCurvedLabHistoryState extends State { double getMinY() { double min = 0; try { - min = double.parse(widget.labResultHistory[0].resultValue); + min = double.parse(widget.labResultHistory[0].resultValue!); widget.labResultHistory.forEach((element) { - double resultValueDouble = double.parse(element.resultValue); + double resultValueDouble = double.parse(element.resultValue!); if (resultValueDouble < min) min = resultValueDouble; }); } catch (e) { @@ -197,10 +215,10 @@ class LineChartCurvedLabHistoryState extends State { } List getData() { - List spots = List(); + List spots = []; for (int index = 0; index < widget.labResultHistory.length; index++) { try { - var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue); + var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue!); spots.add(FlSpot(index.toDouble(), resultValueDouble)); } catch (e) { print(e); @@ -211,7 +229,7 @@ class LineChartCurvedLabHistoryState extends State { final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - colors: [Colors.red], + color: Colors.red, barWidth: 3, isStrokeCapRound: true, curveSmoothness: 0.12, diff --git a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart index 1c4359ea..a37f0475 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; -import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -16,13 +16,7 @@ class LaboratoryResultPage extends StatefulWidget { final String arrivalType; final bool isInpatient; - LaboratoryResultPage( - {Key? key, - required this.patientLabOrders, - required this.patient, - required this.patientType, - required this.arrivalType, - required this.isInpatient}); + LaboratoryResultPage({Key? key, required this.patientLabOrders, required this.patient, required this.patientType, required this.arrivalType, required this.isInpatient}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -32,10 +26,7 @@ class _LaboratoryResultPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - isInpatient: true), + onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileAppBar( @@ -49,17 +40,14 @@ class _LaboratoryResultPageState extends State { isShowAppBar: false, body: SingleChildScrollView( child: LaboratoryResultWidget( - onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo!, - details: model.patientLabSpecialResult.length > 0 - ? model.patientLabSpecialResult[0].resultDataHTML! - : "", - orderNo: widget.patientLabOrders.orderNo!, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - isInpatient: widget.patientType == "1", - invoiceType:widget.patientLabOrders.invoiceType - ), + onTap: () async {}, + billNo: widget.patientLabOrders.invoiceNo!, + details: model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML! : "", + orderNo: widget.patientLabOrders.orderNo!, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + isInpatient: widget.patientType == "1", + invoiceType: widget.patientLabOrders.invoiceType!), ), ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart index 2248b4f6..b2bc5752 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart @@ -1,41 +1,30 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result/lab_result_widget.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.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 String invoiceType; - const LaboratoryResultWidget( - {Key key, - this.onTap, - this.billNo, - this.details, - this.orderNo, - this.patientLabOrder, - this.patient, - this.isInpatient, - this.invoiceType - }) - : super(key: key); + final GestureTapCallback? onTap; + final String? billNo; + final String? details; + final String? orderNo; + final PatientLabOrders? patientLabOrder; + final PatiantInformtion? patient; + final bool? isInpatient; + final String? invoiceType; + + const LaboratoryResultWidget({Key? key, this.onTap, this.billNo, this.details, this.orderNo, this.patientLabOrder, this.patient, this.isInpatient, this.invoiceType}) : super(key: key); @override _LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState(); @@ -44,7 +33,7 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; bool _isShowMore = true; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -93,22 +82,17 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only( - left: 0, right: 0), + margin: EdgeInsets.only(left: 0, right: 0), child: AppText( - TranslationBase.of(context) - .generalResult, - fontSize: - SizeConfig.textMultiplier * 2.3, + TranslationBase.of(context).generalResult, + fontSize: SizeConfig.textMultiplier! * 2.3, bold: false, ))), Container( width: 25, height: 25, child: Icon( - _isShowMoreGeneral - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -142,16 +126,11 @@ class _LaboratoryResultWidgetState extends State { shrinkWrap: true, itemBuilder: (context, index) { return LabResultWidget( - patientLabOrder: - widget.patientLabOrder, - filterName: model - .labResultLists[index] - .filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, - patient: widget.patient, - isInpatient: widget.isInpatient, + patientLabOrder: widget.patientLabOrder!, + filterName: model.labResultLists[index].filterName, + patientLabResultList: model.labResultLists[index].patientLabResultList, + patient: widget.patient!, + isInpatient: widget.isInpatient!, ); }), ], @@ -170,7 +149,7 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 15, ), - if (widget.details != null && widget.details.isNotEmpty) + if (widget.details != null && widget.details!.isNotEmpty) Column( children: [ InkWell( @@ -192,22 +171,17 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(left: 0, right: 0), + margin: EdgeInsets.only(left: 0, right: 0), child: AppText( - TranslationBase.of(context) - .specialResult, - fontSize: - SizeConfig.textMultiplier * 2.3, + TranslationBase.of(context).specialResult, + fontSize: SizeConfig.textMultiplier! * 2.3, bold: false, ))), Container( width: 25, height: 25, child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -230,16 +204,12 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: !Utils.isTextHtml(widget.details) + child: !Utils.isTextHtml(widget.details!) ? AppText( - widget.details ?? - TranslationBase.of(context) - .noDataAvailable, + widget.details ?? TranslationBase.of(context).noDataAvailable, ) : Html( - data: widget.details ?? - TranslationBase.of(context) - .noDataAvailable, + data: widget.details ?? TranslationBase.of(context).noDataAvailable, ), ), ), diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index a32a8791..1d43b1fa 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -2,14 +2,14 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; @@ -21,7 +21,6 @@ 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/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -32,21 +31,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { final int visitType; - const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); + const ProgressNoteScreen({Key? key, required 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; + 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); @@ -55,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, @@ -69,7 +68,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -118,7 +117,7 @@ class _ProgressNoteState extends State { widthFactor: 0.95, child: CardWithBgWidget( hasBorder: false, - bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy + bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy ? Color(0xFFCC9B14) : model.patientProgressNoteList[index].status == 4 ? Colors.red.shade700 @@ -130,7 +129,7 @@ class _ProgressNoteState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) + if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy) AppText( TranslationBase.of(context).notePending, fontWeight: FontWeight.bold, @@ -153,7 +152,7 @@ class _ProgressNoteState extends State { ), if (model.patientProgressNoteList[index].status != 2 && model.patientProgressNoteList[index].status != 4 && - authenticationViewModel.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) + authenticationViewModel.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -209,7 +208,7 @@ class _ProgressNoteState extends State { confirmFun: () async { GifLoaderDialogUtils.showMyDialog(context); UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo!), cancelledNote: false, lineItemNo: model.patientProgressNoteList[index].lineItemNo, conditionId: model.patientProgressNoteList[index].condition, @@ -264,7 +263,7 @@ class _ProgressNoteState extends State { context, ); UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo!), conditionId: model.patientProgressNoteList[index].condition, cancelledNote: true, lineItemNo: model.patientProgressNoteList[index].lineItemNo, @@ -364,7 +363,7 @@ class _ProgressNoteState extends State { children: [ AppText( model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn), + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!), isArabic: projectViewModel.isArabic, isMonthShort: true) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic), fontWeight: FontWeight.w600, @@ -373,7 +372,7 @@ class _ProgressNoteState extends State { ), AppText( model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) + ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!)) : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, @@ -390,7 +389,7 @@ class _ProgressNoteState extends State { Row(mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( child: AppText( - model.patientProgressNoteList[index].notes, + model.patientProgressNoteList[index].notes!, fontSize: 10, isCopyable: true, ), @@ -416,7 +415,7 @@ class _ProgressNoteState extends State { } /// TODO Elham* Make this as custom Dialog - showMyDialog({BuildContext context, Function confirmFun, String actionName}) { + showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { showDialog( context: context, builder: (ctx) => Center( diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index 4369506f..ceaf1fa1 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -14,9 +14,8 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -27,28 +26,20 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; + import '../../../../../widgets/shared/dialogs/dailog-list-select.dart'; import '../../../../base/base_view.dart'; class UpdateNoteOrder extends StatefulWidget { - final NoteModel note; + final NoteModel? note; final PatientViewModel patientModel; final PatiantInformtion patient; - final int visitType; + final int? visitType; final bool isUpdate; - final List elementList; - final Function(dynamic) okFunction; + final List? elementList; + final Function(dynamic)? okFunction; - const UpdateNoteOrder( - {Key key, - this.note, - this.patientModel, - this.patient, - this.visitType, - this.isUpdate, - this.elementList, - this.okFunction}) - : super(key: key); + const UpdateNoteOrder({Key? key, this.note, required this.patientModel, required this.patient, this.visitType, required this.isUpdate, this.elementList, this.okFunction}) : super(key: key); @override _UpdateNoteOrderState createState() => _UpdateNoteOrderState(); @@ -56,12 +47,12 @@ class UpdateNoteOrder extends StatefulWidget { class _UpdateNoteOrderState extends State { dynamic selectValue; - int selectedType; + int selectedType = 0; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; TextEditingController progressNoteController = TextEditingController(); @@ -91,12 +82,10 @@ class _UpdateNoteOrderState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note.notes; - if(selectValue==null) - selectValue={}; - selectValue[keyId] = widget.note.condition; - selectValue['Description'] = widget.note.conditionDescription; - + progressNoteController.text = widget.note!.notes!; + if (selectValue == null) selectValue = {}; + selectValue[keyId] = widget.note!.condition; + selectValue['Description'] = widget.note!.conditionDescription; } return BaseView( @@ -116,14 +105,8 @@ 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, @@ -137,11 +120,7 @@ class _UpdateNoteOrderState extends State { ListSelectDialog dialog = ListSelectDialog( list: model.stpMasterList, attributeName: 'Description', - attributeValueId: - model.stpMasterList.length == 1 - ? model.stpMasterList[0]['${keyId}'] - .toString() - : '${keyId}', + attributeValueId: model.stpMasterList.length == 1 ? model.stpMasterList[0]['${keyId}'].toString() : '${keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => { setState(() { @@ -160,14 +139,14 @@ class _UpdateNoteOrderState extends State { } : null, child: AppTextFieldCustom( - hintText: TranslationBase.of(context).selectCondition,//'Select Condition', + hintText: TranslationBase.of(context).selectCondition, //'Select Condition', dropDownText: model.stpMasterList.length == 1 ? model.stpMasterList[0]['Description'] : selectValue == null ? null : selectValue['Description'], enabled: false, - isTextFieldHasSuffix: true, + isTextFieldHasSuffix: true, onChanged: (String value) {}, onFieldSubmitted: () {}, ), ), ), @@ -183,19 +162,8 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: 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, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 40, @@ -203,26 +171,19 @@ class _UpdateNoteOrderState extends State { hasBorder: true, // isTextFieldHasSuffix: true, - validationError: progressNoteController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {}, + onFieldSubmitted: () {}, ), Positioned( top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -240,7 +201,7 @@ class _UpdateNoteOrderState extends State { ), bottomSheet: Container( height: progressNoteController.text.isNotEmpty ? 130 : 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), child: Column( children: [ if (progressNoteController.text.isNotEmpty) @@ -259,14 +220,8 @@ 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: AppGlobal.appGreenColor, // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -276,29 +231,25 @@ class _UpdateNoteOrderState extends State { }); if (progressNoteController.text.trim().isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); 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, patientOutSA: false, conditionId: selectValue['ParameterCode']); - await widget.patientModel - .updatePatientProgressNote(reqModel); + await widget.patientModel.updatePatientProgressNote(reqModel); } else { CreateNoteModel reqModel = CreateNoteModel( - admissionNo: - int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), createdBy: doctorProfile.doctorID, visitType: widget.visitType, patientID: widget.patient.patientId, @@ -308,29 +259,23 @@ class _UpdateNoteOrderState extends State { notes: progressNoteController.text, conditionId: selectValue['ParameterCode']); - await widget.patientModel - .createPatientProgressNote(reqModel); + await widget.patientModel.createPatientProgressNote(reqModel); } - if (widget.patientModel.state == - ViewState.ErrorLocal) { + if (widget.patientModel.state == ViewState.ErrorLocal) { Utils.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, - languageID: 2); - await widget.patientModel.getPatientProgressNote( - progressNoteRequest.toJson()); + 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, + languageID: 2); + await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson()); } GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).yourOrderAddedSuccessfully); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).yourOrderAddedSuccessfully); Navigator.of(context).pop(); } else { Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces); @@ -346,8 +291,7 @@ class _UpdateNoteOrderState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -378,14 +322,13 @@ class _UpdateNoteOrderState extends State { void resultListener(result) { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - if (result.finalResult ==true) { + if (result.finalResult == true) { setState(() { if (mounted) { - // speech.stop(); + // speech.stop(); progressNoteController.text += recognizedWord + '\n'; SpeechToText.closeAlertDialog(context); - - } + } }); } else { print(result.finalResult); @@ -393,8 +336,7 @@ class _UpdateNoteOrderState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index c15a3f88..39198c50 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -1,17 +1,17 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; -import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -23,19 +23,19 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; import '../../../../config/config.dart'; class UpdateOperationReport extends StatefulWidget { - final GetReservationsResponseModel reservation; + final GetReservationsResponseModel? reservation; // final OperationReportViewModel operationReportViewModel; - final PatiantInformtion patient; - final int visitType; + final PatiantInformtion? patient; + final int? visitType; final bool isUpdate; const UpdateOperationReport( - {Key key, + {Key? key, // this.operationReportViewModel, this.patient, this.visitType, - this.isUpdate, + required this.isUpdate, this.reservation}) : super(key: key); @@ -44,12 +44,12 @@ class UpdateOperationReport extends StatefulWidget { } class _UpdateOperationReportState extends State { - int selectedType; + int? selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; TextEditingController preOpDiagmosisController = TextEditingController(); TextEditingController postOpDiagmosisNoteController = TextEditingController(); @@ -63,13 +63,11 @@ class _UpdateOperationReportState extends State { TextEditingController complicationDetailsController = TextEditingController(); TextEditingController bloodLossDetailController = TextEditingController(); TextEditingController histopathSpecimenController = TextEditingController(); - TextEditingController microbiologySpecimenController = - TextEditingController(); + TextEditingController microbiologySpecimenController = TextEditingController(); TextEditingController otherSpecimenController = TextEditingController(); TextEditingController scrubNurseController = TextEditingController(); TextEditingController circulatingNurseController = TextEditingController(); - TextEditingController BloodTransfusedDetailController = - TextEditingController(); + TextEditingController BloodTransfusedDetailController = TextEditingController(); TextEditingController anasthetistController = TextEditingController(); TextEditingController OTReservationID = TextEditingController(); @@ -91,33 +89,30 @@ class _UpdateOperationReportState extends State { return BaseView( onModelReady: (model) async { - await model.getOperationReportDetails(widget.reservation); - OTReservationID.text = widget.reservation.oTReservationID.toString(); + await model.getOperationReportDetails(widget.reservation!); + OTReservationID.text = widget.reservation!.oTReservationID.toString(); if (model.operationDetailsList.isNotEmpty) { - GetOperationDetailsResponseModel oldDetails = - model.operationDetailsList[0]; - - postOpDiagmosisNoteController.text = oldDetails.postOpInstruction; - preOpDiagmosisController.text = oldDetails.preOpDiagnosis; - surgeonController.text = oldDetails.surgeon; - assistantNoteController.text = oldDetails.assistant; - operationController.text = oldDetails.operation; - inasionController.text = oldDetails.inasion; - findingController.text = oldDetails.finding; - surgeryProcedureController.text = oldDetails.surgeryProcedure; - postOpInstructionController.text = oldDetails.postOpInstruction; - complicationDetailsController.text = oldDetails.complicationDetail; - bloodLossDetailController.text = oldDetails.bloodLossDetail; - histopathSpecimenController.text = oldDetails.histopathSpecimen; - microbiologySpecimenController.text = - oldDetails.microbiologySpecimen; - otherSpecimenController.text = oldDetails.otherSpecimen; + GetOperationDetailsResponseModel oldDetails = model.operationDetailsList[0]; + + postOpDiagmosisNoteController.text = oldDetails.postOpInstruction!; + preOpDiagmosisController.text = oldDetails.preOpDiagnosis!; + surgeonController.text = oldDetails.surgeon!; + assistantNoteController.text = oldDetails.assistant!; + operationController.text = oldDetails.operation!; + inasionController.text = oldDetails.inasion!; + findingController.text = oldDetails.finding!; + surgeryProcedureController.text = oldDetails.surgeryProcedure!; + postOpInstructionController.text = oldDetails.postOpInstruction!; + complicationDetailsController.text = oldDetails.complicationDetail!; + bloodLossDetailController.text = oldDetails.bloodLossDetail!; + histopathSpecimenController.text = oldDetails.histopathSpecimen!; + microbiologySpecimenController.text = oldDetails.microbiologySpecimen!; + otherSpecimenController.text = oldDetails.otherSpecimen!; scrubNurseController.text = oldDetails.scrubNurse; circulatingNurseController.text = oldDetails.circulatingNurse; - BloodTransfusedDetailController.text = - oldDetails.bloodTransfusedDetail; - anasthetistController.text = oldDetails.anasthetist; + BloodTransfusedDetailController.text = oldDetails.bloodTransfusedDetail; + anasthetistController.text = oldDetails.anasthetist!; } }, builder: (_, model, w) => AppScaffold( @@ -146,107 +141,82 @@ class _UpdateOperationReportState extends State { child: Column( children: [ AppTextFieldCustom( - hintText: TranslationBase.of(context) - .reservation, + hintText: TranslationBase.of(context).reservation, controller: OTReservationID, maxLines: 1, minLines: 1, enabled: false, hasBorder: true, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .preOperationDiagnosis, + hintText: TranslationBase.of(context).preOperationDiagnosis, controller: preOpDiagmosisController, maxLines: 20, minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: preOpDiagmosisController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .postOperationDiagnosis, + hintText: TranslationBase.of(context).postOperationDiagnosis, controller: postOpDiagmosisNoteController, maxLines: 20, minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - postOpDiagmosisNoteController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: postOpDiagmosisNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).surgeon, + hintText: TranslationBase.of(context).surgeon, controller: surgeonController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - surgeonController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: surgeonController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).assistant, + hintText: TranslationBase.of(context).assistant, controller: assistantNoteController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: assistantNoteController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: assistantNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).operation, + hintText: TranslationBase.of(context).operation, controller: operationController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - operationController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: operationController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, @@ -260,248 +230,175 @@ class _UpdateOperationReportState extends State { hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - inasionController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: inasionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).finding, + hintText: TranslationBase.of(context).finding, controller: findingController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - findingController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: findingController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .surgeryProcedure, + hintText: TranslationBase.of(context).surgeryProcedure, controller: surgeryProcedureController, maxLines: 20, minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - surgeryProcedureController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: surgeryProcedureController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .postOperationInstruction, + hintText: TranslationBase.of(context).postOperationInstruction, controller: postOpInstructionController, maxLines: 20, minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - postOpInstructionController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: postOpInstructionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .complicationDetails1, + hintText: TranslationBase.of(context).complicationDetails1, controller: complicationDetailsController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - complicationDetailsController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: complicationDetailsController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .bloodLossDetail, + hintText: TranslationBase.of(context).bloodLossDetail, controller: bloodLossDetailController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: bloodLossDetailController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: bloodLossDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .histopathSpecimen, + hintText: TranslationBase.of(context).histopathSpecimen, controller: histopathSpecimenController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - histopathSpecimenController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: histopathSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .microbiologySpecimen, - controller: - microbiologySpecimenController, + hintText: TranslationBase.of(context).microbiologySpecimen, + controller: microbiologySpecimenController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - microbiologySpecimenController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: microbiologySpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .otherSpecimen, + hintText: TranslationBase.of(context).otherSpecimen, controller: otherSpecimenController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: otherSpecimenController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: otherSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .scrubNurse, + hintText: TranslationBase.of(context).scrubNurse, controller: scrubNurseController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - scrubNurseController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: scrubNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .circulatingNurse, + hintText: TranslationBase.of(context).circulatingNurse, controller: circulatingNurseController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - circulatingNurseController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: circulatingNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .bloodTransfusedDetail, - controller: - BloodTransfusedDetailController, + hintText: TranslationBase.of(context).bloodTransfusedDetail, + controller: BloodTransfusedDetailController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - BloodTransfusedDetailController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: BloodTransfusedDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .anesthetist, + hintText: TranslationBase.of(context).anesthetist, controller: anasthetistController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - anasthetistController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: anasthetistController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, onFieldSubmitted: () {}, ), SizedBox( height: 250, @@ -523,17 +420,13 @@ class _UpdateOperationReportState extends State { ) : Container( height: 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), child: Column( children: [ Container( margin: EdgeInsets.all(5), child: AppButton( - title: (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - " " + - TranslationBase.of(context).operationReports, + title: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + " " + TranslationBase.of(context).operationReports, color: AppGlobal.appGreenColor, // disabled: operationReportsController.text.isEmpty, fontWeight: FontWeight.w700, @@ -545,55 +438,33 @@ class _UpdateOperationReportState extends State { GifLoaderDialogUtils.showMyDialog(context); await model.getDoctorProfile(); - CreateUpdateOperationReportRequestModel - createUpdateOperationReportRequestModel = - CreateUpdateOperationReportRequestModel( - inasion: inasionController.text, - - /// TODO Elham* Add dynamic reservation - reservationNo: widget - .reservation.oTReservationID, - preOpDiagmosis: - preOpDiagmosisController.text, - postOpDiagmosis: - postOpDiagmosisNoteController - .text, - surgeon: surgeonController.text, - assistant: - assistantNoteController.text, - anasthetist: - assistantNoteController.text, - operation: operationController.text, - finding: findingController.text, - surgeryProcedure: - surgeonController.text, - postOpInstruction: - postOpInstructionController.text, - complicationDetails: - complicationDetailsController - .text, - bloodLossDetail: - bloodLossDetailController.text, - histopathSpecimen: - histopathSpecimenController.text, - microbiologySpecimen: - microbiologySpecimenController - .text, - otherSpecimen: - otherSpecimenController.text, - scrubNurse: surgeonController.text, - circulatingNurse: - circulatingNurseController.text, - bloodTransfusedDetail: - bloodLossDetailController.text, - patientID: widget.patient.patientId, - admissionNo: int.parse( - widget.patient.admissionNo), - createdBy: - model.doctorProfile.doctorID, - ); - await model.updateOperationReport( - createUpdateOperationReportRequestModel); + CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = CreateUpdateOperationReportRequestModel( + inasion: inasionController.text, + + /// TODO Elham* Add dynamic reservation + reservationNo: widget.reservation!.oTReservationID, + preOpDiagmosis: preOpDiagmosisController.text, + postOpDiagmosis: postOpDiagmosisNoteController.text, + surgeon: surgeonController.text, + assistant: assistantNoteController.text, + anasthetist: assistantNoteController.text, + operation: operationController.text, + finding: findingController.text, + surgeryProcedure: surgeonController.text, + postOpInstruction: postOpInstructionController.text, + complicationDetails: complicationDetailsController.text, + bloodLossDetail: bloodLossDetailController.text, + histopathSpecimen: histopathSpecimenController.text, + microbiologySpecimen: microbiologySpecimenController.text, + otherSpecimen: otherSpecimenController.text, + scrubNurse: surgeonController.text, + circulatingNurse: circulatingNurseController.text, + bloodTransfusedDetail: bloodLossDetailController.text, + patientID: widget.patient!.patientId, + admissionNo: int.parse(widget.patient!.admissionNo!), + createdBy: model.doctorProfile!.doctorID, + ); + await model.updateOperationReport(createUpdateOperationReportRequestModel); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); @@ -601,8 +472,7 @@ class _UpdateOperationReportState extends State { // await model.( // operationReportsRequest.toJson()); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); + DrAppToastMsg.showSuccesToast("Your Order added Successfully"); } GifLoaderDialogUtils.hideDialog(context); } 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 a18a93a2..cf1178df 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -38,7 +38,7 @@ class PatientProfileScreen extends StatefulWidget { } class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { - PatiantInformtion patient; + late PatiantInformtion patient; LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); bool isFromSearch = false; @@ -52,16 +52,16 @@ class _PatientProfileScreenState extends State with Single bool isDischargedPatient = false; bool isSearchAndOut = false; bool isCallStarted = false; - String patientType; - String arrivalType; - String from; - String to; - TabController _tabController; + String? patientType; + String? arrivalType; + String? from; + String? to; + late TabController _tabController; int index = 0; int _activeTab = 0; - StreamController videoCallDurationStreamController; - Stream videoCallDurationStream = (() async* {})(); + late StreamController videoCallDurationStreamController; + late Stream videoCallDurationStream; @override void initState() { @@ -76,14 +76,14 @@ class _PatientProfileScreenState extends State with Single _tabController.dispose(); super.dispose(); if (isFromLiveCare) { - _liveCareViewModel.removePatientFromDoctorList(patient.vcId); + _liveCareViewModel.removePatientFromDoctorList(patient.vcId!); } } @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']; @@ -117,7 +117,7 @@ class _PatientProfileScreenState extends State with Single _activeTab = 1; } - StreamSubscription callTimer; + late StreamSubscription callTimer; callConnected() { callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) @@ -132,7 +132,7 @@ class _PatientProfileScreenState extends State with Single callDisconnected() { callTimer.cancel(); - videoCallDurationStreamController.sink.add(null); + videoCallDurationStreamController.sink.add(""); setState(() { isCallStarted = false; @@ -145,7 +145,7 @@ class _PatientProfileScreenState extends State with Single ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { - if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); + if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId!); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -158,7 +158,7 @@ class _PatientProfileScreenState extends State with Single children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, + PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!, videoCallDurationStream: videoCallDurationStream, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, @@ -199,12 +199,12 @@ class _PatientProfileScreenState extends State with Single ) : ProfileGridForOther( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: patientType!, + arrivalType: arrivalType!, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, - from: from, - to: to, + from: from!, + to: to!, projectViewModel: projectViewModel, ), ), @@ -247,7 +247,7 @@ class _PatientProfileScreenState extends State with Single : AppGlobal.appRedColor, fontColor: Colors.white, // vPadding: 8, - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, hPadding: 25, fontWeight: FontWeight.normal, @@ -275,7 +275,7 @@ class _PatientProfileScreenState extends State with Single : AppGlobal.appRedColor, fontColor: Colors.white, // vPadding: 8, - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, hPadding: 25, fontWeight: FontWeight.normal, @@ -349,7 +349,7 @@ class _PatientProfileScreenState extends State with Single ); } else { GifLoaderDialogUtils.showMyDialog(context); - await model.startCall(isReCall: false, vCID: patient.vcId); + await model.startCall(isReCall: false, vCID: patient.vcId!); if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); @@ -367,7 +367,7 @@ class _PatientProfileScreenState extends State with Single context: context, onTapGrant: () { locator() - .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, callDisconnected); + .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording! : true, callConnected, callDisconnected); }); } } @@ -382,19 +382,19 @@ class _PatientProfileScreenState extends State with Single ], ), ) - : null, + : SizedBox(), ), ); } - createEpisode({PatiantInformtion patient, SOAPViewModel model}) async { + createEpisode({required PatiantInformtion patient, required SOAPViewModel model}) async { await locator().logEvent( eventCategory: "Patient Profile", eventAction: "Create Episode", ); GifLoaderDialogUtils.showMyDialog(context); - if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { - PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId); + if (patient.admissionNo != null && patient.admissionNo!.isNotEmpty) { + PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo!), patientID: patient.patientId); await model.postEpisodeForInPatient(postEpisodeReqModel); } else { PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); 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 f9ea94a0..e9e03576 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 @@ -11,16 +11,18 @@ import '../../../../routes.dart'; // ignore: must_be_immutable class ProfileGridForOther extends StatelessWidget { final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final double height; + final String? patientType; + final String? arrivalType; + final double? height; final bool isInpatient; final bool isFromLiveCare; - String from; - String to; + String? from; + String? to; ProjectViewModel projectViewModel; - ProfileGridForOther({Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to, this.isFromLiveCare, this.projectViewModel}) : super(key: key); + ProfileGridForOther( + {Key? key, required this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to, this.isFromLiveCare = false, required this.projectViewModel}) + : super(key: key); @override Widget build(BuildContext context) { @@ -61,7 +63,7 @@ class ProfileGridForOther extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, isDisable: - Utils.isVidaPlusProject(projectViewModel, patient.projectId) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null), + Utils.isVidaPlusProject(projectViewModel, patient.projectId!) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null), ]; return Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index f6989964..9aae0cdd 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -10,22 +10,21 @@ import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-prof 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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; import '../../../../locator.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - final String patientType; - final String arrivalType; + final String? patientType; + final String? arrivalType; final bool isInpatient; final bool isVidaPlus; - RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false}); + RadiologyDetailsPage({Key? key, required this.finalRadiology, required this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false}); @override Widget build(BuildContext context) { @@ -35,16 +34,17 @@ class RadiologyDetailsPage extends StatelessWidget { patient: patient, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, - invoiceType:finalRadiology.invoiceType, + invoiceType: finalRadiology.invoiceType!, invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, - isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID, - + isVidaPlus: Utils.isVidaPlusProject( + projectViewModel, + finalRadiology.projectID, ), ), builder: (_, model, widget) => AppScaffold( appBar: PatientProfileAppBar( patient, - appointmentDate: finalRadiology.orderDate, + appointmentDate: finalRadiology.orderDate!, doctorName: finalRadiology.doctorName, clinic: finalRadiology.clinicDescription, branch: finalRadiology.projectName, @@ -111,13 +111,13 @@ class RadiologyDetailsPage extends StatelessWidget { eventCategory: "RadiologyDetailsPage", eventAction: "Open Radiology Image", ); - launch(model.radImageURL); + launchUrlString(model.radImageURL); }, title: TranslationBase.of(context).openRad, ), ), ) - : null, + : SizedBox(), ), ); } diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index cc419e06..3a2f40ef 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -26,16 +25,16 @@ class RadiologyHomePage extends StatefulWidget { } class _RadiologyHomePageState extends State { - String patientType; - PatiantInformtion patient; - String arrivalType; - bool isInpatient; - bool isFromLiveCare; + String? patientType; + late PatiantInformtion patient; + String? arrivalType; + bool isInpatient = false; + bool isFromLiveCare = false; @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']; @@ -51,7 +50,7 @@ class _RadiologyHomePageState extends State { onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileAppBar( patient, @@ -114,9 +113,9 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index].isLiveCareAppodynamicment + color: model.radiologyList[index].isLiveCareAppodynamicment! ? Colors.red[900] - : !model.radiologyList[index].isInOutPatient + : !model.radiologyList[index].isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -129,9 +128,9 @@ class _RadiologyHomePageState extends State { quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index].isLiveCareAppodynamicment + model.radiologyList[index].isLiveCareAppodynamicment! ? TranslationBase.of(context).liveCare.toUpperCase() - : !model.radiologyList[index].isInOutPatient + : !model.radiologyList[index].isInOutPatient! ? TranslationBase.of(context).inPatientLabel.toUpperCase() : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), diff --git a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart index f33ec6bc..542b182b 100644 --- a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart @@ -54,7 +54,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { Expanded( child: AppText( (Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), - fontSize: SizeConfig.textMultiplier * 2.5, + fontSize: SizeConfig.textMultiplier! * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), @@ -121,8 +121,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { AppText( TranslationBase.of(context).viewProfile, fontWeight: FontWeight.w700, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Colors.red[700], + fontSize: 1.7 * SizeConfig.textMultiplier!, + color: Colors.red[700]!, ) ], ), @@ -137,21 +137,21 @@ class ReferredPatientDetailScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - referredPatient.referralStatusDesc, + referredPatient.referralStatusDesc!, fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier!, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 ? AppGlobal.appGreenColor - : Colors.red[700], + : Colors.red[700]!, ), AppText( - AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"), + AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier!, color: Color(0XFF28353E), ) ], @@ -166,7 +166,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), AppText( @@ -179,10 +179,10 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), AppText( - AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"), + AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "hh:mm a"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ) ], @@ -201,12 +201,12 @@ class ReferredPatientDetailScreen extends StatelessWidget { "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.referralClinicDescription, + referredPatient.referralClinicDescription!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 13, @@ -224,12 +224,12 @@ class ReferredPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.frequencyDescription, + referredPatient.frequencyDescription!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 14, @@ -244,19 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { Row( children: [ AppText( - referredPatient.nationalityName != null ? referredPatient.nationalityName : "", + referredPatient.nationalityName != null ? referredPatient.nationalityName! : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier!, ), referredPatient.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.nationalityFlagURL, + referredPatient.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -274,11 +274,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).priority + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), AppText( - referredPatient.priorityDescription, + referredPatient.priorityDescription!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 14, @@ -295,15 +295,15 @@ class ReferredPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).maxResponseTime + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '', + referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime!, "dd MMM,yyyy") : '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ), @@ -327,10 +327,10 @@ 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) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -352,14 +352,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier!, color: Colors.black, ), AppText( - referredPatient.referralClinicDescription, + referredPatient.referralClinicDescription!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * SizeConfig.textMultiplier, + fontSize: 1.3 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ], @@ -399,14 +399,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).remarks, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 2.4 * SizeConfig.textMultiplier, + fontSize: 2.4 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), AppText( - referredPatient.referringDoctorRemarks, + referredPatient.referringDoctorRemarks!, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), SizedBox( @@ -422,10 +422,10 @@ 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) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -444,18 +444,18 @@ class ReferredPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).reply, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), AppText( referredPatient.referredDoctorRemarks == null ? '' - : referredPatient.referredDoctorRemarks.isNotEmpty - ? referredPatient.referredDoctorRemarks + : referredPatient.referredDoctorRemarks!.isNotEmpty + ? referredPatient.referredDoctorRemarks! : TranslationBase.of(context).notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ], @@ -480,7 +480,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { vPadding: 12, disabled: referredPatient.referredDoctorRemarks == null ? true - : referredPatient.referredDoctorRemarks.isNotEmpty + : 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 af217257..266cfc87 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 @@ -2,27 +2,25 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.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/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -33,7 +31,7 @@ class AddAssessmentDetails extends StatefulWidget { final PatiantInformtion patientInfo; final bool isUpdate; - AddAssessmentDetails({Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); + AddAssessmentDetails({Key? key, required this.mySelectedAssessment, required this.addSelectedAssessment, required this.patientInfo, this.isUpdate = false, required this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -57,12 +55,12 @@ class _AddAssessmentDetailsState extends State { appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); if (widget.isUpdate) { if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) - conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + conditionController.text = projectViewModel.isArabic ? 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; + typeController.text = projectViewModel.isArabic ? 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}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon, String? validationError}) { return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), @@ -119,23 +117,25 @@ class _AddAssessmentDetailsState extends State { isTextFieldHasSuffix: false, enabled: false, controller: appointmentIdController, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), ), SizedBox( height: 10, ), - Column( - children:[ InkWell( + Column(children: [ + InkWell( onTap: model.listOfICD10 != null ? () { setState(() { widget.mySelectedAssessment.selectedICD = null; - icdNameController.text = null; + icdNameController.text = 'null'; }); } : null, child: AppTextFieldCustom( - onChanged: (text){ + onChanged: (text) { setState(() { icdNameController.text; }); @@ -143,11 +143,11 @@ class _AddAssessmentDetailsState extends State { height: Utils.getTextFieldHeight(), onClick: model.listOfICD10 != null ? () { - setState(() { - widget.mySelectedAssessment.selectedICD = null; - icdNameController.text = null; - }); - } + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = 'null'; + }); + } : null, hintText: TranslationBase.of(context).nameOrICD, maxLines: 1, @@ -169,77 +169,74 @@ class _AddAssessmentDetailsState extends State { Icons.search, color: Colors.grey.shade600, )), + onFieldSubmitted: () {}, )), - model.listOfICD10.length >0 && icdNameController.text.isNotEmpty ? Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, - child:ListView.builder( - shrinkWrap: true, - itemCount: model.listOfICD10.length, - itemBuilder: (context, index) { - return InkWell(child:ListTile( - title: AppText( model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)), - onTap: (){ - - widget.mySelectedAssessment.selectedICD = model.listOfICD10[index]; - icdNameController.text = model.listOfICD10[index].description; - model.listOfICD10.clear(); - setState(() { - + model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty + ? Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, + child: ListView.builder( + shrinkWrap: true, + itemCount: model.listOfICD10.length, + itemBuilder: (context, index) { + return InkWell( + child: ListTile(title: AppText(model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)), + onTap: () { + widget.mySelectedAssessment.selectedICD = model.listOfICD10[index]; + icdNameController.text = model.listOfICD10[index].description; + model.listOfICD10.clear(); + setState(() {}); }); - } - ); - - }, - )) :SizedBox() - // CustomAutoCompleteTextField( - // isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // mainAxisSize: MainAxisSize.min, - // children: [ - // AutoCompleteTextField( - // decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null), - // controller: icdNameController, - // itemSubmitted: (item) => setState(() { - // widget.mySelectedAssessment.selectedICD = item; - // // icdNameController.text = '${item.code.trim()}/${item.description}'; - // icdNameController.text = '${item.description}'; - // }), - // key: key, - // suggestions: model.listOfICD10, - // suggestionsAmount: model.listOfICD10.length, - // itemBuilder: (context, suggestion) => - // new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)), - // itemSorter: (a, b) => 1, - // itemFilter: (suggestion, input) => - // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - // // suggestion.code.toLowerCase().startsWith(input.toLowerCase()), - // suggestion.description.toLowerCase().contains(input.toLowerCase()) || - // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - // suggestion.code.toLowerCase().contains(input.toLowerCase()), - // - // ), - // Expanded( - // child: IconButton( - // onPressed: () { - // print(icdNameController.text); - // if (icdNameController.text.length <= 3) { - // DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); - // } else { - // model.listOfICD10.clear(); - // model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); - // } - // }, - // icon: Icon(Icons.search), - // ), - // ), - // ], - // ), - // ) - + }, + )) + : SizedBox() + // CustomAutoCompleteTextField( + // isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // mainAxisSize: MainAxisSize.min, + // children: [ + // AutoCompleteTextField( + // decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null), + // controller: icdNameController, + // itemSubmitted: (item) => setState(() { + // widget.mySelectedAssessment.selectedICD = item; + // // icdNameController.text = '${item.code.trim()}/${item.description}'; + // icdNameController.text = '${item.description}'; + // }), + // key: key, + // suggestions: model.listOfICD10, + // suggestionsAmount: model.listOfICD10.length, + // itemBuilder: (context, suggestion) => + // new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)), + // itemSorter: (a, b) => 1, + // itemFilter: (suggestion, input) => + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // // suggestion.code.toLowerCase().startsWith(input.toLowerCase()), + // suggestion.description.toLowerCase().contains(input.toLowerCase()) || + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // suggestion.code.toLowerCase().contains(input.toLowerCase()), + // + // ), + // Expanded( + // child: IconButton( + // onPressed: () { + // print(icdNameController.text); + // if (icdNameController.text.length <= 3) { + // DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); + // } else { + // model.listOfICD10.clear(); + // model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); + // } + // }, + // icon: Icon(Icons.search), + // ), + // ), + // ], + // ), + // ) ]), if (widget.mySelectedAssessment.selectedICD != null) Column( @@ -250,7 +247,7 @@ class _AddAssessmentDetailsState extends State { Container( width: MediaQuery.of(context).size.width * 0.7, child: AppText( - widget.mySelectedAssessment.selectedICD.description + (' (${widget.mySelectedAssessment.selectedICD.code} )'), + widget.mySelectedAssessment.selectedICD!.description + (' (${widget.mySelectedAssessment.selectedICD!.code} )'), color: Color(0xFF575757), fontSize: 10, fontWeight: FontWeight.w700, @@ -269,12 +266,12 @@ class _AddAssessmentDetailsState extends State { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisCondition, okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition!, okFunction: (MasterKeyModel selectedValue) { setState(() { widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; conditionController.text = - projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn!; }); }, ); @@ -295,6 +292,8 @@ class _AddAssessmentDetailsState extends State { enabled: false, hasBorder: true, validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 10, @@ -306,11 +305,11 @@ class _AddAssessmentDetailsState extends State { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisType, okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisType!, okFunction: (MasterKeyModel selectedValue) { setState(() { widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; - typeController.text = projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn; + typeController.text = projectViewModel.isArabic ? selectedValue.nameAr! : selectedValue.nameEn!; }); }, ); @@ -331,6 +330,8 @@ class _AddAssessmentDetailsState extends State { controller: typeController, hasBorder: true, validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 10, @@ -346,10 +347,11 @@ class _AddAssessmentDetailsState extends State { onChanged: (value) { widget.mySelectedAssessment.remark = remarkController.text; }, + onFieldSubmitted: () {}, ), ), SizedBox( - height: SizeConfig.heightMultiplier * + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightShort @@ -386,7 +388,7 @@ class _AddAssessmentDetailsState extends State { ); } - submitAssessment({SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { + submitAssessment({required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { GifLoaderDialogUtils.showMyDialog(context); if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( @@ -395,14 +397,14 @@ class _AddAssessmentDetailsState extends State { 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 { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( patientMRN: widget.patientInfo.patientMRN, @@ -414,9 +416,9 @@ class _AddAssessmentDetailsState extends State { new IcdCodeDetails( 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); } @@ -424,10 +426,10 @@ class _AddAssessmentDetailsState extends State { if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; 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 74b9a1f4..56333f4c 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 @@ -1,17 +1,17 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.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:flutter/material.dart'; @@ -30,7 +30,7 @@ class UpdateAssessmentPage extends StatefulWidget { final Function changeLoadingState; final int currentIndex; - UpdateAssessmentPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); + UpdateAssessmentPage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -38,7 +38,7 @@ class UpdateAssessmentPage extends StatefulWidget { class _UpdateAssessmentPageState extends State implements AssessmentCallBack { bool isAssessmentExpand = false; - List mySelectedAssessmentList = List(); + List mySelectedAssessmentList = []; @override Widget build(BuildContext context) { @@ -53,17 +53,17 @@ class _UpdateAssessmentPageState extends State implements if (model.patientAssessmentList.isNotEmpty) { model.patientAssessmentList.forEach((element) { - MasterKeyModel diagnosisType = model.getOneMasterKey( + MasterKeyModel? diagnosisType = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisType, id: element.diagnosisTypeID, ); - MasterKeyModel selectedICD = model.getOneMasterKey( + MasterKeyModel? selectedICD = model.getOneMasterKey( masterKeys: MasterKeysService.ICD10, id: element.icdCode10ID, ); - MasterKeyModel diagnosisCondition = model.getOneMasterKey( + MasterKeyModel? diagnosisCondition = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisCondition, - id: element.conditionID, + id: element.conditionID!, ); if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment( @@ -145,7 +145,7 @@ class _UpdateAssessmentPageState extends State implements new TextSpan( text: "ICD : ".toUpperCase(), ), - new TextSpan(text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.code.trim().toUpperCase() ?? "" : ""), + new TextSpan(text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD!.code.trim().toUpperCase() ?? "" : ""), ], ), ), @@ -154,13 +154,13 @@ class _UpdateAssessmentPageState extends State implements children: [ AppText( assessment.createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn), isMonthShort: true) + ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn!), isMonthShort: true) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight.w600, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, ), AppText( - assessment.createdOn != null ? AppDateUtils.getHour(DateTime.parse(assessment.createdOn)) : AppDateUtils.getHour(DateTime.now()), + assessment.createdOn != null ? AppDateUtils.getHour(DateTime.parse(assessment.createdOn!)) : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, color: Color(0xFF575757), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, @@ -191,7 +191,7 @@ class _UpdateAssessmentPageState extends State implements ), children: [ new TextSpan( - text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.description.toString() : "", + text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD!.description.toString() : "", // text: assessment.selectedICD.description.toString(), ), ], @@ -239,7 +239,7 @@ class _UpdateAssessmentPageState extends State implements ), ), new TextSpan( - text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition.nameAr : assessment.selectedDiagnosisCondition.nameEn, + text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition!.nameAr : assessment.selectedDiagnosisCondition!.nameEn, style: new TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, @@ -262,7 +262,7 @@ class _UpdateAssessmentPageState extends State implements ), ), new TextSpan( - text: projectViewModel.isArabic ? assessment.selectedDiagnosisType.nameAr : assessment.selectedDiagnosisType.nameEn, + text: projectViewModel.isArabic ? assessment.selectedDiagnosisType!.nameAr : assessment.selectedDiagnosisType!.nameEn, style: new TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, @@ -358,7 +358,7 @@ class _UpdateAssessmentPageState extends State implements ); } - openAssessmentDialog(BuildContext context, {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { + openAssessmentDialog(BuildContext context, {MySelectedAssessment? assessment, bool isUpdate = false, required SOAPViewModel model}) { if (assessment == null) { assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo); } @@ -368,7 +368,7 @@ class _UpdateAssessmentPageState extends State implements context: context, builder: (context) { return AddAssessmentDetails( - mySelectedAssessment: assessment, + mySelectedAssessment: assessment!, patientInfo: widget.patientInfo, isUpdate: isUpdate, mySelectedAssessmentList: mySelectedAssessmentList, 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 451fd5d8..629681b1 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 @@ -3,16 +3,16 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.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/transitions/fade_page.dart'; @@ -31,7 +31,7 @@ class UpdateObjectivePage extends StatefulWidget { final int currentIndex; final PatiantInformtion patientInfo; - UpdateObjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); + UpdateObjectivePage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -39,7 +39,7 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; - List mySelectedExamination = List(); + List mySelectedExamination = []; BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( @@ -66,7 +66,7 @@ class _UpdateObjectivePageState extends State implements Ob await model.getMasterLookup(MasterKeysService.PhysicalExamination); } model.patientPhysicalExamList.forEach((element) { - MasterKeyModel examMaster = model.getOneMasterKey( + MasterKeyModel? examMaster = model.getOneMasterKey( masterKeys: MasterKeysService.PhysicalExamination, id: element.examId, ); @@ -135,7 +135,7 @@ class _UpdateObjectivePageState extends State implements Ob .sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { - removeExamination(examination.selectedExamination); + removeExamination(examination.selectedExamination!); }); }).toList(), ), @@ -155,7 +155,7 @@ class _UpdateObjectivePageState extends State implements Ob .sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { - removeExamination(examination.selectedExamination); + removeExamination(examination.selectedExamination!); }); }).toList(), ) @@ -164,7 +164,7 @@ class _UpdateObjectivePageState extends State implements Ob isExpanded: isSysExaminationExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 14 : 12), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 14 : 12), ) ], ), @@ -177,11 +177,11 @@ class _UpdateObjectivePageState extends State implements Ob submitUpdateObjectivePage(SOAPViewModel model) async { if (mySelectedExamination.isNotEmpty) { - if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { + if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) { Navigator.of(context).pop(); } else { widget.changeLoadingState(true); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); @@ -196,8 +196,8 @@ class _UpdateObjectivePageState extends State implements Ob createdOn: exam.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, @@ -213,12 +213,12 @@ class _UpdateObjectivePageState extends State implements Ob : "Not Examined", isNew: exam.isNew, ); - if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { - listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo); + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) { + listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo!); } else { listHisProgNotePhysicalExaminationVM.admissionNo = 0; } - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(listHisProgNotePhysicalExaminationVM); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(listHisProgNotePhysicalExaminationVM); }); if (model.patientPhysicalExamList.isEmpty) { @@ -230,12 +230,12 @@ class _UpdateObjectivePageState extends State implements Ob if (model.state == ViewState.ErrorLocal) { widget.changeLoadingState(false); Utils.showErrorToast(model.error); - if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) { // Navigator.of(context).pop(); model.isAddExamInProgress = false; } } else { - if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo!.isNotEmpty) { // Navigator.of(context).pop(); widget.changeLoadingState(false); model.isAddExamInProgress = false; @@ -251,7 +251,7 @@ class _UpdateObjectivePageState extends State implements Ob } removeExamination(MasterKeyModel masterKey) { - Iterable history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); + Iterable history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId); if (history.length > 0) { setState(() { @@ -276,7 +276,7 @@ class _UpdateObjectivePageState extends State implements Ob setState(() { { mySelectedExaminationLocal.forEach((element) { - if ((mySelectedExamination.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { + if ((mySelectedExamination.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) { mySelectedExamination.insert(0, element); } }); @@ -284,13 +284,13 @@ class _UpdateObjectivePageState extends State implements Ob /// remove items. List removedList = []; mySelectedExamination.forEach((element) { - if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { + if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) { removedList.add(element); } }); removedList.forEach((element) { - removeExamination(element.selectedExamination); + removeExamination(element.selectedExamination!); }); Navigator.of(context).pop(); } 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 ae472115..297131cb 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 @@ -30,7 +30,14 @@ class UpdatePlanPage extends StatefulWidget { final int currentIndex; - UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex, this.sOAPViewModel, this.changeStateFun}); + UpdatePlanPage( + {Key? key, + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex, + required this.sOAPViewModel, + required this.changeStateFun}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -76,7 +83,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack ///TODO set progressNote in model; if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote!); patientProgressNote.planNote = progressNoteController.text; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; @@ -106,7 +113,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote!); patientProgressNote.planNote = progressNoteController.text; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; @@ -169,6 +176,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack widget.changeStateFun(); }); }, + onFieldSubmitted: () {}, ), ), SizedBox( @@ -206,7 +214,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack ), AppText( patientProgressNote.createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn)) + ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn!)) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight.w600, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, @@ -230,7 +238,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack // ], // ), AppText( - patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn)) : AppDateUtils.getHour(DateTime.now()), + patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn!)) : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, color: Color(0xFF575757), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, @@ -272,7 +280,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack isExpanded: isProgressExpanded, ), SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -291,14 +299,14 @@ class _UpdatePlanPageState extends State implements PlanCallBack appointmentNo: widget.patientInfo.appointmentNo, planNote: patientProgressNote.planNote, doctorID: widget.patientInfo.doctorId, - createdBy:widget.patientInfo.doctorId , - createdByName:widget.patientInfo.doctorName , + createdBy: widget.patientInfo.doctorId, + createdByName: widget.patientInfo.doctorName, editedBy: ''); if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel); } else { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel); @@ -315,7 +323,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack doctorID: ''); await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote!); patientProgressNote.planNote = progressNoteController.text; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; @@ -331,7 +339,6 @@ class _UpdatePlanPageState extends State implements PlanCallBack Navigator.of(context).pop(); Utils.showErrorToast("Episode Created Successfully"); - } widget.changeLoadingState(false); } else { diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index 5100c613..82b4e653 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -9,7 +9,7 @@ class SoapUtils { return mySelectedHistory; } - static MySelectedAllergy generateMySelectedAllergy({allergy, allergySeverity, isChecked = false, remark, isLocal = true, int createdBy, bool isExpanded = false}) { + static MySelectedAllergy generateMySelectedAllergy({allergy, allergySeverity, isChecked = false, remark, isLocal = true, int createdBy = 0, bool isExpanded = false}) { MySelectedAllergy mySelectedAllergy = MySelectedAllergy(selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, isChecked: isChecked, remark: remark, isLocal: isLocal, createdBy: createdBy, isExpanded: isExpanded); return mySelectedAllergy; 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 652a1bbb..9fc7e111 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 @@ -1,15 +1,12 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart'; @@ -77,7 +74,7 @@ class _AddAllergiesState extends State { }, addSelectedAllergy: () { setState(() { - widget.addAllergiesFun(myAllergiesListLocal); + widget.addAllergiesFun!(myAllergiesListLocal); }); }, isServiceSelected: (master) => isServiceSelected(master), @@ -105,7 +102,7 @@ class _AddAllergiesState extends State { label: TranslationBase.of(context).addAllergies, onTap: () { setState(() { - widget.addAllergiesFun(myAllergiesListLocal); + widget.addAllergiesFun!(myAllergiesListLocal); }); }, ), @@ -114,7 +111,7 @@ class _AddAllergiesState extends State { isServiceSelected(MasterKeyModel masterKey) { Iterable allergy = - myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); + myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy!.id && masterKey.typeId == element.selectedAllergy!.typeId && element.isChecked); if (allergy.length > 0) { return true; } @@ -122,16 +119,16 @@ class _AddAllergiesState extends State { } removeAllergyFromLocalList(MasterKeyModel masterKey) { - myAllergiesListLocal.removeWhere((element) => element.selectedAllergy.id == masterKey.id); + myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id); } MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { Iterable allergy = - myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); + myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy!.id && masterKey.typeId == element.selectedAllergy!.typeId && element.isChecked); if (allergy.length > 0) { return allergy.first; } - return null; + return MySelectedAllergy(); } addAllergyLocally(MySelectedAllergy mySelectedAllergy) { @@ -141,7 +138,7 @@ class _AddAllergiesState extends State { setState(() { List allergy = // ignore: missing_return - myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id).toList(); + myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id).toList(); if (allergy.isEmpty) { myAllergiesListLocal.add(mySelectedAllergy); diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index fb8043cb..e1b84cab 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -1,13 +1,12 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'allergies_item.dart'; @@ -21,20 +20,20 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; final List masterList; - final String buttonName; - final String hintSearchText; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchAllergiesWidget( - {Key key, - this.model, - this.addSelectedAllergy, - this.removeAllergy, - this.masterList, - this.addAllergy, - this.isServiceSelected, + {Key? key, + required this.model, + required this.addSelectedAllergy, + required this.removeAllergy, + required this.masterList, + required this.addAllergy, + required this.isServiceSelected, this.buttonName, this.hintSearchText, - this.getServiceSelectedAllergy}) + required this.getServiceSelectedAllergy}) : super(key: key); @override @@ -42,7 +41,8 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { } class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { - List items = List(); + List items = []; + TextEditingController filteredSearchController = TextEditingController(); @override @@ -72,10 +72,14 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState extends State dummySearchList = List(); + 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); } }); 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 2a9f14c4..7f9e25a3 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 @@ -2,13 +2,13 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -26,25 +26,25 @@ class AddMedication extends StatefulWidget { final Function addMedicationFun; TextEditingController medicationController; - AddMedication({Key key, this.addMedicationFun, this.medicationController}) : super(key: key); + AddMedication({Key? key, required this.addMedicationFun, required this.medicationController}) : super(key: key); @override _AddMedicationState createState() => _AddMedicationState(); } class _AddMedicationState extends State { - MasterKeyModel _selectedMedicationDose; - MasterKeyModel _selectedMedicationStrength; - MasterKeyModel _selectedMedicationRoute; - MasterKeyModel _selectedMedicationFrequency; + MasterKeyModel _selectedMedicationDose = MasterKeyModel(); + MasterKeyModel _selectedMedicationStrength = MasterKeyModel(); + MasterKeyModel _selectedMedicationRoute = MasterKeyModel(); + MasterKeyModel _selectedMedicationFrequency = MasterKeyModel(); TextEditingController doseController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); - GetMedicationResponseModel _selectedMedication; + GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel(); - GlobalKey key = new GlobalKey>(); + GlobalKey> key = new GlobalKey>(); bool isFormSubmitted = false; @override @@ -74,7 +74,7 @@ class _AddMedicationState extends State { child: Column( children: [ SizedBox( - height: SizeConfig.heightMultiplier * + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 2 : SizeConfig.isHeightShort @@ -87,7 +87,7 @@ class _AddMedicationState extends State { onTap: model.allMedicationList != null ? () { setState(() { - _selectedMedication = null; + _selectedMedication = GetMedicationResponseModel(); }); } : null, @@ -95,32 +95,36 @@ class _AddMedicationState extends State { ? CustomAutoCompleteTextField( isShowError: isFormSubmitted && _selectedMedication == null, child: AutoCompleteTextField( - decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, null, true, suffixIcon: Icons.search), + decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search), itemSubmitted: (item) => setState(() => _selectedMedication = item), key: key, suggestions: model.allMedicationList, - itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description + '/' + suggestion.genericName), padding: EdgeInsets.all(8.0)), + itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => - suggestion.genericName.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.keywords.toLowerCase().startsWith(input.toLowerCase()), + suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()), ), ) : AppTextFieldCustom( height: Utils.getTextFieldHeight(), hintText: _selectedMedication != null - ? _selectedMedication.description + (' (${_selectedMedication.genericName} )') + ? _selectedMedication.description! + (' (${_selectedMedication.genericName} )') : TranslationBase.of(context).searchMedicineNameHere, minLines: 1, maxLines: 1, isTextFieldHasSuffix: true, suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + ), + onPressed: () {}, + ), enabled: false, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), ), ), @@ -133,7 +137,7 @@ class _AddMedicationState extends State { Container( width: MediaQuery.of(context).size.width * 0.7, child: AppText( - _selectedMedication.description + (' (${_selectedMedication.genericName} )'), + _selectedMedication.description! + (' (${_selectedMedication.genericName} )'), color: Color(0xFF575757), fontSize: 10, fontWeight: FontWeight.w700, @@ -158,7 +162,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationDose = selectedValue; - doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr : _selectedMedicationDose.nameEn; + doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr! : _selectedMedicationDose.nameEn!; }); }, ); @@ -177,6 +181,8 @@ class _AddMedicationState extends State { isTextFieldHasSuffix: true, controller: doseController, validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 5, @@ -195,7 +201,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationStrength = selectedValue; - strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr : _selectedMedicationStrength.nameEn; + strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr! : _selectedMedicationStrength.nameEn!; }); }, ); @@ -213,6 +219,8 @@ class _AddMedicationState extends State { minLines: 1, controller: strengthController, validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 5, @@ -234,7 +242,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationRoute = selectedValue; - routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr : _selectedMedicationRoute.nameEn; + routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr! : _selectedMedicationRoute.nameEn!; }); }, ); @@ -252,6 +260,8 @@ class _AddMedicationState extends State { minLines: 1, controller: routeController, validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( height: 5, @@ -271,7 +281,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationFrequency = selectedValue; - frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr : _selectedMedicationFrequency.nameEn; + frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr! : _selectedMedicationFrequency.nameEn!; }); }, ); @@ -291,9 +301,11 @@ class _AddMedicationState extends State { isTextFieldHasSuffix: true, controller: frequencyController, validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : null, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), SizedBox( - height: SizeConfig.heightMultiplier * + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightShort 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 37b25b3a..e74f6e40 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 @@ -44,7 +44,7 @@ class _UpdateMedicationWidgetState extends State { builder: (context) { return AddMedication( addMedicationFun: (MySelectedAllergy mySelectedAllergy) {}, - medicationController: widget.medicationController, + medicationController: widget.medicationController!, ); }); } 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 de4fa392..68fbd6b1 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 @@ -1,15 +1,15 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -25,7 +25,7 @@ class UpdateSubjectivePage extends StatefulWidget { final PatiantInformtion patientInfo; final int currentIndex; - UpdateSubjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); + UpdateSubjectivePage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -40,15 +40,15 @@ class _UpdateSubjectivePageState extends State implements TextEditingController medicationController = TextEditingController(); final formKey = GlobalKey(); - List myAllergiesList = List(); - List myHistoryList = List(); + List myAllergiesList = []; + List myHistoryList = []; getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); if (model.patientHistoryList.isNotEmpty) { model.patientHistoryList.forEach((element) { if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); @@ -58,7 +58,7 @@ class _UpdateSubjectivePageState extends State implements } } if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); @@ -68,7 +68,7 @@ class _UpdateSubjectivePageState extends State implements } } if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); @@ -78,7 +78,7 @@ class _UpdateSubjectivePageState extends State implements } } if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); @@ -94,7 +94,7 @@ class _UpdateSubjectivePageState extends State implements getAllergies(SOAPViewModel model) async { if (model.patientAllergiesList.isNotEmpty) { model.patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + MasterKeyModel? selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); @@ -102,11 +102,11 @@ class _UpdateSubjectivePageState extends State implements selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, id: element.severity, - ); + )!; } MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy( - allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); + allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy!, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); }); @@ -124,11 +124,13 @@ class _UpdateSubjectivePageState extends State implements if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint); - illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text = model.patientChiefComplaintList[0].currentMedication != null ? !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty - ? model.patientChiefComplaintList[0].currentMedication + '\n \n' - : model.patientChiefComplaintList[0].currentMedication : ""; + complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!); + illnessController.text = model.patientChiefComplaintList[0].hopi!; + medicationController.text = model.patientChiefComplaintList[0].currentMedication != null + ? !(model.patientChiefComplaintList[0].currentMedication!).isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication! + '\n \n' + : model.patientChiefComplaintList[0].currentMedication! + : ""; } if (widget.patientInfo.admissionNo == null) { await getHistory(model); @@ -174,7 +176,7 @@ class _UpdateSubjectivePageState extends State implements isExpanded: isChiefExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2), ), if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( @@ -191,7 +193,7 @@ class _UpdateSubjectivePageState extends State implements isExpanded: isHistoryExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2), ), if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( @@ -215,7 +217,7 @@ class _UpdateSubjectivePageState extends State implements isExpanded: isAllergiesExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -226,11 +228,11 @@ class _UpdateSubjectivePageState extends State implements ); } - addSubjectiveInfo({SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { + addSubjectiveInfo({required SOAPViewModel model, required List myAllergiesList, required List myHistoryList}) async { if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); - formKey.currentState.save(); - formKey.currentState.validate(); + formKey.currentState!.save(); + formKey.currentState!.validate(); model.complaintsControllerError = ''; model.medicationControllerError = ''; @@ -270,6 +272,6 @@ class _UpdateSubjectivePageState extends State implements @override Function nextFunction(model) { - addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList); + return addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList); } } diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index c493135e..be14191c 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -4,16 +4,16 @@ import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; class LineChartCurvedBloodPressureNew extends StatelessWidget { - final String title; - final List timeSeries1; - final List timeSeries2; - final int indexes; - final bool isOX; + final String? title; + final List? timeSeries1; + final List? timeSeries2; + final int? indexes; + final bool? isOX; LineChartCurvedBloodPressureNew({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) { @@ -39,7 +39,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget { right: 20, ), child: Text( - title, + title!, style: TextStyle( color: Colors.black, fontSize: 16, @@ -57,7 +57,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget { padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), - swapAnimationDuration: const Duration(milliseconds: 250), + duration: const Duration(milliseconds: 250), ), ), ), @@ -127,9 +127,9 @@ class LineChartCurvedBloodPressureNew 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); } } @@ -141,50 +141,70 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (touchEvent, LineTouchResponse touchResponse) {}, + touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), titlesData: FlTitlesData( - bottomTitles: SideTitles( - showTitles: true, - getTextStyles: (cxt, value) => const TextStyle( - color: Colors.black, - fontSize: 10, - ), - 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}'; - } 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}'; - if (xAxixs.contains(value.toInt())) { - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; - } - } - return ''; - }, - ), - leftTitles: SideTitles( - showTitles: true, - getTextStyles: (cxt, value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + // rotateAngle: -65, + reservedSize: 22, + getTitlesWidget: (value, meta) { + if (timeSeries1!.length < 15) { + if (timeSeries1!.length > value.toInt()) { + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + } else + return Text(""); + } else { + if (value.toInt() == 0) + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + if (value.toInt() == timeSeries1!.length - 1) + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + if (xAxixs.contains(value.toInt())) { + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + } + } + return Text(""); + }, + ), ), - interval: getMaxY() - getMinY() <= 500 - ? 50 - : getMaxY() - getMinY() <= 1000 - ? 100 - : 200, - margin: 12, - ), - ), + leftTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + interval: getMaxY() - getMinY() <= 500 + ? 50 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200, + reservedSize: 12, + ), + )), borderData: FlBorderData( show: true, border: const Border( @@ -204,7 +224,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries1.length - 1).toDouble(), + maxX: (timeSeries1!.length - 1).toDouble(), maxY: getMaxY() + 15, minY: getMinY() - 15, lineBarsData: getData(context), @@ -213,12 +233,12 @@ class LineChartCurvedBloodPressureNew 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; }); @@ -226,13 +246,13 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget { } double getMinY() { - double min = timeSeries1[0].sales; - timeSeries1.forEach((element) { - double resultValueDouble = element.sales; + double min = timeSeries1![0].sales!; + timeSeries1!.forEach((element) { + double resultValueDouble = element.sales!; if (resultValueDouble < min) min = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; + timeSeries2!.forEach((element) { + double resultValueDouble = element.sales!; if (resultValueDouble < min) min = resultValueDouble; }); @@ -242,20 +262,20 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget { } 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( spots: spots, isCurved: true, - colors: [Colors.red], + color: Colors.red, barWidth: 1.5, isStrokeCapRound: true, dotData: FlDotData( @@ -268,7 +288,7 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget { final LineChartBarData lineChartBarData2 = LineChartBarData( spots: spots2, isCurved: true, - colors: [Theme.of(context).primaryColor], + color: Theme.of(context).primaryColor, barWidth: 1.5, isStrokeCapRound: true, dotData: FlDotData( @@ -288,9 +308,8 @@ class LineChartCurvedBloodPressureNew extends StatelessWidget { border: Border.all( width: 1, // color: background // <--- border width here - ), + ), borderRadius: BorderRadius.circular(radius), ); } - } diff --git a/lib/screens/patients/profile/vital_sign/line_chart_curved.dart b/lib/screens/patients/profile/vital_sign/line_chart_curved.dart index c97c6041..51cc3bb9 100644 --- a/lib/screens/patients/profile/vital_sign/line_chart_curved.dart +++ b/lib/screens/patients/profile/vital_sign/line_chart_curved.dart @@ -7,13 +7,13 @@ import 'package:intl/intl.dart'; class LineChartCurved extends StatelessWidget { final String title; - final List timeSeries; + final List? timeSeries; final int indexes; - LineChartCurved({this.title, this.timeSeries, this.indexes}); + LineChartCurved({this.title = '', this.timeSeries, this.indexes = 0}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; // DateFormat format = DateFormat("yyyy-MM-dd"); DateFormat yearFormat = DateFormat("yyyy/MMM/dd"); @@ -46,7 +46,7 @@ class LineChartCurved extends StatelessWidget { children: [ AppText( title, - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig.textMultiplier! * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', textAlign: TextAlign.center, @@ -62,7 +62,7 @@ class LineChartCurved extends StatelessWidget { padding: const EdgeInsets.only(right: 18.0, left: 16.0), child: LineChart( sampleData1(context), - swapAnimationDuration: const Duration(milliseconds: 250), + duration: const Duration(milliseconds: 250), ), ), ), @@ -78,20 +78,20 @@ class LineChartCurved extends StatelessWidget { } getXaxix() { - for (int index = 0; index < timeSeries.length; index++) { + for (int index = 0; index < timeSeries!.length; index++) { int mIndex = indexes * index; - if (mIndex < timeSeries.length) { + 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!); } } } @@ -102,82 +102,73 @@ class LineChartCurved extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - //touchCallback: (LineTouchResponse touchResponse) {}, + touchCallback: (event, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( - bottomTitles: SideTitles( - showTitles: true, - getTextStyles: (context, value) { - return TextStyle( - color: Colors.black, - fontSize: 10, - ); - }, - rotateAngle: -65, - //rotateAngle:-65, - margin: 22, - getTitles: (value) { - if (timeSeries.length < 15) { - if (timeSeries.length > value.toInt()) { - DateTime dateTime = timeSeries[value.toInt()].time; - if (isDatesSameYear) { - return monthFormat.format(dateTime); + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + //rotateAngle: -65, + //rotateAngle:-65, + reservedSize: 22, + getTitlesWidget: (value, meta) { + if (timeSeries!.length < 15) { + if (timeSeries!.length > value.toInt()) { + DateTime dateTime = timeSeries![value.toInt()].time; + if (isDatesSameYear) { + return Text( + monthFormat.format(dateTime), + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + } else { + return Text( + yearFormat.format(dateTime), + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + } } else { - return yearFormat.format(dateTime); + return Text(''); } } else { - return ''; - } - } else { - if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { - DateTime dateTime = timeSeries[value.toInt()].time; - if (isDatesSameYear) { - return monthFormat.format(dateTime); - } else { - return yearFormat.format(dateTime); + if (value.toInt() == 0 || value.toInt() == timeSeries!.length - 1 || xAxixs.contains(value.toInt())) { + DateTime dateTime = timeSeries![value.toInt()].time; + if (isDatesSameYear) { + return Text( + monthFormat.format(dateTime), + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + } else { + return Text( + yearFormat.format(dateTime), + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + } } } - } - - /*if (timeSeries.length < 15) { - if (timeSeries.length > value.toInt()) { - DateTime dateTime = timeSeries[value.toInt()].time; - return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; - } else - return ''; - } else { - if (value.toInt() == 0) - return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; - if (value.toInt() == timeSeries.length - 1) - return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; - if (xAxixs.contains(value.toInt())) { - return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; - } - }*/ - return ''; - }, + return Text(''); + }, + ), ), - leftTitles: SideTitles( + leftTitles: AxisTitles( + sideTitles: SideTitles( showTitles: true, - getTextStyles: (cxt, value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), interval: getInterval(), - - // getTitles: (value) { - // if (value.toInt() == 0) - // return '${value.toInt()}'; - // else if (value.toInt() % horizontalInterval == 0) - // return '${value.toInt()}'; - // else - // return ''; - // }, - margin: 12, - ), + reservedSize: 12, + )), ), borderData: FlBorderData( show: true, @@ -198,7 +189,7 @@ class LineChartCurved extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries.length - 1).toDouble(), + maxX: (timeSeries!.length - 1).toDouble(), maxY: getMaxY() + getInterval(), minY: 0, lineBarsData: getData(context), @@ -236,8 +227,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; }); @@ -245,9 +236,9 @@ class LineChartCurved extends StatelessWidget { } double getMinY() { - double min = timeSeries[0].sales; - timeSeries.forEach((element) { - double resultValueDouble = element.sales; + double min = timeSeries![0].sales!; + timeSeries!.forEach((element) { + double resultValueDouble = element.sales!; if (resultValueDouble < min) min = resultValueDouble; }); int value = min.toInt(); @@ -256,21 +247,21 @@ class LineChartCurved extends StatelessWidget { } 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)); - if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) { + 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)) { isDatesSameYear = false; } - previousDateYear = timeSeries[index].time.year; + previousDateYear = timeSeries![index].time.year; } final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - colors: [Colors.red] /*[Theme.of(context).primaryColor]*/, + color: Colors.red /*[Theme.of(context).primaryColor]*/, barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( diff --git a/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart index ba983005..e843a4d1 100644 --- a/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart @@ -7,15 +7,15 @@ import 'package:flutter/material.dart'; class LineChartCurvedBloodPressure extends StatelessWidget { final String title; - final List timeSeries1; - final List timeSeries2; + final List? timeSeries1; + final List? timeSeries2; final int indexes; final bool isOX; - LineChartCurvedBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false}); + LineChartCurvedBloodPressure({this.title = '', this.timeSeries1, this.indexes = 0, this.timeSeries2, this.isOX = false}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; @override Widget build(BuildContext context) { @@ -40,7 +40,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { children: [ AppText( title, - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig.textMultiplier! * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', textAlign: TextAlign.center, @@ -56,7 +56,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), - swapAnimationDuration: const Duration(milliseconds: 250), + duration: const Duration(milliseconds: 250), ), ), ), @@ -107,9 +107,9 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } getXaxix() { - for (int index = 0; index < timeSeries1.length; index++) { + for (int index = 0; index < timeSeries1!.length; index++) { int mIndex = indexes * index; - if (mIndex < timeSeries1.length) { + if (mIndex < timeSeries1!.length) { xAxixs.add(mIndex); } } @@ -121,51 +121,73 @@ class LineChartCurvedBloodPressure extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - // touchCallback: (LineTouchResponse touchResponse) {}, + touchCallback: (event, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( - bottomTitles: SideTitles( + bottomTitles: AxisTitles( + sideTitles: SideTitles( showTitles: true, - getTextStyles: (context, value) { - return TextStyle( - color: Colors.black, - fontSize: 10, - ); - }, - rotateAngle: -65, + //rotateAngle: -65, //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}'; + reservedSize: 22, + getTitlesWidget: (value, meta) { + if (timeSeries1!.length < 15) { + if (timeSeries1!.length > value.toInt()) { + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); } else - return ''; + return Text(""); } 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}'; + if (value.toInt() == 0) + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); + if (value.toInt() == timeSeries1!.length - 1) + return Text('${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + )); if (xAxixs.contains(value.toInt())) { - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + return Text( + '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ); } } - return ''; + return Text(""); }, - ), - leftTitles: SideTitles( + )), + leftTitles: AxisTitles( + sideTitles: SideTitles( showTitles: true, - getTextStyles: (cxt, value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), interval: getInterval(), - getTitles: (value) { - return '${value.toInt()}'; + getTitlesWidget: (value, meta) { + return Text( + '${value.toInt()}', + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + ); }, - margin: 12, - ), + reservedSize: 12, + )), ), borderData: FlBorderData( show: true, @@ -203,8 +225,8 @@ 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; }); @@ -212,15 +234,16 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } double getMinY() { - double min = timeSeries1[0].sales; - timeSeries1.forEach((element) { - double resultValueDouble = element.sales; + double min = timeSeries1![0].sales!; + timeSeries1!.forEach((element) { + double resultValueDouble = element.sales!; if (resultValueDouble < min) min = resultValueDouble; }); int value = min.toInt(); return value.toDouble(); } + // double getMaxY() { // double max = 0; // timeSeries1.forEach((element) { @@ -252,20 +275,20 @@ class LineChartCurvedBloodPressure extends StatelessWidget { // } 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( spots: spots, isCurved: true, - colors: [Theme.of(context).primaryColor], + color: Theme.of(context).primaryColor, barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -278,7 +301,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final LineChartBarData lineChartBarData2 = LineChartBarData( spots: spots2, isCurved: true, - colors: [Colors.red], + color: Colors.red, barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -289,7 +312,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_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 85a29937..ff6d73cb 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 @@ -16,15 +16,15 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; class VitalSignDetailsScreen extends StatelessWidget { - int appointmentNo; - int projectID; + int? appointmentNo; + int? projectID; bool isNotOneAppointment; VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @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']; String arrivalType = routeArgs['arrivalType']; @@ -56,14 +56,14 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", - fontSize: SizeConfig.textMultiplier * 1.6, + "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s", + fontSize: SizeConfig.textMultiplier! * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), AppText( TranslationBase.of(context).vitalSign, - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier! * 3, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), ) @@ -90,7 +90,7 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", color: Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier! * 2.0, fontWeight: FontWeight.w700, ), Row( @@ -110,15 +110,15 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiUnderWeight}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, + fontSize: SizeConfig.textMultiplier! * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.transparent, fontWeight: FontWeight.w700, ), AppText( "(<18.5)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, + fontSize: SizeConfig.textMultiplier! * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.transparent, fontWeight: FontWeight.w700, ), ], @@ -138,17 +138,17 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).normal}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier! * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.transparent, ), ), AppText( "(18.5-24.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier! * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.transparent, ), ], )), @@ -166,16 +166,16 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiOverWeight}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, + fontSize: SizeConfig.textMultiplier! * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.transparent, ), AppText( "(25-29.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, + fontSize: SizeConfig.textMultiplier! * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.transparent, ), ], )), @@ -193,16 +193,16 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiObese}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier! * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.transparent, ), AppText( "(30-34.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier! * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.transparent, ), ], )), @@ -222,17 +222,17 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).bmiObeseExtreme}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier! * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.transparent, ), ), AppText( "(35<)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier! * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.transparent, ), ], )), 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 57a14675..c80e16c2 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 @@ -7,7 +7,6 @@ import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; -import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -18,18 +17,18 @@ import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { final vitalSignDetails pageKey; final String pageTitle; - List VSchart; + List? VSchart; PatiantInformtion patient; - String patientType; - String arrivalType; + String? patientType; + String? arrivalType; List timeSeriesData1 = []; List timeSeriesData2 = []; - final String viewKey1; - final String viewKey2; + final String? viewKey1; + final String? viewKey2; - VitalSignItemDetailsScreen({this.vitalList, this.pageKey, @required this.viewKey1, @required this.viewKey2, this.pageTitle, this.patient, this.patientType, this.arrivalType}); + VitalSignItemDetailsScreen({required this.vitalList, required this.pageKey, this.viewKey1, this.viewKey2, required this.pageTitle, required this.patient, this.patientType, this.arrivalType}); final List vitalList; @@ -205,15 +204,15 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", + "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: SizeConfig.textMultiplier! * 1.6, fontWeight: FontWeight.w600, ), AppText( TranslationBase.of(context).vitalSign, fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier! * 3, fontWeight: FontWeight.bold, ) ], @@ -223,7 +222,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { child: ListView( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - children: VSchart.map((chartInfo) { + children: VSchart!.map((chartInfo) { var vitalListTemp = vitalList.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); diff --git a/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart index 869e45a5..46904954 100644 --- a/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart +++ b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart @@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -55,10 +55,10 @@ class _DrugToDrug extends State { ? BaseView( onModelReady: (prescriptionViewModel) => prescriptionViewModel.getDrugToDrug(vitalSignsViewModel.patientVitalSigns, widget.listAssessment, soapViewModel.patientAllergiesList, widget.patient, widget.prescription), - builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, Widget child) => NetworkBaseView( + builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, Widget? child) => NetworkBaseView( baseViewModel: prescriptionViewModel, child: Container( - height: SizeConfig.realScreenHeight * .9, + height: SizeConfig.realScreenHeight! * .9, child: new ListView.builder( itemCount: expandableList.length, itemBuilder: (context, i) { @@ -73,11 +73,11 @@ class _DrugToDrug extends State { padding: EdgeInsets.all(10), child: AppText( item['comment'], - color: Colors.red[900], + color: Colors.red[900]!, )); }).toList()); })))) - : Container(height: SizeConfig.realScreenHeight * .45, child: GifLoaderContainer()); + : Container(height: SizeConfig.realScreenHeight! * .45, child: GifLoaderContainer()); } getTypeID() async { diff --git a/lib/screens/prescription/add_prescription/prescription_form_widget.dart b/lib/screens/prescription/add_prescription/prescription_form_widget.dart index cb4ebf06..12df2377 100644 --- a/lib/screens/prescription/add_prescription/prescription_form_widget.dart +++ b/lib/screens/prescription/add_prescription/prescription_form_widget.dart @@ -13,18 +13,18 @@ import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; +import 'package:doctor_app_flutter/utils/utils.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/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; + import '../../../widgets/transitions/slide_up_page.dart'; import 'add_drug/add_drug_widget.dart'; @@ -35,21 +35,22 @@ class PrescriptionFormWidget extends StatefulWidget { final MedicineViewModel medicineViewModel; final GetMedicationResponseModel selectedMedication; - const PrescriptionFormWidget({Key key, this.patient, this.prescriptionList, this.prescriptionViewModel, this.medicineViewModel, this.selectedMedication}); + const PrescriptionFormWidget( + {Key? key, required this.patient, required this.prescriptionList, required this.prescriptionViewModel, required this.medicineViewModel, required this.selectedMedication}); @override _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); } class _PrescriptionFormWidgetState extends State { - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; + String? routeError; + String? frequencyError; + String? doseTimeError; + String? durationError; + String? unitError; + String? strengthError; - int selectedType; + int? selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController unitController = TextEditingController(); @@ -60,7 +61,7 @@ class _PrescriptionFormWidgetState extends State { bool visibilitySearch = true; DateTime selectedDate = DateTime.now(); - int strengthChar; + int? strengthChar; GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); @@ -140,7 +141,7 @@ class _PrescriptionFormWidgetState extends State { child: Column( children: [ AppText( - widget.selectedMedication?.description ?? "", + widget.selectedMedication.description ?? "", fontWeight: FontWeight.w600, ), SizedBox( @@ -165,7 +166,7 @@ class _PrescriptionFormWidgetState extends State { value: 1, groupValue: selectedType, onChanged: (value) { - setSelectedType(value); + setSelectedType(value!); }, ), Text(TranslationBase.of(context).regular), @@ -186,7 +187,7 @@ class _PrescriptionFormWidgetState extends State { setState(() { strengthChar = value.length; }); - if (strengthChar >= 5) { + if (strengthChar! >= 5) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).only5DigitsAllowedForStrength, ); @@ -195,6 +196,7 @@ class _PrescriptionFormWidgetState extends State { inputType: TextInputType.numberWithOptions( decimal: true, ), + onFieldSubmitted: () {}, ), ), SizedBox( @@ -279,6 +281,8 @@ class _PrescriptionFormWidgetState extends State { child: AppTextFieldCustom( hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(), enabled: true, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), ), Container( @@ -288,6 +292,8 @@ class _PrescriptionFormWidgetState extends State { maxLines: 5, hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(), enabled: true, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), ), ], @@ -307,9 +313,12 @@ class _PrescriptionFormWidgetState extends State { Icons.calendar_today, color: Colors.black, ), + onPressed: () {}, ), dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, enabled: false, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), ), ), @@ -339,6 +348,8 @@ class _PrescriptionFormWidgetState extends State { isTextFieldHasSuffix: false, dropDownText: uom != null ? uom : null, enabled: false, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), ), SizedBox(height: spaceBetweenTextFields), @@ -349,6 +360,8 @@ class _PrescriptionFormWidgetState extends State { isTextFieldHasSuffix: false, dropDownText: box != null ? widget.medicineViewModel.boxQuintity.toString() : null, enabled: false, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), ), SizedBox(height: spaceBetweenTextFields), @@ -381,7 +394,7 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFields), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), child: Wrap( alignment: WrapAlignment.center, children: [ @@ -405,7 +418,7 @@ class _PrescriptionFormWidgetState extends State { Utils.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -440,7 +453,7 @@ class _PrescriptionFormWidgetState extends State { return; } - if (formKey.currentState.validate()) { + if (formKey.currentState!.validate()) { Navigator.push( context, SlideUpPageRoute( @@ -501,6 +514,6 @@ class _PrescriptionFormWidgetState extends State { } }); } - formKey.currentState.save(); + formKey.currentState!.save(); } } diff --git a/lib/screens/prescription/old_prescriptions_page.dart b/lib/screens/prescription/old_prescriptions_page.dart index 1b9ab395..9d01fd2b 100644 --- a/lib/screens/prescription/old_prescriptions_page.dart +++ b/lib/screens/prescription/old_prescriptions_page.dart @@ -13,7 +13,6 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../utils/utils.dart'; @@ -22,7 +21,7 @@ import '../../widgets/shared/errors/error_message.dart'; class OldPrescriptionsPage 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']; String arrivalType = routeArgs['arrivalType']; @@ -35,7 +34,7 @@ class OldPrescriptionsPage extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, appBar: PatientProfileAppBar( patient, isInpatient: isInpatient, @@ -81,13 +80,13 @@ class OldPrescriptionsPage extends StatelessWidget { child: Column( children: [ DoctorCard( - doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName), + doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName!), profileUrl: model.prescriptionsList[index].doctorImageURL, branch: model.prescriptionsList[index].name, clinic: model.prescriptionsList[index].clinicDescription, isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index].appointmentDate, + model.prescriptionsList[index].appointmentDate!, ), ), ], @@ -135,7 +134,7 @@ class OldPrescriptionsPage extends StatelessWidget { children: [ CustomRow( label: "", - value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription), + value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription!), valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), SizedBox( @@ -170,10 +169,10 @@ class OldPrescriptionsPage extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, startOn: AppDateUtils.getDateTimeFromServerFormat( - model.medicationForInPatient[index].startDatetime, + model.medicationForInPatient[index].startDatetime!, ), stopOn: AppDateUtils.getDateTimeFromServerFormat( - model.medicationForInPatient[index].stopDatetime, + model.medicationForInPatient[index].stopDatetime!, ), ), ), diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index b336bde3..35043771 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -4,26 +4,26 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; +import 'package:doctor_app_flutter/utils/utils.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/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -34,10 +34,10 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class PrescriptionCheckOutScreen extends StatefulWidget { final PrescriptionViewModel model; final PatiantInformtion patient; - final List prescriptionList; + final List? prescriptionList; final ProcedureTempleteDetailsModel groupProcedures; - const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); + const PrescriptionCheckOutScreen({Key? key, required this.model, required this.patient, this.prescriptionList, required this.groupProcedures}) : super(key: key); @override _PrescriptionCheckOutScreenState createState() => _PrescriptionCheckOutScreenState(); @@ -45,44 +45,44 @@ class PrescriptionCheckOutScreen extends StatefulWidget { class _PrescriptionCheckOutScreenState extends State { postPrescription( - {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 { + {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 { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = List(); + List prescriptionList = []; - postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.appointmentNo = patient!.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose), - itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit), - route: route.isEmpty ? 1 : int.parse(route), - frequency: frequency.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose!), + itemId: drugId!.isEmpty ? 1 : int.parse(drugId), + doseUnitId: int.parse(doseUnit!), + route: route!.isEmpty ? 1 : int.parse(route), + frequency: frequency!.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime.toIso8601String())); + doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration!.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime!.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model.postPrescription(postProcedureReqModel, patient.patientMRN); + await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); @@ -92,14 +92,14 @@ class _PrescriptionCheckOutScreenState extends State } } - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; + String? routeError; + String? frequencyError; + String? doseTimeError; + String? durationError; + String? unitError; + String? strengthError; - int selectedType; + int selectedType = 0; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -109,10 +109,10 @@ class _PrescriptionCheckOutScreenState extends State bool visibilitySearch = true; final myController = TextEditingController(); - DateTime selectedDate; - int strengthChar; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + DateTime? selectedDate; + int strengthChar = 0; + GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel(); + GlobalKey> key = GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -210,7 +210,7 @@ class _PrescriptionCheckOutScreenState extends State return BaseView( onModelReady: (model) async { // TODO Elham* move this logic to the model - model.getItem(itemID: int.parse(widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); + model.getItem(itemID: int.parse(widget.groupProcedures.aliasN!.replaceAll("item code ;", ""))); x = model.patientAssessmentList.map((element) { return element.icdCode10ID; @@ -231,7 +231,7 @@ class _PrescriptionCheckOutScreenState extends State builder: ( BuildContext context, MedicineViewModel model, - Widget child, + Widget? child, ) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), @@ -320,7 +320,7 @@ class _PrescriptionCheckOutScreenState extends State value: 1, groupValue: selectedType, onChanged: (value) { - setSelectedType(value); + setSelectedType(value!); }, ), Text(TranslationBase.of(context).regular), @@ -354,6 +354,7 @@ class _PrescriptionCheckOutScreenState extends State inputType: TextInputType.numberWithOptions( decimal: true, ), + onFieldSubmitted: () {}, ), ), SizedBox( @@ -461,8 +462,8 @@ class _PrescriptionCheckOutScreenState extends State child: InkWell( onTap: () => selectDate(context, widget.model), child: TextField( - decoration: textFieldSelectorDecoration(TranslationBase.of(context).date, - selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : "", true, suffixIcon: Icon( Icons.calendar_today, color: Colors.black, @@ -529,7 +530,7 @@ class _PrescriptionCheckOutScreenState extends State ), SizedBox(height: spaceBetweenTextFields), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), child: Wrap( alignment: WrapAlignment.center, children: [ @@ -557,12 +558,12 @@ class _PrescriptionCheckOutScreenState extends State ); return; } - if (formKey.currentState.validate()) { + if (formKey.currentState!.validate()) { Navigator.pop(context); { postPrescription( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID.isEmpty + ? model.patientAssessmentList[0].icdCode10ID!.isEmpty ? "test" : model.patientAssessmentList[0].icdCode10ID.toString() : "test", @@ -575,7 +576,7 @@ class _PrescriptionCheckOutScreenState extends State duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: (widget.groupProcedures.aliasN.replaceAll("item code ;", "")), + drugId: (widget.groupProcedures.aliasN!.replaceAll("item code ;", "")), strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, @@ -618,7 +619,7 @@ class _PrescriptionCheckOutScreenState extends State }); } - formKey.currentState.save(); + formKey.currentState!.save(); }, ), ], @@ -647,7 +648,7 @@ class _PrescriptionCheckOutScreenState extends State Utils.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -663,7 +664,7 @@ class _PrescriptionCheckOutScreenState extends State /// TODO Elham* Use it from the textfeild utils - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(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/procedures/add_procedure_page.dart b/lib/screens/procedures/add_procedure_page.dart index efb1185f..c9863b57 100644 --- a/lib/screens/procedures/add_procedure_page.dart +++ b/lib/screens/procedures/add_procedure_page.dart @@ -21,27 +21,25 @@ class AddProcedurePage extends StatefulWidget { final PatiantInformtion patient; final ProcedureType procedureType; - const AddProcedurePage( - {Key key, this.model, this.patient, @required this.procedureType}) - : super(key: key); + const AddProcedurePage({Key? key, required this.model, required this.patient, required this.procedureType}) : super(key: key); @override - _AddProcedurePageState createState() => _AddProcedurePageState( - patient: patient, model: model, procedureType: this.procedureType); + _AddProcedurePageState createState() => _AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType); } class _AddProcedurePageState extends State { - String selectedType; + String? selectedType; ProcedureViewModel model; PatiantInformtion patient; ProcedureType procedureType; - _AddProcedurePageState({this.patient, this.model, this.procedureType}); + _AddProcedurePageState({required this.patient, required this.model, required this.procedureType}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + + List entityListProcedure = []; TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -56,13 +54,9 @@ class _AddProcedurePageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) { - model.getProcedureCategory( - categoryName: procedureType.getCategoryName(), - categoryID: procedureType.getCategoryId(), - patientId: patient.patientId); + model.getProcedureCategory(categoryName: procedureType.getCategoryName(), categoryID: procedureType.getCategoryId(), patientId: patient.patientId); }, - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: SingleChildScrollView( child: FractionallySizedBox( @@ -85,62 +79,49 @@ class _AddProcedurePageState extends State { Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context) - .pleaseEnterProcedure, + TranslationBase.of(context).pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, ), ], ), SizedBox( - height: - MediaQuery.of(context).size.height * 0.02, + height: MediaQuery.of(context).size.height * 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * - 0.79, + width: MediaQuery.of(context).size.width * 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchProcedureHere, + hintText: TranslationBase.of(context).searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, minLines: 1, hasBorder: true, controller: procedureName, + onChanged: (String value) {}, + onFieldSubmitted: () {}, ), ), SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, + width: MediaQuery.of(context).size.width * 0.02, ), Expanded( child: InkWell( onTap: () async { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getProcedureCategory( - patientId: patient.patientId, - categoryName: procedureName.text, - isLocalBusy: true); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getProcedureCategory(patientId: patient.patientId, categoryName: procedureName.text, isLocalBusy: true); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } - GifLoaderDialogUtils.hideDialog( - context); + GifLoaderDialogUtils.hideDialog(context); } else { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, + TranslationBase.of(context).atLeastThreeCharacters, ); } }, @@ -154,15 +135,12 @@ class _AddProcedurePageState extends State { ), ], ), - if ((procedureType == ProcedureType.PROCEDURE - ? procedureName.text.isNotEmpty - : true) && - model.categoriesList.length != 0) + if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && model.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, - masterList: model.categoriesList[0].entityList, + masterList: model.categoriesList[0].entityList!, removeProcedure: (item) { setState(() { entityList.remove(item); @@ -174,8 +152,7 @@ class _AddProcedurePageState extends State { }); }, addSelectedHistories: () {}, - isEntityListSelected: (master) => widget.model - .isEntityListSelected(master, entityList), + isEntityListSelected: (master) => widget.model.isEntityListSelected(master, entityList), )), SizedBox( height: 10, @@ -201,8 +178,7 @@ class _AddProcedurePageState extends State { GifLoaderDialogUtils.showMyDialog(context); if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); GifLoaderDialogUtils.hideDialog(context); return; diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 2e358751..565d4efa 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -18,21 +18,13 @@ class BaseAddProcedureTabPage extends StatefulWidget { final PatiantInformtion? patient; final ProcedureType procedureType; - const BaseAddProcedureTabPage( - {Key? key, - this.previousProcedureViewModel, - this.prescriptionModel, - this.patient, - required this.procedureType}) - : super(key: key); + const BaseAddProcedureTabPage({Key? key, this.previousProcedureViewModel, this.prescriptionModel, this.patient, required this.procedureType}) : super(key: key); @override - _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( - patient: patient, procedureType: procedureType); + _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState(patient: patient, procedureType: procedureType); } -class _BaseAddProcedureTabPageState extends State - with SingleTickerProviderStateMixin { +class _BaseAddProcedureTabPageState extends State with SingleTickerProviderStateMixin { final PatiantInformtion? patient; final ProcedureType? procedureType; @@ -67,12 +59,10 @@ class _BaseAddProcedureTabPageState extends State return BaseView( onModelReady: (model) async { if (widget.previousProcedureViewModel == null) { - await model.getProcedureTemplate( - categoryID: widget.procedureType.getCategoryId()); + await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()); } }, - builder: (BuildContext context, ProcedureViewModel model, Widget? child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( baseViewModel: model, isShowAppBar: true, appBar: BottomSheetTitle( @@ -83,8 +73,7 @@ class _BaseAddProcedureTabPageState extends State child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: - Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: TabBar( isScrollable: false, controller: _tabController, @@ -92,16 +81,11 @@ class _BaseAddProcedureTabPageState extends State indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ - TabWidget.tabWidget(screenSize, _activeTab == 0, - procedureType!.getFavouriteTabName(context), - isFirst: true, context: context), - TabWidget.tabWidget(screenSize, _activeTab == 1, - procedureType!.getAllLabelName(context), - isLast: true, context: context), + TabWidget.tabWidget(screenSize, _activeTab == 0, procedureType!.getFavouriteTabName(context), isFirst: true, context: context), + TabWidget.tabWidget(screenSize, _activeTab == 1, procedureType!.getAllLabelName(context), isLast: true, context: context), ], ), ), @@ -113,8 +97,7 @@ class _BaseAddProcedureTabPageState extends State controller: _tabController, children: [ AddFavouriteProcedure( - previousProcedureViewModel: - widget.previousProcedureViewModel ?? model, + previousProcedureViewModel: widget.previousProcedureViewModel ?? model, prescriptionModel: widget.prescriptionModel, patient: patient, procedureType: procedureType, @@ -128,7 +111,7 @@ class _BaseAddProcedureTabPageState extends State else AddProcedurePage( model: widget.previousProcedureViewModel ?? model, - patient: patient, + patient: patient!, procedureType: procedureType!, ), ], diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 6e55c77e..09f994a5 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -7,7 +7,6 @@ import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dar import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../config/config.dart'; @@ -21,25 +20,23 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { final List masterList; EntityListCheckboxSearchWidget({ - Key key, - this.model, - this.addSelectedHistories, - this.removeProcedure, - this.masterList, - this.addProcedure, - this.isEntityListSelected, + Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeProcedure, + required this.masterList, + required this.addProcedure, + required this.isEntityListSelected, }) : super(key: key); @override - _EntityListCheckboxSearchWidgetState createState() => - _EntityListCheckboxSearchWidgetState(); + _EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState(); } -class _EntityListCheckboxSearchWidgetState - extends State { +class _EntityListCheckboxSearchWidgetState extends State { String selectedType = '0'; - int typeUrgent; - int typeRegular; + int typeUrgent = 0; + int typeRegular = 0; setSelectedType(String val) { setState(() { @@ -47,9 +44,9 @@ class _EntityListCheckboxSearchWidgetState }); } - List items = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -71,9 +68,7 @@ class _EntityListCheckboxSearchWidgetState child: Center( child: Container( margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white), child: ListView( children: [ TextFields( @@ -81,8 +76,7 @@ class _EntityListCheckboxSearchWidgetState suffixIcon: EvaIcons.search, suffixIconColor: Color(0xff2B353E), onChanged: (value) { - widget.model.filterSearchResults( - value, widget.masterList, items); + widget.model.filterSearchResults(value, widget.masterList, items); }, hasBorder: false, ), @@ -98,31 +92,21 @@ class _EntityListCheckboxSearchWidgetState title: Row( children: [ Checkbox( - value: widget.isEntityListSelected( - historyInfo), + value: widget.isEntityListSelected(historyInfo), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget.removeProcedure( - historyInfo); + if (widget.isEntityListSelected(historyInfo)) { + widget.removeProcedure(historyInfo); } else { - widget.addProcedure( - historyInfo); + widget.addProcedure(historyInfo); } }); }), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: AppText( - Utils.convertToTitleCase( historyInfo.procedureName), - fontSize: 14.0, - variant: "bodyText", - bold: true, - color: Color(0xff575757)), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), + child: AppText(Utils.convertToTitleCase(historyInfo.procedureName!), fontSize: 14.0, variant: "bodyText", bold: true, color: Color(0xff575757)), ), ), ], @@ -130,24 +114,17 @@ class _EntityListCheckboxSearchWidgetState children: [ Container( child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12), + padding: EdgeInsets.symmetric(horizontal: 12), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 11), + padding: const EdgeInsets.symmetric(horizontal: 11), child: AppText( - TranslationBase.of( - context) - .orderType, - fontWeight: - FontWeight.w700, + TranslationBase.of(context).orderType, + fontWeight: FontWeight.w700, color: Color(0xff2B353E), ), ), @@ -156,17 +133,13 @@ class _EntityListCheckboxSearchWidgetState Row( children: [ Radio( - activeColor: - Color(0xFFD02127), + activeColor: Color(0xFFD02127), value: '0', - groupValue: historyInfo.type, + groupValue: historyInfo.type, onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + historyInfo.type = setSelectedType(value!).toString(); - historyInfo.type = - value.toString(); + historyInfo.type = value.toString(); }, ), AppText( @@ -175,22 +148,17 @@ class _EntityListCheckboxSearchWidgetState fontWeight: FontWeight.w600, ), Radio( - activeColor: - Color(0xFFD02127), + activeColor: Color(0xFFD02127), groupValue: historyInfo.type, value: '1', onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + historyInfo.type = setSelectedType(value!).toString(); - historyInfo.type = - value.toString(); + historyInfo.type = value.toString(); }, ), AppText( - TranslationBase.of(context) - .urgent, + TranslationBase.of(context).urgent, color: Color(0xff575757), fontWeight: FontWeight.w600, ), @@ -204,11 +172,9 @@ class _EntityListCheckboxSearchWidgetState height: 2.0, ), Padding( - padding: EdgeInsets.symmetric( - horizontal: 12, vertical: 12.0), + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 12.0), child: TextFields( - hintText: TranslationBase.of(context) - .remarks, + hintText: TranslationBase.of(context).remarks, //controller: remarksController, onChanged: (value) { historyInfo.remarks = value; @@ -216,7 +182,7 @@ class _EntityListCheckboxSearchWidgetState minLines: 3, maxLines: 5, borderWidth: 0.5, - borderColor: Colors.grey[500], + borderColor: Colors.grey[500]!, ), ), DividerWithSpacesAround(), @@ -228,8 +194,7 @@ class _EntityListCheckboxSearchWidgetState ) : Center( child: Container( - child: AppText("Sorry , No Match", - color: AppGlobal.appRedColor), + child: AppText("Sorry , No Match", color: AppGlobal.appRedColor), ), ) ], diff --git a/lib/screens/procedures/favorite_procedure/add_favourite_procedure.dart b/lib/screens/procedures/favorite_procedure/add_favourite_procedure.dart index c2b173d4..15b833f2 100644 --- a/lib/screens/procedures/favorite_procedure/add_favourite_procedure.dart +++ b/lib/screens/procedures/favorite_procedure/add_favourite_procedure.dart @@ -12,7 +12,6 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class AddFavouriteProcedure extends StatefulWidget { @@ -94,8 +93,8 @@ class _AddFavouriteProcedureState extends State { context, MaterialPageRoute( builder: (context) => PrescriptionCheckOutScreen( - patient: widget.patient, - model: widget.prescriptionModel, + patient: widget.patient!, + model: widget.prescriptionModel!, groupProcedures: groupProcedures, ), settings: RouteSettings(name: 'PrescriptionCheckOutScreen')), diff --git a/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart b/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart index 70e05047..7635ebc4 100644 --- a/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/screens/procedures/expansion_procedure.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -91,7 +90,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State _UpdateProcedureWidgetState(); @@ -96,9 +86,7 @@ class _UpdateProcedureWidgetState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getCategory(), - builder: - (BuildContext context, ProcedureViewModel _model, Widget? child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel _model, Widget? child) => AppScaffold( baseViewModel: widget.previousModel!, isShowAppBar: true, appBar: BottomSheetTitle(title: "Update Procedure"), @@ -107,8 +95,7 @@ class _UpdateProcedureWidgetState extends State { height: MediaQuery.of(context).size.height * 0.9, child: Form( child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -148,17 +135,11 @@ class _UpdateProcedureWidgetState extends State { height: 12.0, ), Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( fontSize: 15.0, controller: widget.remarksController!, - hintText: widget.remarksController!.text.isEmpty - ? 'No Remarks Added' - : '', + hintText: widget.remarksController!.text.isEmpty ? 'No Remarks Added' : '', maxLines: 3, minLines: 2, onChanged: (value) {}, @@ -201,8 +182,7 @@ class _UpdateProcedureWidgetState extends State { required String procedureId, required PatiantInformtion patient, required String categoryId}) async { - UpdateProcedureRequestModel updateProcedureReqModel = - new UpdateProcedureRequestModel(); + UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel(); List controls = []; ProcedureDetail controlsProcedure = ProcedureDetail(); @@ -215,8 +195,7 @@ class _UpdateProcedureWidgetState extends State { { controls.add( - Controls( - code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), + Controls(code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: orderType), @@ -229,17 +208,13 @@ class _UpdateProcedureWidgetState extends State { } updateProcedureReqModel.procedureDetail = controlsProcedure; GifLoaderDialogUtils.showMyDialog(context); - await widget.previousModel!.updateProcedure( - updateProcedureRequestModel: updateProcedureReqModel, - mrn: patient.patientMRN, - isLocalBusy: true); + await widget.previousModel!.updateProcedure(updateProcedureRequestModel: updateProcedureReqModel, mrn: patient.patientMRN, isLocalBusy: true); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been updated'); - await widget.previousModel! - .getProcedure(mrn: patient.patientMRN, isLocalBusy: true); + await widget.previousModel!.getProcedure(mrn: patient.patientMRN!, isLocalBusy: true); Navigator.of(context).pop(); } GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/screens/reschedule_leaves/reschedule_leave.dart b/lib/screens/reschedule_leaves/reschedule_leave.dart index 35de7fe7..91e58de5 100644 --- a/lib/screens/reschedule_leaves/reschedule_leave.dart +++ b/lib/screens/reschedule_leaves/reschedule_leave.dart @@ -10,15 +10,15 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/reschedule_leaves/add_reschedule_leave.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.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/app_text_form_field.dart'; import 'package:dropdown_search/dropdown_search.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; @@ -39,8 +39,8 @@ class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); - ProjectViewModel projectsProvider; - SickLeaveViewModel sickLeaveViewModel; + late ProjectViewModel projectsProvider; + late SickLeaveViewModel sickLeaveViewModel; Map profile = {}; var offTime = '1'; var date; @@ -49,8 +49,8 @@ class _RescheduleLeaveScreen extends State { dynamic fromDate; dynamic toDate; var clinicID; - String fromTime; - String toTime; + String? fromTime; + String? toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); @@ -124,7 +124,10 @@ class _RescheduleLeaveScreen extends State { width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), + top: SizeConfig.widthMultiplier! * 0.9, + bottom: SizeConfig.widthMultiplier! * 0.9, + right: SizeConfig.widthMultiplier! * 3, + left: SizeConfig.widthMultiplier! * 3), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -149,7 +152,7 @@ class _RescheduleLeaveScreen extends State { AppText( item['description'], - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig.textMultiplier! * 2.1, // color: // Colors.grey, ), @@ -159,7 +162,7 @@ class _RescheduleLeaveScreen extends State { }, onChanged: (newValue) { setState(() { - offTime = newValue; + offTime = newValue.toString(); }); if (offTime == '1') { model2.getReasons(18); @@ -168,7 +171,7 @@ class _RescheduleLeaveScreen extends State { } else if (offTime == '3' || offTime == '5') { model2.getReasons(102); setState(() { - offTime = newValue; + offTime = newValue.toString(); }); } }, @@ -202,7 +205,10 @@ class _RescheduleLeaveScreen extends State { AppTextFormField( hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), + prefix: IconButton( + icon: Icon(Icons.calendar_today), + onPressed: () {}, + ), textInputType: TextInputType.number, controller: _toDateController, onTap: () { @@ -224,19 +230,19 @@ class _RescheduleLeaveScreen extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).fromTime, - type: DateTimePickerType.time, - controller: _controller4, - onChanged: (val) => fromTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => fromTime = val, - ) + // DateTimePicker( + // timeHintText: TranslationBase.of(context).fromTime, + // type: DateTimePickerType.time, + // controller: _controller4, + // onChanged: (val) => fromTime = val, + // validator: (val) { + // print(val); + // // setState( + // // () => _valueToValidate4 = val); + // return null; + // }, + // onSaved: (val) => fromTime = val, + // ), ], ), ), @@ -282,7 +288,10 @@ class _RescheduleLeaveScreen extends State { AppTextFormField( hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), + prefix: IconButton( + icon: Icon(Icons.calendar_today), + onPressed: () {}, + ), textInputType: TextInputType.number, readOnly: true, controller: _toDateController, @@ -308,7 +317,10 @@ class _RescheduleLeaveScreen extends State { hintText: TranslationBase.of(context).toDate, readOnly: true, borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), + prefix: IconButton( + icon: Icon(Icons.calendar_today), + onPressed: () {}, + ), textInputType: TextInputType.number, controller: _toDateController2, onTap: () { @@ -330,7 +342,10 @@ class _RescheduleLeaveScreen extends State { width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), + top: SizeConfig.widthMultiplier! * 0.9, + bottom: SizeConfig.widthMultiplier! * 0.9, + right: SizeConfig.widthMultiplier! * 3, + left: SizeConfig.widthMultiplier! * 3), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -354,7 +369,7 @@ class _RescheduleLeaveScreen extends State { children: [ AppText( projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig.textMultiplier! * 2.1, // color: // Colors.grey, ), @@ -391,7 +406,10 @@ class _RescheduleLeaveScreen extends State { width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), + top: SizeConfig.widthMultiplier! * 0.9, + bottom: SizeConfig.widthMultiplier! * 0.9, + right: SizeConfig.widthMultiplier! * 3, + left: SizeConfig.widthMultiplier! * 3), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -402,9 +420,11 @@ class _RescheduleLeaveScreen extends State { ? Expanded( // add Expanded to have your dropdown button fill remaining space child: DropdownSearch( - mode: Mode.BOTTOM_SHEET, + dropdownButtonProps: DropdownButtonProps(), + dropdownDecoratorProps: DropDownDecoratorProps( + dropdownSearchDecoration: InputDecoration(contentPadding: EdgeInsets.all(0), border: InputBorder.none), + ), - dropdownSearchDecoration: InputDecoration(contentPadding: EdgeInsets.all(0), border: InputBorder.none), //maxHeight: 300, items: model2.coveringDoctors.map((item) { return projectsProvider.isArabic ? item['doctorNameN'] : item['doctorName']; @@ -414,33 +434,36 @@ class _RescheduleLeaveScreen extends State { model2.coveringDoctors.forEach((newVal) => {if (newVal['doctorName'] == item) doctorID = newVal['DoctorID']}); }, selectedItem: getSelectedDoctor(model2), - showSearchBox: true, - popupTitle: Container( - height: 50, - decoration: BoxDecoration( - color: Theme.of(context).primaryColorDark, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20), - topRight: Radius.circular(20), + popupProps: PopupProps.bottomSheet( + bottomSheetProps: BottomSheetProps( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), + ), + ), ), - ), - child: Center( - child: Text( - '', - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - color: Colors.white, + title: Container( + height: 50, + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Center( + child: Text( + '', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), ), ), - ), - ), - popupShape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(24), - topRight: Radius.circular(24), - ), - ), + showSearchBox: true), ), ) : SizedBox(), @@ -449,9 +472,9 @@ class _RescheduleLeaveScreen extends State { ], ), )), - SizedBox(height: SizeConfig.screenHeight * .3), + SizedBox(height: SizeConfig.screenHeight! * .3), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), child: Wrap( alignment: WrapAlignment.center, children: [ @@ -502,12 +525,12 @@ class _RescheduleLeaveScreen extends State { _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); //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(); @@ -528,8 +551,8 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); - toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); + fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime! + ':' + DateTime.now().second.toString())); + toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime! + ':' + DateTime.now().second.toString())); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -573,8 +596,8 @@ class _RescheduleLeaveScreen extends State { dynamic fromDates = fromDate; dynamic toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); - toDate = df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); + fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime! + ':' + DateTime.now().second.toString(); + toDate = df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime! + ':' + DateTime.now().second.toString(); } else { fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index 462f6372..247f214b 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -10,1725 +10,1452 @@ class TranslationBase { final Locale locale; static TranslationBase of(BuildContext context) { - return Localizations.of(context, TranslationBase); + 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 areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo']![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 searchPatient => localizedValues['searchPatient']![locale.languageCode]!; - String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; + String get searchPatientDashBoard => localizedValues['searchPatientDashBoard']![locale.languageCode]!; - String get searchPatientName => localizedValues['searchPatient-name'][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 patient => localizedValues['patient']![locale.languageCode]!; - String get patients => localizedValues['patients'][locale.languageCode]; + String get patients => localizedValues['patients']![locale.languageCode]!; - String get labResult => localizedValues['labResult'][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 inPatient => localizedValues['inPatient']![locale.languageCode]!; - String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; + String get myInPatient => localizedValues['myInPatient']![locale.languageCode]!; - String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; + String get myInPatientTitle => localizedValues['myInPatientTitle']![locale.languageCode]!; - String get inPatientLabel => localizedValues['inPatientLabel'][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 searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; + String get searchMedicineDashboard => localizedValues['searchMedicineDashboard']![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 myReferredPatient => localizedValues['myReferredPatient']![locale.languageCode]!; - String get referredPatient => - localizedValues['referredPatient'][locale.languageCode]; + String get referredPatient => localizedValues['referredPatient']![locale.languageCode]!; - String get referredOn => localizedValues['referredOn'][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 firstNameInAr => localizedValues['firstNameInAr'][locale.languageCode]; + String get firstNameInAr => localizedValues['firstNameInAr']![locale.languageCode]!; - String get middleName => localizedValues['middleName'][locale.languageCode]; + String get middleName => localizedValues['middleName']![locale.languageCode]!; - String get middleNameInAr => localizedValues['middleNameInAr'][locale.languageCode]; + String get middleNameInAr => localizedValues['middleNameInAr']![locale.languageCode]!; - String get lastName => localizedValues['lastName'][locale.languageCode]; + String get lastName => localizedValues['lastName']![locale.languageCode]!; - String get lastNameInAr => localizedValues['lastNameInAr'][locale.languageCode]; + String get lastNameInAr => localizedValues['lastNameInAr']![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 medicineSearchResult => localizedValues['medicineSearchResult'][locale.languageCode]; + String get medicineSearchResult => localizedValues['medicineSearchResult']![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 scanERQrCode => localizedValues['scanERQrCode'][locale.languageCode]; + String get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]!; - String get scanQr => localizedValues['scanQr'][locale.languageCode]; + String get scanERQrCode => localizedValues['scanERQrCode']![locale.languageCode]!; - String get profile => localizedValues['profile'][locale.languageCode]; + String get scanQr => localizedValues['scanQr']![locale.languageCode]!; - String get gender => localizedValues['gender'][locale.languageCode]; + String get profile => localizedValues['profile']![locale.languageCode]!; - String get clinic => localizedValues['clinic'][locale.languageCode]; + String get gender => localizedValues['gender']![locale.languageCode]!; - String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; + String get clinic => localizedValues['clinic']![locale.languageCode]!; - String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; + String get clinicSelect => localizedValues['clinicSelect']![locale.languageCode]!; - String get hospital => localizedValues['hospital'][locale.languageCode]; + String get doctorSelect => localizedValues['doctorSelect']![locale.languageCode]!; - String get speciality => localizedValues['speciality'][locale.languageCode]; + String get hospital => localizedValues['hospital']![locale.languageCode]!; - String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; + String get speciality => localizedValues['speciality']![locale.languageCode]!; - String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; + String get errorMessage => localizedValues['errorMessage']![locale.languageCode]!; - String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String get patientProfile => localizedValues['patientProfile']![locale.languageCode]!; - String get vital => localizedValues['vital'][locale.languageCode]; + String get vitalSign => localizedValues['vitalSign']![locale.languageCode]!; - String get signs => localizedValues['signs'][locale.languageCode]; + String get vital => localizedValues['vital']![locale.languageCode]!; - String get labOrder => localizedValues['labOrder'][locale.languageCode]; + String get signs => localizedValues['signs']![locale.languageCode]!; - String get lab => localizedValues['lab'][locale.languageCode]; + String get labOrder => localizedValues['labOrder']![locale.languageCode]!; - String get result => localizedValues['result'][locale.languageCode]; + String get lab => localizedValues['lab']![locale.languageCode]!; - String get medicines => localizedValues['medicines'][locale.languageCode]; + String get result => localizedValues['result']![locale.languageCode]!; - String get prescription => localizedValues['prescription'][locale.languageCode]; + String get medicines => localizedValues['medicines']![locale.languageCode]!; - String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get prescription => localizedValues['prescription']![locale.languageCode]!; - String get insurance => localizedValues['insurance'][locale.languageCode]; + String get insuranceApprovals => localizedValues['insuranceApprovals']![locale.languageCode]!; - String get approvals => localizedValues['approvals'][locale.languageCode]; + String get insurance => localizedValues['insurance']![locale.languageCode]!; - String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; + String get approvals => localizedValues['approvals']![locale.languageCode]!; - String get temperature => localizedValues['temperature'][locale.languageCode]; + String get bodyMeasurements => localizedValues['bodyMeasurements']![locale.languageCode]!; - String get pulse => localizedValues['pulse'][locale.languageCode]; + String get temperature => localizedValues['temperature']![locale.languageCode]!; - String get respiration => localizedValues['respiration'][locale.languageCode]; + String get pulse => localizedValues['pulse']![locale.languageCode]!; - String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; + String get respiration => localizedValues['respiration']![locale.languageCode]!; - String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String get bloodPressure => localizedValues['bloodPressure']![locale.languageCode]!; - String get painScale => localizedValues['painScale'][locale.languageCode]; + String get oxygenation => localizedValues['oxygenation']![locale.languageCode]!; - String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; + String get painScale => localizedValues['painScale']![locale.languageCode]!; - String get labOrders => localizedValues['labOrders'][locale.languageCode]; + String get errorNoVitalSign => localizedValues['errorNoVitalSign']![locale.languageCode]!; - String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; + String get labOrders => localizedValues['labOrders']![locale.languageCode]!; - String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; + String get errorNoLabOrders => localizedValues['errorNoLabOrders']![locale.languageCode]!; - String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get answerThePatient => localizedValues['answerThePatient']![locale.languageCode]!; - String get replay => localizedValues['replay'][locale.languageCode]; + String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer']![locale.languageCode]!; - String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get replay => localizedValues['replay']![locale.languageCode]!; - String get operationReports => localizedValues['operationReports'][locale.languageCode]; + String get progressNote => localizedValues['progressNote']![locale.languageCode]!; - String get reports => localizedValues['reports'][locale.languageCode]; + String get operationReports => localizedValues['operationReports']![locale.languageCode]!; - String get operation => localizedValues['operation'][locale.languageCode]; + String get reports => localizedValues['reports']![locale.languageCode]!; - String get progress => localizedValues['progress'][locale.languageCode]; + String get operation => localizedValues['operation']![locale.languageCode]!; - String get note => localizedValues['note'][locale.languageCode]; + String get progress => localizedValues['progress']![locale.languageCode]!; - String get searchNote => localizedValues['searchNote'][locale.languageCode]; + String get note => localizedValues['note']![locale.languageCode]!; - String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; + String get searchNote => localizedValues['searchNote']![locale.languageCode]!; - String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; + String get errorNoProgressNote => localizedValues['errorNoProgressNote']![locale.languageCode]!; - String get orderNo => localizedValues['orderNo'][locale.languageCode]; + String get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]!; - String get generalResult => localizedValues['generalResult'][locale.languageCode]; + String get orderNo => localizedValues['orderNo']![locale.languageCode]!; - String get description => localizedValues['description'][locale.languageCode]; + String get generalResult => localizedValues['generalResult']![locale.languageCode]!; - String get value => localizedValues['value'][locale.languageCode]; + String get description => localizedValues['description']![locale.languageCode]!; - String get range => localizedValues['range'][locale.languageCode]; + String get value => localizedValues['value']![locale.languageCode]!; - String get enterId => localizedValues['enterId'][locale.languageCode]; + String get range => localizedValues['range']![locale.languageCode]!; - String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; + String get enterId => localizedValues['enterId']![locale.languageCode]!; - String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; + String get pleaseEnterYourID => localizedValues['pleaseEnterYourID']![locale.languageCode]!; - String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; + String get enterPassword => localizedValues['enterPassword']![locale.languageCode]!; - String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; + String get pleaseEnterPassword => localizedValues['pleaseEnterPassword']![locale.languageCode]!; - String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String get selectYourProject => localizedValues['selectYourProject']![locale.languageCode]!; - String get login => localizedValues['login'][locale.languageCode]; + String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject']![locale.languageCode]!; - String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String get login => localizedValues['login']![locale.languageCode]!; - String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; + String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib']![locale.languageCode]!; - String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; + String get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]!; - String get home => localizedValues['home'][locale.languageCode]; + String get welcomeBackTo => localizedValues['welcomeBackTo']![locale.languageCode]!; - String get services => localizedValues['services'][locale.languageCode]; + String get home => localizedValues['home']![locale.languageCode]!; - String get sms => localizedValues['sms'][locale.languageCode]; + String get services => localizedValues['services']![locale.languageCode]!; - String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; + String get sms => localizedValues['sms']![locale.languageCode]!; - String get faceId => localizedValues['faceId'][locale.languageCode]; + String get fingerprint => localizedValues['fingerprint']![locale.languageCode]!; - String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + String get faceId => localizedValues['faceId']![locale.languageCode]!; - String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; + String get whatsApp => localizedValues['whatsApp']![locale.languageCode]!; - String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; + String get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]!; - String get choose => localizedValues['choose'][locale.languageCode]; + String get pleaseChoose => localizedValues['pleaseChoose']![locale.languageCode]!; - String get verification => localizedValues['verification'][locale.languageCode]; + String get choose => localizedValues['choose']![locale.languageCode]!; - String get firstStep => localizedValues['firstStep'][locale.languageCode]; + String get verification => localizedValues['verification']![locale.languageCode]!; - String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; + String get firstStep => localizedValues['firstStep']![locale.languageCode]!; - String get verify1 => localizedValues['verify1'][locale.languageCode]; + String get yourAccount => localizedValues['yourAccount!']![locale.languageCode]!; - String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; + String get verify1 => localizedValues['verify1']![locale.languageCode]!; - String get loginCode => localizedValues['loginCode'][locale.languageCode]; + String get youWillReceiveA => localizedValues['youWillReceiveA']![locale.languageCode]!; - String get smsBy => localizedValues['smsBy'][locale.languageCode]; + String get loginCode => localizedValues['loginCode']![locale.languageCode]!; - String get pleaseEnterTheCode => - localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String get smsBy => localizedValues['smsBy']![locale.languageCode]!; - String get youDontHaveAnyPatient => - localizedValues['youDontHaveAnyPatient'][locale.languageCode]; + String get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode']![locale.languageCode]!; - String get youDoNotHaveAnyItem => - localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient']![locale.languageCode]!; - String get age => localizedValues['age'][locale.languageCode]; + String get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem']![locale.languageCode]!; - String get nationality => localizedValues['nationality'][locale.languageCode]; + String get age => localizedValues['age']![locale.languageCode]!; - String get occupation => localizedValues['occupation'][locale.languageCode]; + String get nationality => localizedValues['nationality']![locale.languageCode]!; - String get healthID => localizedValues['healthID'][locale.languageCode]; + String get occupation => localizedValues['occupation']![locale.languageCode]!; - String get identityNumber => - localizedValues['identityNumber'][locale.languageCode]; + String get healthID => localizedValues['healthID']![locale.languageCode]!; - String get maritalStatus => - localizedValues['maritalStatus'][locale.languageCode]; + String get identityNumber => localizedValues['identityNumber']![locale.languageCode]!; - String get today => localizedValues['today'][locale.languageCode]; + String get maritalStatus => localizedValues['maritalStatus']![locale.languageCode]!; - String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; + String get today => localizedValues['today']![locale.languageCode]!; - String get all => localizedValues['all'][locale.languageCode]; + String get tomorrow => localizedValues['tomorrow']![locale.languageCode]!; - String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; + String get all => localizedValues['all']![locale.languageCode]!; - String get yesterday => localizedValues['yesterday'][locale.languageCode]; + String get nextWeek => localizedValues['nextWeek']![locale.languageCode]!; - String get errorNoInsuranceApprovals => - localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String get yesterday => localizedValues['yesterday']![locale.languageCode]!; - String get searchInsuranceApprovals => - localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals']![locale.languageCode]!; - String get status => localizedValues['status'][locale.languageCode]; + String get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals']![locale.languageCode]!; - String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String get status => localizedValues['status']![locale.languageCode]!; - String get producerName => - localizedValues['producerName'][locale.languageCode]; + String get expiryDate => localizedValues['expiryDate']![locale.languageCode]!; - String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String get producerName => localizedValues['producerName']![locale.languageCode]!; - String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String get receiptOn => localizedValues['receiptOn']![locale.languageCode]!; - String get doctor => localizedValues['doctor'][locale.languageCode]; + String get approvalNo => localizedValues['approvalNo']![locale.languageCode]!; - String get ext => localizedValues['ext'][locale.languageCode]; + String get doctor => localizedValues['doctor']![locale.languageCode]!; - String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; + String get ext => localizedValues['ext']![locale.languageCode]!; - String get urgent => localizedValues['urgent'][locale.languageCode]; + String get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]!; - String get routine => localizedValues['routine'][locale.languageCode]; + String get urgent => localizedValues['urgent']![locale.languageCode]!; - String get send => localizedValues['send'][locale.languageCode]; + String get routine => localizedValues['routine']![locale.languageCode]!; - String get referralFrequency => - localizedValues['referralFrequency'][locale.languageCode]; + String get send => localizedValues['send']![locale.languageCode]!; - String get selectReferralFrequency => - localizedValues['selectReferralFrequency'][locale.languageCode]; + String get referralFrequency => localizedValues['referralFrequency']![locale.languageCode]!; - String get clinicalDetailsAndRemarks => - localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String get selectReferralFrequency => localizedValues['selectReferralFrequency']![locale.languageCode]!; - String get remarks => localizedValues['remarks'][locale.languageCode]; + String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]!; - String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; + String get remarks => localizedValues['remarks']![locale.languageCode]!; - String get replay2 => localizedValues['replay2'][locale.languageCode]; + String get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]!; - String get outPatient => localizedValues['outPatients'][locale.languageCode]; + String get replay2 => localizedValues['replay2']![locale.languageCode]!; - String get myOutPatient => - localizedValues['myOutPatient'][locale.languageCode]; + String get outPatient => localizedValues['outPatients']![locale.languageCode]!; - String get myOutPatient_2lines => - localizedValues['myOutPatient_2lines'][locale.languageCode]; + String get myOutPatient => localizedValues['myOutPatient']![locale.languageCode]!; - String get logout => localizedValues['logout'][locale.languageCode]; + String get myOutPatient_2lines => localizedValues['myOutPatient_2lines']![locale.languageCode]!; - String get pharmaciesList => - localizedValues['pharmaciesList'][locale.languageCode]; + String get logout => localizedValues['logout']![locale.languageCode]!; - String get price => localizedValues['price'][locale.languageCode]; + String get pharmaciesList => localizedValues['pharmaciesList']![locale.languageCode]!; - String get youCanFindItIn => - localizedValues['youCanFindItIn'][locale.languageCode]; + String get price => localizedValues['price']![locale.languageCode]!; - String get radiologyReport => - localizedValues['radiologyReport'][locale.languageCode]; + String get youCanFindItIn => localizedValues['youCanFindItIn']![locale.languageCode]!; - String get orders => localizedValues['orders'][locale.languageCode]; + String get radiologyReport => localizedValues['radiologyReport']![locale.languageCode]!; - String get list => localizedValues['list'][locale.languageCode]; + String get orders => localizedValues['orders']![locale.languageCode]!; - String get searchOrders => - localizedValues['searchOrders'][locale.languageCode]; + String get list => localizedValues['list']![locale.languageCode]!; - String get prescriptionDetails => - localizedValues['prescriptionDetails'][locale.languageCode]; + String get searchOrders => localizedValues['searchOrders']![locale.languageCode]!; - String get prescriptionInfo => - localizedValues['prescriptionInfo'][locale.languageCode]; + String get prescriptionDetails => localizedValues['prescriptionDetails']![locale.languageCode]!; - String get errorNoOrders => - localizedValues['errorNoOrders'][locale.languageCode]; + String get prescriptionInfo => localizedValues['prescriptionInfo']![locale.languageCode]!; - String get livecare => localizedValues['livecare'][locale.languageCode]; + String get errorNoOrders => localizedValues['errorNoOrders']![locale.languageCode]!; - String get beingBad => localizedValues['beingBad'][locale.languageCode]; + String get livecare => localizedValues['livecare']![locale.languageCode]!; - String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; + String get beingBad => localizedValues['beingBad']![locale.languageCode]!; - String get cancel => localizedValues['cancel'][locale.languageCode]; + String get beingGreat => localizedValues['beingGreat']![locale.languageCode]!; - String get ok => localizedValues['ok'][locale.languageCode]; + String get cancel => localizedValues['cancel']![locale.languageCode]!; - String get done => localizedValues['done'][locale.languageCode]; + String get ok => localizedValues['ok']![locale.languageCode]!; - String get searchMedicineImageCaption => - localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String get done => localizedValues['done']![locale.languageCode]!; - String get type => localizedValues['type'][locale.languageCode]; + String get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption']![locale.languageCode]!; - String get resumecall => localizedValues['resumecall'][locale.languageCode]; + String get type => localizedValues['type']![locale.languageCode]!; - String get endcallwithcharge => - localizedValues['endcallwithcharge'][locale.languageCode]; + String get resumecall => localizedValues['resumecall']![locale.languageCode]!; - String get endcall => localizedValues['endcall'][locale.languageCode]; + String get endcallwithcharge => localizedValues['endcallwithcharge']![locale.languageCode]!; - String get transfertoadmin => - localizedValues['transfertoadmin'][locale.languageCode]; + String get endcall => localizedValues['endcall']![locale.languageCode]!; - String get fromDate => localizedValues['fromDate'][locale.languageCode]; + String get transfertoadmin => localizedValues['transfertoadmin']![locale.languageCode]!; - String get toDate => localizedValues['toDate'][locale.languageCode]; + String get fromDate => localizedValues['fromDate']![locale.languageCode]!; - String get fromTime => localizedValues['fromTime'][locale.languageCode]; + String get toDate => localizedValues['toDate']![locale.languageCode]!; - String get toTime => localizedValues['toTime'][locale.languageCode]; + String get fromTime => localizedValues['fromTime']![locale.languageCode]!; - String get searchPatientImageCaptionTitle => - localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + String get toTime => localizedValues['toTime']![locale.languageCode]!; - String get searchPatientImageCaptionBody => - localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + String get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]!; - String get welcome => localizedValues['welcome'][locale.languageCode]; + String get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody']![locale.languageCode]!; - String get typeMedicineName => - localizedValues['typeMedicineName'][locale.languageCode]; + String get welcome => localizedValues['welcome']![locale.languageCode]!; - String get moreThan3Letter => - localizedValues['moreThan3Letter'][locale.languageCode]; + String get typeMedicineName => localizedValues['typeMedicineName']![locale.languageCode]!; - String get gender2 => localizedValues['gender2'][locale.languageCode]; + String get moreThan3Letter => localizedValues['moreThan3Letter']![locale.languageCode]!; - String get age2 => localizedValues['age2'][locale.languageCode]; + String get gender2 => localizedValues['gender2']![locale.languageCode]!; - String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String get age2 => localizedValues['age2']![locale.languageCode]!; - String get patientSick => - localizedValues['patient-sick'][locale.languageCode]; + String get sickleave => localizedValues['sick-leaves']![locale.languageCode]!; - String get leave => localizedValues['leave'][locale.languageCode]; + String get patientSick => localizedValues['patient-sick']![locale.languageCode]!; - String get submit => localizedValues['submit'][locale.languageCode]; + String get leave => localizedValues['leave']![locale.languageCode]!; - String get doctorName => localizedValues['doc-name'][locale.languageCode]; + String get submit => localizedValues['submit']![locale.languageCode]!; - String get clinicName => localizedValues['clinicname'][locale.languageCode]; + String get doctorName => localizedValues['doc-name']![locale.languageCode]!; - String get sickLeaveDate => - localizedValues['sick-leave-date'][locale.languageCode]; + String get clinicName => localizedValues['clinicname']![locale.languageCode]!; - String get sickLeaveDays => - localizedValues['sick-leave-days'][locale.languageCode]; + String get sickLeaveDate => localizedValues['sick-leave-date']![locale.languageCode]!; - String get admissionDetail => - localizedValues['admissionDetail'][locale.languageCode]; + String get sickLeaveDays => localizedValues['sick-leave-days']![locale.languageCode]!; - String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String get admissionDetail => localizedValues['admissionDetail']![locale.languageCode]!; - String get date => localizedValues['date'][locale.languageCode]; + String get dateTime => localizedValues['dateTime']![locale.languageCode]!; - String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; + String get date => localizedValues['date']![locale.languageCode]!; - String get losNo => localizedValues['losNo'][locale.languageCode]; + String get admissionNo => localizedValues['admissionNo']![locale.languageCode]!; - String get area => localizedValues['area'][locale.languageCode]; + String get losNo => localizedValues['losNo']![locale.languageCode]!; - String get room => localizedValues['room'][locale.languageCode]; + String get area => localizedValues['area']![locale.languageCode]!; - String get bed => localizedValues['bed'][locale.languageCode]; + String get room => localizedValues['room']![locale.languageCode]!; - String get previousSickLeaveIssue => - localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String get bed => localizedValues['bed']![locale.languageCode]!; - String get noSickLeaveApplied => - localizedValues['no-sickleve-applied'][locale.languageCode]; + String get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed']![locale.languageCode]!; - String get applyNow => localizedValues['applynow'][locale.languageCode]; + String get noSickLeaveApplied => localizedValues['no-sickleve-applied']![locale.languageCode]!; - String get addSickLeave => - localizedValues['add-sickleave'][locale.languageCode]; + String get applyNow => localizedValues['applynow']![locale.languageCode]!; - String get pharmacyIntervention => - localizedValues['pharmacy-intervention'][locale.languageCode]; + String get addSickLeave => localizedValues['add-sickleave']![locale.languageCode]!; - String get add => localizedValues['add'][locale.languageCode]; + String get pharmacyIntervention => localizedValues['pharmacy-intervention']![locale.languageCode]!; - String get addSickLeaverequest => - localizedValues['addSickLeaveRequest'][locale.languageCode]; + String get add => localizedValues['add']![locale.languageCode]!; - String get extendSickLeaverequest => - localizedValues['extendSickLeaveRequest'][locale.languageCode]; + String get addSickLeaverequest => localizedValues['addSickLeaveRequest']![locale.languageCode]!; - String get approved => localizedValues['approved'][locale.languageCode]; + String get extendSickLeaverequest => localizedValues['extendSickLeaveRequest']![locale.languageCode]!; - String get extended => localizedValues['extended'][locale.languageCode]; + String get approved => localizedValues['approved']![locale.languageCode]!; - String get pending => localizedValues['pending'][locale.languageCode]; + String get extended => localizedValues['extended']![locale.languageCode]!; - String get leaveStartDate => - localizedValues['leave-start-date'][locale.languageCode]; + String get pending => localizedValues['pending']![locale.languageCode]!; - String get daysSickleave => - localizedValues['days-sick-leave'][locale.languageCode]; + String get leaveStartDate => localizedValues['leave-start-date']![locale.languageCode]!; - String get extend => localizedValues['extend'][locale.languageCode]; + String get daysSickleave => localizedValues['days-sick-leave']![locale.languageCode]!; - String get extendSickLeave => - localizedValues['extend-sickleave'][locale.languageCode]; + String get extend => localizedValues['extend']![locale.languageCode]!; - String get targetPatient => - localizedValues['patient-target'][locale.languageCode]; + String get extendSickLeave => localizedValues['extend-sickleave']![locale.languageCode]!; - String get noPrescription => - localizedValues['no-priscription-listed'][locale.languageCode]; + String get targetPatient => localizedValues['patient-target']![locale.languageCode]!; - String get next => localizedValues['next'][locale.languageCode]; + String get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]!; - String get finish => localizedValues['finish'][locale.languageCode]; + String get next => localizedValues['next']![locale.languageCode]!; - String get previous => localizedValues['previous'][locale.languageCode]; + String get finish => localizedValues['finish']![locale.languageCode]!; - String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; + String get previous => localizedValues['previous']![locale.languageCode]!; - String get healthRecordInformation => - localizedValues['healthRecordInformation'][locale.languageCode]; + String get emptyMessage => localizedValues['empty-message']![locale.languageCode]!; - String get chiefComplaintLength => - localizedValues['chiefComplaintLength'][locale.languageCode]; + String get healthRecordInformation => localizedValues['healthRecordInformation']![locale.languageCode]!; - String get referTo => localizedValues['referTo'][locale.languageCode]; + String get chiefComplaintLength => localizedValues['chiefComplaintLength']![locale.languageCode]!; - String get referredFrom => - localizedValues['referredFrom'][locale.languageCode]; + String get referTo => localizedValues['referTo']![locale.languageCode]!; - String get refClinic => localizedValues['refClinic'][locale.languageCode]; + String get referredFrom => localizedValues['referredFrom']![locale.languageCode]!; - String get branch => localizedValues['branch'][locale.languageCode]; + String get refClinic => localizedValues['refClinic']![locale.languageCode]!; - String get chooseAppointment => - localizedValues['chooseAppointment'][locale.languageCode]; + String get branch => localizedValues['branch']![locale.languageCode]!; - String get appointmentNo => - localizedValues['appointmentNo'][locale.languageCode]; + String get chooseAppointment => localizedValues['chooseAppointment']![locale.languageCode]!; - String get refer => localizedValues['refer'][locale.languageCode]; + String get appointmentNo => localizedValues['appointmentNo']![locale.languageCode]!; - String get rejected => localizedValues['rejected'][locale.languageCode]; + String get refer => localizedValues['refer']![locale.languageCode]!; - String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; + String get rejected => localizedValues['rejected']![locale.languageCode]!; - String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; + String get sameBranch => localizedValues['sameBranch']![locale.languageCode]!; - String get dr => localizedValues['dr'][locale.languageCode]; + String get otherBranch => localizedValues['otherBranch']![locale.languageCode]!; - String get previewHealth => - localizedValues['previewHealth'][locale.languageCode]; + String get dr => localizedValues['dr']![locale.languageCode]!; - String get summaryReport => - localizedValues['summaryReport'][locale.languageCode]; + String get previewHealth => localizedValues['previewHealth']![locale.languageCode]!; - String get accept => localizedValues['accept'][locale.languageCode]; + String get summaryReport => localizedValues['summaryReport']![locale.languageCode]!; - String get reject => localizedValues['reject'][locale.languageCode]; + String get accept => localizedValues['accept']![locale.languageCode]!; - String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String get reject => localizedValues['reject']![locale.languageCode]!; - String get referralPatient => - localizedValues['referralPatient'][locale.languageCode]; + String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg']![locale.languageCode]!; - String get noPrescriptionListed => - localizedValues['noPrescriptionListed'][locale.languageCode]; + String get referralPatient => localizedValues['referralPatient']![locale.languageCode]!; - String get addNow => localizedValues['addNow'][locale.languageCode]; + String get noPrescriptionListed => localizedValues['noPrescriptionListed']![locale.languageCode]!; - String get orderType => localizedValues['orderType'][locale.languageCode]; + String get addNow => localizedValues['addNow']![locale.languageCode]!; - String get strength => localizedValues['strength'][locale.languageCode]; + String get orderType => localizedValues['orderType']![locale.languageCode]!; - String get doseTime => localizedValues['doseTime'][locale.languageCode]; + String get strength => localizedValues['strength']![locale.languageCode]!; - String get indication => localizedValues['indication'][locale.languageCode]; + String get doseTime => localizedValues['doseTime']![locale.languageCode]!; - String get duration => localizedValues['duration'][locale.languageCode]; + String get indication => localizedValues['indication']![locale.languageCode]!; - String get instruction => localizedValues['instruction'][locale.languageCode]; + String get duration => localizedValues['duration']![locale.languageCode]!; - String get rescheduleLeaves => - localizedValues['reschedule-leave'][locale.languageCode]; + String get instruction => localizedValues['instruction']![locale.languageCode]!; - String get applyOrRescheduleLeave => - localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get rescheduleLeaves => localizedValues['reschedule-leave']![locale.languageCode]!; - String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; + String get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave']![locale.languageCode]!; - String get addMedication => - localizedValues['addMedication'][locale.languageCode]; + String get myQRCode => localizedValues['myQRCode']![locale.languageCode]!; - String get route => localizedValues['route'][locale.languageCode]; + String get addMedication => localizedValues['addMedication']![locale.languageCode]!; - String get noReScheduleLeave => - localizedValues['no-reschedule-leave'][locale.languageCode]; + String get route => localizedValues['route']![locale.languageCode]!; - String get weight => localizedValues['weight'][locale.languageCode]; + String get noReScheduleLeave => localizedValues['no-reschedule-leave']![locale.languageCode]!; - String get kg => localizedValues['kg'][locale.languageCode]; + String get weight => localizedValues['weight']![locale.languageCode]!; - String get height => localizedValues['height'][locale.languageCode]; + String get kg => localizedValues['kg']![locale.languageCode]!; - String get cm => localizedValues['cm'][locale.languageCode]; + String get height => localizedValues['height']![locale.languageCode]!; - String get idealBodyWeight => - localizedValues['idealBodyWeight'][locale.languageCode]; + String get cm => localizedValues['cm']![locale.languageCode]!; - String get waistSize => localizedValues['waistSize'][locale.languageCode]; + String get idealBodyWeight => localizedValues['idealBodyWeight']![locale.languageCode]!; - String get inch => localizedValues['inch'][locale.languageCode]; + String get waistSize => localizedValues['waistSize']![locale.languageCode]!; - String get headCircum => localizedValues['headCircum'][locale.languageCode]; + String get inch => localizedValues['inch']![locale.languageCode]!; - String get leanBodyWeight => - localizedValues['leanBodyWeight'][locale.languageCode]; + String get headCircum => localizedValues['headCircum']![locale.languageCode]!; - String get bodyMassIndex => - localizedValues['bodyMassIndex'][locale.languageCode]; + String get leanBodyWeight => localizedValues['leanBodyWeight']![locale.languageCode]!; - String get yourBodyMassIndex => - localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bodyMassIndex => localizedValues['bodyMassIndex']![locale.languageCode]!; - String get bmiUnderWeight => - localizedValues['bmiUnderWeight'][locale.languageCode]; + String get yourBodyMassIndex => localizedValues['yourBodyMassIndex']![locale.languageCode]!; - String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; + String get bmiUnderWeight => localizedValues['bmiUnderWeight']![locale.languageCode]!; - String get bmiOverWeight => - localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiHealthy => localizedValues['bmiHealthy']![locale.languageCode]!; - String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; + String get bmiOverWeight => localizedValues['bmiOverWeight']![locale.languageCode]!; - String get bmiObeseExtreme => - localizedValues['bmiObeseExtreme'][locale.languageCode]; + String get bmiObese => localizedValues['bmiObese']![locale.languageCode]!; - String get method => localizedValues['method'][locale.languageCode]; + String get bmiObeseExtreme => localizedValues['bmiObeseExtreme']![locale.languageCode]!; - String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; + String get method => localizedValues['method']![locale.languageCode]!; - String get rhythm => localizedValues['rhythm'][locale.languageCode]; + String get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]!; - String get respBeats => localizedValues['respBeats'][locale.languageCode]; + String get rhythm => localizedValues['rhythm']![locale.languageCode]!; - String get patternOfRespiration => - localizedValues['patternOfRespiration'][locale.languageCode]; + String get respBeats => localizedValues['respBeats']![locale.languageCode]!; - String get bloodPressureDiastoleAndSystole => - localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String get patternOfRespiration => localizedValues['patternOfRespiration']![locale.languageCode]!; - String get cuffLocation => - localizedValues['cuffLocation'][locale.languageCode]; + String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]!; - String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; + String get cuffLocation => localizedValues['cuffLocation']![locale.languageCode]!; - String get patientPosition => - localizedValues['patientPosition'][locale.languageCode]; + String get cuffSize => localizedValues['cuffSize']![locale.languageCode]!; - String get fio2 => localizedValues['fio2'][locale.languageCode]; + String get patientPosition => localizedValues['patientPosition']![locale.languageCode]!; - String get sao2 => localizedValues['sao2'][locale.languageCode]; + String get fio2 => localizedValues['fio2']![locale.languageCode]!; - String get painManagement => - localizedValues['painManagement'][locale.languageCode]; + String get sao2 => localizedValues['sao2']![locale.languageCode]!; - String get holiday => localizedValues['holiday'][locale.languageCode]; + String get painManagement => localizedValues['painManagement']![locale.languageCode]!; - String get to => localizedValues['to'][locale.languageCode]; + String get holiday => localizedValues['holiday']![locale.languageCode]!; - String get coveringDoctor => - localizedValues['coveringDoctor'][locale.languageCode]; + String get to => localizedValues['to']![locale.languageCode]!; - String get requestLeave => - localizedValues['requestLeave'][locale.languageCode]; + String get coveringDoctor => localizedValues['coveringDoctor']![locale.languageCode]!; - String get pleaseEnterDate => - localizedValues['pleaseEnterDate'][locale.languageCode]; + String get requestLeave => localizedValues['requestLeave']![locale.languageCode]!; - String get pleaseEnterNoOfDays => - localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String get pleaseEnterDate => localizedValues['pleaseEnterDate']![locale.languageCode]!; - String get pleaseEnterRemarks => - localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays']![locale.languageCode]!; - String get update => localizedValues['update'][locale.languageCode]; + String get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks']![locale.languageCode]!; - String get admission => localizedValues['admission'][locale.languageCode]; + String get update => localizedValues['update']![locale.languageCode]!; - String get request => localizedValues['request'][locale.languageCode]; + String get admission => localizedValues['admission']![locale.languageCode]!; - String get admissionRequest => - localizedValues['admissionRequest'][locale.languageCode]; + String get request => localizedValues['request']![locale.languageCode]!; - String get patientDetails => - localizedValues['patientDetails'][locale.languageCode]; + String get admissionRequest => localizedValues['admissionRequest']![locale.languageCode]!; - String get specialityAndDoctorDetail => - localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String get patientDetails => localizedValues['patientDetails']![locale.languageCode]!; - String get referringDate => - localizedValues['referringDate'][locale.languageCode]; + String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail']![locale.languageCode]!; - String get referringDoctor => - localizedValues['referringDoctor'][locale.languageCode]; + String get referringDate => localizedValues['referringDate']![locale.languageCode]!; - String get otherInformation => - localizedValues['otherInformation'][locale.languageCode]; + String get referringDoctor => localizedValues['referringDoctor']![locale.languageCode]!; - String get expectedDays => - localizedValues['expectedDays'][locale.languageCode]; + String get otherInformation => localizedValues['otherInformation']![locale.languageCode]!; - String get expectedAdmissionDate => - localizedValues['expectedAdmissionDate'][locale.languageCode]; + String get expectedDays => localizedValues['expectedDays']![locale.languageCode]!; - String get emergencyAdmission => - localizedValues['emergencyAdmission'][locale.languageCode]; + String get expectedAdmissionDate => localizedValues['expectedAdmissionDate']![locale.languageCode]!; - String get isSickLeaveRequired => - localizedValues['isSickLeaveRequired'][locale.languageCode]; + String get emergencyAdmission => localizedValues['emergencyAdmission']![locale.languageCode]!; - String get patientPregnant => - localizedValues['patientPregnant'][locale.languageCode]; + String get isSickLeaveRequired => localizedValues['isSickLeaveRequired']![locale.languageCode]!; - String get treatmentLine => - localizedValues['treatmentLine'][locale.languageCode]; + String get patientPregnant => localizedValues['patientPregnant']![locale.languageCode]!; - String get ward => localizedValues['ward'][locale.languageCode]; + String get treatmentLine => localizedValues['treatmentLine']![locale.languageCode]!; - String get preAnesthesiaReferred => - localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String get ward => localizedValues['ward']![locale.languageCode]!; - String get admissionType => - localizedValues['admissionType'][locale.languageCode]; + String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred']![locale.languageCode]!; - String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; + String get admissionType => localizedValues['admissionType']![locale.languageCode]!; - String get allergies => localizedValues['allergies'][locale.languageCode]; + String get diagnosis => localizedValues['diagnosis']![locale.languageCode]!; - String get preOperativeOrders => - localizedValues['preOperativeOrders'][locale.languageCode]; + String get allergies => localizedValues['allergies']![locale.languageCode]!; - String get elementForImprovement => - localizedValues['elementForImprovement'][locale.languageCode]; + String get preOperativeOrders => localizedValues['preOperativeOrders']![locale.languageCode]!; - String get dischargeDate => - localizedValues['dischargeDate'][locale.languageCode]; + String get elementForImprovement => localizedValues['elementForImprovement']![locale.languageCode]!; - String get dietType => localizedValues['dietType'][locale.languageCode]; + String get dischargeDate => localizedValues['dischargeDate']![locale.languageCode]!; - String get dietTypeRemarks => - localizedValues['dietTypeRemarks'][locale.languageCode]; + String get dietType => localizedValues['dietType']![locale.languageCode]!; - String get save => localizedValues['save'][locale.languageCode]; + String get dietTypeRemarks => localizedValues['dietTypeRemarks']![locale.languageCode]!; - String get postPlansEstimatedCost => - localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get save => localizedValues['save']![locale.languageCode]!; - String get postPlans => localizedValues['postPlans'][locale.languageCode]; + String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost']![locale.languageCode]!; - String get ucaf => localizedValues['ucaf'][locale.languageCode]; + String get postPlans => localizedValues['postPlans']![locale.languageCode]!; - String get emergencyCase => - localizedValues['emergencyCase'][locale.languageCode]; + String get ucaf => localizedValues['ucaf']![locale.languageCode]!; - String get durationOfIllness => - localizedValues['durationOfIllness'][locale.languageCode]; + String get emergencyCase => localizedValues['emergencyCase']![locale.languageCode]!; - String get chiefComplaintsAndSymptoms => - localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String get durationOfIllness => localizedValues['durationOfIllness']![locale.languageCode]!; - String get patientFeelsPainInHisBackAndCough => - localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; + String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]!; - String get additionalTextComplaints => - localizedValues['additionalTextComplaints'][locale.languageCode]; + String get patientFeelsPainInHisBackAndCough => localizedValues['patientFeelsPainInHisBackAndCough']![locale.languageCode]!; - String get otherConditions => - localizedValues['otherConditions'][locale.languageCode]; + String get additionalTextComplaints => localizedValues['additionalTextComplaints']![locale.languageCode]!; - String get other => localizedValues['other'][locale.languageCode]; + String get otherConditions => localizedValues['otherConditions']![locale.languageCode]!; - String get how => localizedValues['how'][locale.languageCode]; + String get other => localizedValues['other']![locale.languageCode]!; - String get when => localizedValues['when'][locale.languageCode]; + String get how => localizedValues['how']![locale.languageCode]!; - String get where => localizedValues['where'][locale.languageCode]; + String get when => localizedValues['when']![locale.languageCode]!; - String get specifyPossibleLineManagement => - localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String get where => localizedValues['where']![locale.languageCode]!; - String get significantSigns => - localizedValues['significantSigns'][locale.languageCode]; + String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement']![locale.languageCode]!; - String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String get significantSigns => localizedValues['significantSigns']![locale.languageCode]!; - String get reasons => localizedValues['reasons'][locale.languageCode]; + String get backAbdomen => localizedValues['backAbdomen']![locale.languageCode]!; - String get createNew => localizedValues['createNew'][locale.languageCode]; + String get reasons => localizedValues['reasons']![locale.languageCode]!; - String get episode => localizedValues['episode'][locale.languageCode]; + String get createNew => localizedValues['createNew']![locale.languageCode]!; - String get medications => localizedValues['medications'][locale.languageCode]; + String get episode => localizedValues['episode']![locale.languageCode]!; - String get medication => localizedValues['medication'][locale.languageCode]; + String get medications => localizedValues['medications']![locale.languageCode]!; - String get doctorComments => localizedValues['doctorComments'][locale.languageCode]; + String get medication => localizedValues['medication']![locale.languageCode]!; - String get statusDescription => localizedValues['statusDescription'][locale.languageCode]; + String get doctorComments => localizedValues['doctorComments']![locale.languageCode]!; - String get createdByName => localizedValues['createdByName'][locale.languageCode]; + String get statusDescription => localizedValues['statusDescription']![locale.languageCode]!; - String get procedures => localizedValues['procedures'][locale.languageCode]; + String get createdByName => localizedValues['createdByName']![locale.languageCode]!; - String get chiefComplaints => - localizedValues['chiefComplaints'][locale.languageCode]; + String get procedures => localizedValues['procedures']![locale.languageCode]!; - String get histories => localizedValues['histories'][locale.languageCode]; + String get chiefComplaints => localizedValues['chiefComplaints']![locale.languageCode]!; - String get allergiesSoap => - localizedValues['allergiesSoap'][locale.languageCode]; + String get histories => localizedValues['histories']![locale.languageCode]!; - String get addChiefComplaints => - localizedValues['addChiefComplaints'][locale.languageCode]; + String get allergiesSoap => localizedValues['allergiesSoap']![locale.languageCode]!; - String get historyOfPresentIllness => - localizedValues['historyOfPresentIllness'][locale.languageCode]; + String get addChiefComplaints => localizedValues['addChiefComplaints']![locale.languageCode]!; - String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; + String get historyOfPresentIllness => localizedValues['historyOfPresentIllness']![locale.languageCode]!; - String get addHistory => localizedValues['addHistory'][locale.languageCode]; + String get requiredMsg => localizedValues['requiredMsg']![locale.languageCode]!; - String get searchHistory => - localizedValues['searchHistory'][locale.languageCode]; + String get addHistory => localizedValues['addHistory']![locale.languageCode]!; - String get addSelectedHistories => - localizedValues['addSelectedHistories'][locale.languageCode]; + String get searchHistory => localizedValues['searchHistory']![locale.languageCode]!; - String get addAllergies => - localizedValues['addAllergies'][locale.languageCode]; + String get addSelectedHistories => localizedValues['addSelectedHistories']![locale.languageCode]!; - String get itemExist => localizedValues['itemExist'][locale.languageCode]; + String get addAllergies => localizedValues['addAllergies']![locale.languageCode]!; - String get selectAllergy => - localizedValues['selectAllergy'][locale.languageCode]; + String get itemExist => localizedValues['itemExist']![locale.languageCode]!; - String get selectSeverity => - localizedValues['selectSeverity'][locale.languageCode]; + String get selectAllergy => localizedValues['selectAllergy']![locale.languageCode]!; - String get leaveCreated => - localizedValues['leaveCreated'][locale.languageCode]; + String get selectSeverity => localizedValues['selectSeverity']![locale.languageCode]!; - String get vitalSignEmptyMsg => - localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String get leaveCreated => localizedValues['leaveCreated']![locale.languageCode]!; - String get referralEmptyMsg => - localizedValues['referralEmptyMsg'][locale.languageCode]; + String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg']![locale.languageCode]!; - String get referralSuccessMsg => - localizedValues['referralSuccessMsg'][locale.languageCode]; + String get referralEmptyMsg => localizedValues['referralEmptyMsg']![locale.languageCode]!; - String get diagnoseType => - localizedValues['diagnoseType'][locale.languageCode]; + String get referralSuccessMsg => localizedValues['referralSuccessMsg']![locale.languageCode]!; - String get condition => localizedValues['condition'][locale.languageCode]; + String get diagnoseType => localizedValues['diagnoseType']![locale.languageCode]!; - String get id => localizedValues['id'][locale.languageCode]; + String get condition => localizedValues['condition']![locale.languageCode]!; - String get quantity => localizedValues['quantity'][locale.languageCode]; + String get id => localizedValues['id']![locale.languageCode]!; - String get durDays => localizedValues['durDays'][locale.languageCode]; + String get quantity => localizedValues['quantity']![locale.languageCode]!; - String get codeNo => localizedValues['codeNo'][locale.languageCode]; + String get durDays => localizedValues['durDays']![locale.languageCode]!; - String get covered => localizedValues['covered'][locale.languageCode]; + String get codeNo => localizedValues['codeNo']![locale.languageCode]!; - String get approvalRequired => - localizedValues['approvalRequired'][locale.languageCode]; + String get covered => localizedValues['covered']![locale.languageCode]!; - String get uncoveredByDoctor => - localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get approvalRequired => localizedValues['approvalRequired']![locale.languageCode]!; - String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get uncoveredByDoctor => localizedValues['uncoveredByDoctor']![locale.languageCode]!; - String get moreVerification => - localizedValues['more-verify'][locale.languageCode]; + String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]!; - String get welcomeBack => - localizedValues['welcome-back'][locale.languageCode]; + String get moreVerification => localizedValues['more-verify']![locale.languageCode]!; - String get accountInfo => - localizedValues['account-info'][locale.languageCode]; + String get welcomeBack => localizedValues['welcome-back']![locale.languageCode]!; - String get useAnotherAccount => - localizedValues['another-acc'][locale.languageCode]; + String get accountInfo => localizedValues['account-info']![locale.languageCode]!; - String get verifyLoginWith => - localizedValues['verify-login-with'][locale.languageCode]; + String get useAnotherAccount => localizedValues['another-acc']![locale.languageCode]!; - String get register => localizedValues['register-user'][locale.languageCode]; + String get verifyLoginWith => localizedValues['verify-login-with']![locale.languageCode]!; - String get verifyFingerprint => - localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get register => localizedValues['register-user']![locale.languageCode]!; - String get verifyFaceID => - localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifyFingerprint => localizedValues['verify-with-fingerprint']![locale.languageCode]!; - String get verifySMS => - localizedValues['verify-with-sms'][locale.languageCode]; + String get verifyFaceID => localizedValues['verify-with-faceid']![locale.languageCode]!; - String get verifyWith => localizedValues['verify-with'][locale.languageCode]; + String get verifySMS => localizedValues['verify-with-sms']![locale.languageCode]!; - String get verifyWhatsApp => - localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get verifyWith => localizedValues['verify-with']![locale.languageCode]!; - String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + String get verifyWhatsApp => localizedValues['verify-with-whatsapp']![locale.languageCode]!; - String get lastLoginWith => - localizedValues['last-login-with'][locale.languageCode]; + String get lastLoginAt => localizedValues['last-login']![locale.languageCode]!; - String get verifyFingerprint2 => - localizedValues['verify-fingerprint'][locale.languageCode]; + String get lastLoginWith => localizedValues['last-login-with']![locale.languageCode]!; - String get verificationMessage => - localizedValues['verification_message'][locale.languageCode]; + String get verifyFingerprint2 => localizedValues['verify-fingerprint']![locale.languageCode]!; - String get validationMessage => - localizedValues['validation_message'][locale.languageCode]; + String get verificationMessage => localizedValues['verification_message']![locale.languageCode]!; - String get addAssessment => - localizedValues['addAssessment'][locale.languageCode]; + String get validationMessage => localizedValues['validation_message']![locale.languageCode]!; - String get assessment => localizedValues['assessment'][locale.languageCode]; + String get addAssessment => localizedValues['addAssessment']![locale.languageCode]!; - String get physicalSystemExamination => - localizedValues['physicalSystemExamination'][locale.languageCode]; + String get assessment => localizedValues['assessment']![locale.languageCode]!; - String get searchExamination => - localizedValues['searchExamination'][locale.languageCode]; + String get physicalSystemExamination => localizedValues['physicalSystemExamination']![locale.languageCode]!; - String get addExamination => - localizedValues['addExamination'][locale.languageCode]; + String get searchExamination => localizedValues['searchExamination']![locale.languageCode]!; - String get doc => localizedValues['doc'][locale.languageCode]; + String get addExamination => localizedValues['addExamination']![locale.languageCode]!; - String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; + String get doc => localizedValues['doc']![locale.languageCode]!; - String get normal => localizedValues['normal'][locale.languageCode]; + String get allergicTO => localizedValues['allergicTO']![locale.languageCode]!; - String get notExamined => localizedValues['notExamined'][locale.languageCode]; + String get normal => localizedValues['normal']![locale.languageCode]!; - String get abnormal => localizedValues['abnormal'][locale.languageCode]; + String get notExamined => localizedValues['notExamined']![locale.languageCode]!; - String get patientNoDetailErrMsg => - localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String get abnormal => localizedValues['abnormal']![locale.languageCode]!; - String get systolicLng => - localizedValues['systolic-lng'][locale.languageCode]; + String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg']![locale.languageCode]!; - String get diastolicLng => - localizedValues['diastolic-lng'][locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng']![locale.languageCode]!; - String get mass => localizedValues['mass'][locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng']![locale.languageCode]!; - String get tempC => localizedValues['temp-c'][locale.languageCode]; + String get mass => localizedValues['mass']![locale.languageCode]!; - String get bpm => localizedValues['bpm'][locale.languageCode]; + String get tempC => localizedValues['temp-c']![locale.languageCode]!; - String get respirationSigns => - localizedValues['respiration-signs'][locale.languageCode]; + String get bpm => localizedValues['bpm']![locale.languageCode]!; - String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String get respirationSigns => localizedValues['respiration-signs']![locale.languageCode]!; - String get body => localizedValues['body'][locale.languageCode]; + String get sysDias => localizedValues['sys-dias']![locale.languageCode]!; - String get respirationRate => - localizedValues['respirationRate'][locale.languageCode]; + String get body => localizedValues['body']![locale.languageCode]!; - String get heart => localizedValues['heart'][locale.languageCode]; + String get respirationRate => localizedValues['respirationRate']![locale.languageCode]!; - String get medicalReport => - localizedValues['medicalReport'][locale.languageCode]; + String get heart => localizedValues['heart']![locale.languageCode]!; - String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String get medicalReport => localizedValues['medicalReport']![locale.languageCode]!; - String get test => localizedValues['test'][locale.languageCode]; + String get visitDate => localizedValues['visitDate']![locale.languageCode]!; - String get addMoreProcedure => - localizedValues['addMoreProcedure'][locale.languageCode]; + String get test => localizedValues['test']![locale.languageCode]!; - String get regular => localizedValues['regular'][locale.languageCode]; + String get addMoreProcedure => localizedValues['addMoreProcedure']![locale.languageCode]!; - String get searchProcedures => - localizedValues['searchProcedures'][locale.languageCode]; + String get regular => localizedValues['regular']![locale.languageCode]!; - String get procedureCategorise => - localizedValues['procedureCategorise'][locale.languageCode]; + String get searchProcedures => localizedValues['searchProcedures']![locale.languageCode]!; - String get selectProcedures => - localizedValues['selectProcedures'][locale.languageCode]; + String get procedureCategorise => localizedValues['procedureCategorise']![locale.languageCode]!; - String get addSelectedProcedures => - localizedValues['addSelectedProcedures'][locale.languageCode]; + String get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]!; - String get addProcedures => - localizedValues['addProcedures'][locale.languageCode]; + String get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]!; - String get updateProcedure => - localizedValues['updateProcedure'][locale.languageCode]; + String get addProcedures => localizedValues['addProcedures']![locale.languageCode]!; - String get orderProcedure => - localizedValues['orderProcedure'][locale.languageCode]; + String get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]!; - String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; + String get orderProcedure => localizedValues['orderProcedure']![locale.languageCode]!; - String get dType => localizedValues['dType'][locale.languageCode]; + String get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]!; - String get addAssessmentDetails => - localizedValues['addAssessmentDetails'][locale.languageCode]; + String get dType => localizedValues['dType']![locale.languageCode]!; - String get progressNoteSOAP => - localizedValues['progressNoteSOAP'][locale.languageCode]; + String get addAssessmentDetails => localizedValues['addAssessmentDetails']![locale.languageCode]!; - String get addProgressNote => - localizedValues['addProgressNote'][locale.languageCode]; + String get progressNoteSOAP => localizedValues['progressNoteSOAP']![locale.languageCode]!; - String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String get addProgressNote => localizedValues['addProgressNote']![locale.languageCode]!; - String get riskScore => localizedValues['riskScore'][locale.languageCode]; + String get createdBy => localizedValues['createdBy']![locale.languageCode]!; - String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String get riskScore => localizedValues['riskScore']![locale.languageCode]!; - String get currentMedications => - localizedValues['currentMedications'][locale.languageCode]; + String get editedBy => localizedValues['editedBy']![locale.languageCode]!; - String get noItem => localizedValues['noItem'][locale.languageCode]; + String get currentMedications => localizedValues['currentMedications']![locale.languageCode]!; - String get postUcafSuccessMsg => - localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String get noItem => localizedValues['noItem']![locale.languageCode]!; - String get vitalSignDetailEmpty => - localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg']![locale.languageCode]!; - String get onlyOfftimeHoliday => - localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty']![locale.languageCode]!; - String get active => localizedValues['active'][locale.languageCode]; + String get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday']![locale.languageCode]!; - String get hold => localizedValues['hold'][locale.languageCode]; + String get active => localizedValues['active']![locale.languageCode]!; - String get loading => localizedValues['loading'][locale.languageCode]; + String get hold => localizedValues['hold']![locale.languageCode]!; - String get assessmentErrorMsg => - localizedValues['assessmentErrorMsg'][locale.languageCode]; + String get loading => localizedValues['loading']![locale.languageCode]!; - String get examinationErrorMsg => - localizedValues['examinationErrorMsg'][locale.languageCode]; + String get assessmentErrorMsg => localizedValues['assessmentErrorMsg']![locale.languageCode]!; - String get progressNoteErrorMsg => - localizedValues['progressNoteErrorMsg'][locale.languageCode]; + String get examinationErrorMsg => localizedValues['examinationErrorMsg']![locale.languageCode]!; - String get chiefComplaintErrorMsg => - localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg']![locale.languageCode]!; - String get ICDName => localizedValues['ICDName'][locale.languageCode]; + String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg']![locale.languageCode]!; - String get referralStatus => - localizedValues['referralStatus'][locale.languageCode]; + String get ICDName => localizedValues['ICDName']![locale.languageCode]!; - String get referralRemark => - localizedValues['referralRemark'][locale.languageCode]; + String get referralStatus => localizedValues['referralStatus']![locale.languageCode]!; - String get offTime => localizedValues['offTime'][locale.languageCode]; + String get referralRemark => localizedValues['referralRemark']![locale.languageCode]!; - String get icd => localizedValues['icd'][locale.languageCode]; + String get offTime => localizedValues['offTime']![locale.languageCode]!; - String get days => localizedValues['days'][locale.languageCode]; + String get icd => localizedValues['icd']![locale.languageCode]!; - String get hr => localizedValues['hr'][locale.languageCode]; + String get days => localizedValues['days']![locale.languageCode]!; - String get min => localizedValues['min'][locale.languageCode]; + String get hr => localizedValues['hr']![locale.languageCode]!; - String get months => localizedValues['months'][locale.languageCode]; + String get min => localizedValues['min']![locale.languageCode]!; - String get years => localizedValues['years'][locale.languageCode]; + String get months => localizedValues['months']![locale.languageCode]!; - String get referralStatusHold => - localizedValues['referralStatusHold'][locale.languageCode]; + String get years => localizedValues['years']![locale.languageCode]!; - String get referralStatusActive => - localizedValues['referralStatusActive'][locale.languageCode]; + String get referralStatusHold => localizedValues['referralStatusHold']![locale.languageCode]!; - String get referralStatusCancelled => - localizedValues['referralStatusCancelled'][locale.languageCode]; + String get referralStatusActive => localizedValues['referralStatusActive']![locale.languageCode]!; - String get referralStatusCompleted => - localizedValues['referralStatusCompleted'][locale.languageCode]; + String get referralStatusCancelled => localizedValues['referralStatusCancelled']![locale.languageCode]!; - String get referralStatusNotSeen => - localizedValues['referralStatusNotSeen'][locale.languageCode]; + String get referralStatusCompleted => localizedValues['referralStatusCompleted']![locale.languageCode]!; - String get clinicSearch => - localizedValues['clinicSearch'][locale.languageCode]; + String get referralStatusNotSeen => localizedValues['referralStatusNotSeen']![locale.languageCode]!; - String get doctorSearch => - localizedValues['doctorSearch'][locale.languageCode]; + String get clinicSearch => localizedValues['clinicSearch']![locale.languageCode]!; - String get referralResponse => - localizedValues['referralResponse'][locale.languageCode]; + String get doctorSearch => localizedValues['doctorSearch']![locale.languageCode]!; - String get estimatedCost => - localizedValues['estimatedCost'][locale.languageCode]; + String get referralResponse => localizedValues['referralResponse']![locale.languageCode]!; - String get diagnosisDetail => - localizedValues['diagnosisDetail'][locale.languageCode]; + String get estimatedCost => localizedValues['estimatedCost']![locale.languageCode]!; - String get referralSuccessMsgAccept => - localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get diagnosisDetail => localizedValues['diagnosisDetail']![locale.languageCode]!; - String get referralSuccessMsgReject => - localizedValues['referralSuccessMsgReject'][locale.languageCode]; + String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept']![locale.languageCode]!; - String get patientName => - localizedValues['patient-name'][locale.languageCode]; + String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject']![locale.languageCode]!; - String get appointmentNumber => - localizedValues['appointmentNumber'][locale.languageCode]; + String get patientName => localizedValues['patient-name']![locale.languageCode]!; - String get sickLeaveComments => - localizedValues['sickLeaveComments'][locale.languageCode]; + String get appointmentNumber => localizedValues['appointmentNumber']![locale.languageCode]!; - String get pastMedicalHistory => - localizedValues['pastMedicalHistory'][locale.languageCode]; + String get sickLeaveComments => localizedValues['sickLeaveComments']![locale.languageCode]!; - String get pastSurgicalHistory => - localizedValues['pastSurgicalHistory'][locale.languageCode]; + String get pastMedicalHistory => localizedValues['pastMedicalHistory']![locale.languageCode]!; - String get complications => - localizedValues['complications'][locale.languageCode]; + String get pastSurgicalHistory => localizedValues['pastSurgicalHistory']![locale.languageCode]!; - String get floor => localizedValues['floor'][locale.languageCode]; + String get complications => localizedValues['complications']![locale.languageCode]!; - String get roomCategory => - localizedValues['roomCategory'][locale.languageCode]; + String get floor => localizedValues['floor']![locale.languageCode]!; - String get otherDepartmentsInterventions => - localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + String get roomCategory => localizedValues['roomCategory']![locale.languageCode]!; - String get otherProcedure => - localizedValues['otherProcedure'][locale.languageCode]; + String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions']![locale.languageCode]!; - String get admissionRequestSuccessMsg => - localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + String get otherProcedure => localizedValues['otherProcedure']![locale.languageCode]!; - String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; + String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg']![locale.languageCode]!; - String get doctorResponse => - localizedValues['doctorResponse'][locale.languageCode]; + String get infoStatus => localizedValues['infoStatus']![locale.languageCode]!; - String get sickleaveonhold => - localizedValues['sickleaveonhold'][locale.languageCode]; + String get doctorResponse => localizedValues['doctorResponse']![locale.languageCode]!; - String get noClinic => localizedValues['no-clinic'][locale.languageCode]; + String get sickleaveonhold => localizedValues['sickleaveonhold']![locale.languageCode]!; - String get otherStatistic => - localizedValues['otherStatistic'][locale.languageCode]; + String get noClinic => localizedValues['no-clinic']![locale.languageCode]!; - String get patientsreferral => - localizedValues['ptientsreferral'][locale.languageCode]; + String get otherStatistic => localizedValues['otherStatistic']![locale.languageCode]!; - String get myPatientsReferral => - localizedValues['myPatientsReferral'][locale.languageCode]; + String get patientsreferral => localizedValues['ptientsreferral']![locale.languageCode]!; - String get arrivalpatient => - localizedValues['arrivalpatient'][locale.languageCode]; + String get myPatientsReferral => localizedValues['myPatientsReferral']![locale.languageCode]!; - String get searchmedicinepatient => - localizedValues['searchmedicinepatient'][locale.languageCode]; + String get arrivalpatient => localizedValues['arrivalpatient']![locale.languageCode]!; - String get appointmentDate => - localizedValues['appointmentDate'][locale.languageCode]; + String get searchmedicinepatient => localizedValues['searchmedicinepatient']![locale.languageCode]!; - String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; + String get appointmentDate => localizedValues['appointmentDate']![locale.languageCode]!; - String get details => localizedValues['details'][locale.languageCode]; + String get arrivedP => localizedValues['arrived_p']![locale.languageCode]!; - String get liveCare => localizedValues['liveCare'][locale.languageCode]; + String get details => localizedValues['details']![locale.languageCode]!; - String get outpatient => localizedValues['out-patient'][locale.languageCode]; + String get liveCare => localizedValues['liveCare']![locale.languageCode]!; - String get billNo => localizedValues['BillNo'][locale.languageCode]; + String get outpatient => localizedValues['out-patient']![locale.languageCode]!; - String get labResults => localizedValues['labResults'][locale.languageCode]; + String get billNo => localizedValues['BillNo']![locale.languageCode]!; - String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get labResults => localizedValues['labResults']![locale.languageCode]!; - String get specialResult => - localizedValues['SpecialResult'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc']![locale.languageCode]!; - String get noDataAvailable => - localizedValues['noDataAvailable'][locale.languageCode]; + String get specialResult => localizedValues['SpecialResult']![locale.languageCode]!; - String get showMoreBtn => - localizedValues['show-more-btn'][locale.languageCode]; + String get noDataAvailable => localizedValues['noDataAvailable']![locale.languageCode]!; - String get showDetail => localizedValues['showDetail'][locale.languageCode]; + String get showMoreBtn => localizedValues['show-more-btn']![locale.languageCode]!; - String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; + String get showDetail => localizedValues['showDetail']![locale.languageCode]!; - String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; + String get viewProfile => localizedValues['viewProfile']![locale.languageCode]!; - String get reschedule => localizedValues['reschedule'][locale.languageCode]; + String get fileNumber => localizedValues['fileNumber']![locale.languageCode]!; - String get leaves => localizedValues['leaves'][locale.languageCode]; + String get reschedule => localizedValues['reschedule']![locale.languageCode]!; - String get openRad => localizedValues['open-rad'][locale.languageCode]; + String get leaves => localizedValues['leaves']![locale.languageCode]!; - String get totalApproval => - localizedValues['totalApproval'][locale.languageCode]; + String get openRad => localizedValues['open-rad']![locale.languageCode]!; - String get procedureStatus => - localizedValues['procedureStatus'][locale.languageCode]; + String get totalApproval => localizedValues['totalApproval']![locale.languageCode]!; - String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; + String get procedureStatus => localizedValues['procedureStatus']![locale.languageCode]!; - String get companyName => localizedValues['companyName'][locale.languageCode]; + String get unusedCount => localizedValues['unusedCount']![locale.languageCode]!; - String get procedureName => - localizedValues['procedureName'][locale.languageCode]; + String get companyName => localizedValues['companyName']![locale.languageCode]!; - String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + String get procedureName => localizedValues['procedureName']![locale.languageCode]!; - String get prescriptions => - localizedValues['prescriptions'][locale.languageCode]; + String get usageStatus => localizedValues['usageStatus']![locale.languageCode]!; - String get notes => localizedValues['notes'][locale.languageCode]; + String get prescriptions => localizedValues['prescriptions']![locale.languageCode]!; - String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; + String get notes => localizedValues['notes']![locale.languageCode]!; - String get searchWithOther => - localizedValues['searchWithOther'][locale.languageCode]; + String get dailyDoses => localizedValues['dailyDoses']![locale.languageCode]!; - String get hideOtherCriteria => - localizedValues['hideOtherCriteria'][locale.languageCode]; + String get searchWithOther => localizedValues['searchWithOther']![locale.languageCode]!; - String get applyForReschedule => - localizedValues['applyForReschedule'][locale.languageCode]; + String get hideOtherCriteria => localizedValues['hideOtherCriteria']![locale.languageCode]!; - String get startDate => localizedValues['startDate'][locale.languageCode]; + String get applyForReschedule => localizedValues['applyForReschedule']![locale.languageCode]!; - String get endDate => localizedValues['endDate'][locale.languageCode]; + String get startDate => localizedValues['startDate']![locale.languageCode]!; - String get addReschedule => - localizedValues['add-reschedule'][locale.languageCode]; + String get endDate => localizedValues['endDate']![locale.languageCode]!; - String get updateReschedule => - localizedValues['update-reschedule'][locale.languageCode]; + String get addReschedule => localizedValues['add-reschedule']![locale.languageCode]!; - String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; + String get updateReschedule => localizedValues['update-reschedule']![locale.languageCode]!; - String get accepted => localizedValues['accepted'][locale.languageCode]; + String get sickLeave => localizedValues['sick_leave']![locale.languageCode]!; - String get cancelled => localizedValues['cancelled'][locale.languageCode]; + String get accepted => localizedValues['accepted']![locale.languageCode]!; - String get unReplied => localizedValues['unReplied'][locale.languageCode]; + String get cancelled => localizedValues['cancelled']![locale.languageCode]!; - String get replied => localizedValues['replied'][locale.languageCode]; + String get unReplied => localizedValues['unReplied']![locale.languageCode]!; - String get typeHereToReply => - localizedValues['typeHereToReply'][locale.languageCode]; + String get replied => localizedValues['replied']![locale.languageCode]!; - String get searchHere => localizedValues['searchHere'][locale.languageCode]; + String get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode]!; - String get remove => localizedValues['remove'][locale.languageCode]; + String get searchHere => localizedValues['searchHere']![locale.languageCode]!; - String get inProgress => localizedValues['inProgress'][locale.languageCode]; + String get remove => localizedValues['remove']![locale.languageCode]!; - String get completed => localizedValues['Completed'][locale.languageCode]; + String get inProgress => localizedValues['inProgress']![locale.languageCode]!; - String get locked => localizedValues['Locked'][locale.languageCode]; + String get completed => localizedValues['Completed']![locale.languageCode]!; - String get step => localizedValues['step'][locale.languageCode]; + String get locked => localizedValues['Locked']![locale.languageCode]!; - String get fieldRequired => - localizedValues['fieldRequired'][locale.languageCode]; + String get step => localizedValues['step']![locale.languageCode]!; - String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; + String get fieldRequired => localizedValues['fieldRequired']![locale.languageCode]!; - String get changeOfSchedule => - localizedValues['changeOfSchedule'][locale.languageCode]; + String get noSickLeave => localizedValues['no-sickleve']![locale.languageCode]!; - String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; + String get changeOfSchedule => localizedValues['changeOfSchedule']![locale.languageCode]!; - String get enterCredentials => - localizedValues['enter_credentials'][locale.languageCode]; + String get newSchedule => localizedValues['newSchedule']![locale.languageCode]!; - String get patpatientIDMobilenationalientID => - localizedValues['patientIDMobilenational'][locale.languageCode]; + String get enterCredentials => localizedValues['enter_credentials']![locale.languageCode]!; - String get updateNow => localizedValues['updateNow'][locale.languageCode]; + String get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational']![locale.languageCode]!; - String get updateTheApp => - localizedValues['updateTheApp'][locale.languageCode]; + String get updateNow => localizedValues['updateNow']![locale.languageCode]!; - String get admissionDate => - localizedValues['admission-date'][locale.languageCode]; + String get updateTheApp => localizedValues['updateTheApp']![locale.languageCode]!; - String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; + String get admissionDate => localizedValues['admission-date']![locale.languageCode]!; - String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; + String get noOfDays => localizedValues['noOfDays']![locale.languageCode]!; - String get replayBefore => - localizedValues['replayBefore'][locale.languageCode]; + String get numOfDays => localizedValues['numOfDays']![locale.languageCode]!; - String get trySaying => localizedValues["try-saying"][locale.languageCode]; + String get replayBefore => localizedValues['replayBefore']![locale.languageCode]!; - String get acknowledged => - localizedValues['acknowledged'][locale.languageCode]; + String get trySaying => localizedValues["try-saying"]![locale.languageCode]!; - String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get acknowledged => localizedValues['acknowledged']![locale.languageCode]!; - String get pleaseEnterProcedure => - localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get didntCatch => localizedValues["didntCatch"]![locale.languageCode]!; - String get fillTheMandatoryProcedureDetails => - localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; + String get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"]![locale.languageCode]!; - String get atLeastThreeCharacters => - localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get fillTheMandatoryProcedureDetails => localizedValues["fillTheMandatoryProcedureDetails"]![locale.languageCode]!; - String get searchProcedureHere => - localizedValues["searchProcedureHere"][locale.languageCode]; + String get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"]![locale.languageCode]!; - String get noInsuranceApprovalFound => - localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get searchProcedureHere => localizedValues["searchProcedureHere"]![locale.languageCode]!; - String get procedure => localizedValues["procedure"][locale.languageCode]; + String get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"]![locale.languageCode]!; - String get stopDate => localizedValues["stopDate"][locale.languageCode]; + String get procedure => localizedValues["procedure"]![locale.languageCode]!; - String get processed => localizedValues["processed"][locale.languageCode]; + String get stopDate => localizedValues["stopDate"]![locale.languageCode]!; - String get direction => localizedValues["direction"][locale.languageCode]; + String get processed => localizedValues["processed"]![locale.languageCode]!; - String get refill => localizedValues["refill"][locale.languageCode]; + String get direction => localizedValues["direction"]![locale.languageCode]!; - String get medicationHasBeenAdded => - localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get refill => localizedValues["refill"]![locale.languageCode]!; - String get newPrescriptionOrder => - localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"]![locale.languageCode]!; - String get pleaseFillAllFields => - localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get newPrescriptionOrder => localizedValues["newPrescriptionOrder"]![locale.languageCode]!; - String get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] - [locale.languageCode]; + String get pleaseFillAllFields => localizedValues["pleaseFillAllFields"]![locale.languageCode]!; - String get only5DigitsAllowedForStrength => - localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + String get narcoticMedicineCanOnlyBePrescribedFromVida => localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"]![locale.languageCode]!; - String get unit => localizedValues["unit"][locale.languageCode]; + String get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"]![locale.languageCode]!; - String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; + String get unit => localizedValues["unit"]![locale.languageCode]!; - String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; + String get boxQuantity => localizedValues["boxQuantity"]![locale.languageCode]!; - String get applyForRadiologyOrder => - localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get orderTestOr => localizedValues["orderTestOr"]![locale.languageCode]!; - String get applyForNewLabOrder => - localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"]![locale.languageCode]!; - String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; + String get applyForNewLabOrder => localizedValues["applyForNewLabOrder"]![locale.languageCode]!; - String get addRadiologyOrder => - localizedValues["addRadiologyOrder"][locale.languageCode]; + String get addLabOrder => localizedValues["addLabOrder"]![locale.languageCode]!; - String get newRadiologyOrder => - localizedValues["newRadiologyOrder"][locale.languageCode]; + String get addRadiologyOrder => localizedValues["addRadiologyOrder"]![locale.languageCode]!; - String get orderDate => localizedValues["orderDate"][locale.languageCode]; + String get newRadiologyOrder => localizedValues["newRadiologyOrder"]![locale.languageCode]!; - String get examType => localizedValues["examType"][locale.languageCode]; + String get orderDate => localizedValues["orderDate"]![locale.languageCode]!; - String get health => localizedValues["health"][locale.languageCode]; + String get examType => localizedValues["examType"]![locale.languageCode]!; - String get summary => localizedValues["summary"][locale.languageCode]; + String get health => localizedValues["health"]![locale.languageCode]!; - String get applyForNewPrescriptionsOrder => - localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get summary => localizedValues["summary"]![locale.languageCode]!; - String get noPrescriptionsFound => - localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"]![locale.languageCode]!; - String get noMedicalFileFound => - localizedValues["noMedicalFileFound"][locale.languageCode]; + String get noPrescriptionsFound => localizedValues["noPrescriptionsFound"]![locale.languageCode]!; - String get insurance22 => localizedValues["insurance22"][locale.languageCode]; + String get noMedicalFileFound => localizedValues["noMedicalFileFound"]![locale.languageCode]!; - String get approvals22 => localizedValues["approvals22"][locale.languageCode]; + String get insurance22 => localizedValues["insurance22"]![locale.languageCode]!; - String get severe => localizedValues["severe"][locale.languageCode]; + String get approvals22 => localizedValues["approvals22"]![locale.languageCode]!; - String get graphDetails => - localizedValues["graphDetails"][locale.languageCode]; + String get severe => localizedValues["severe"]![locale.languageCode]!; - String get discharged => localizedValues["discharged"][locale.languageCode]; + String get graphDetails => localizedValues["graphDetails"]![locale.languageCode]!; - String get addNewOrderSheet => - localizedValues["addNewOrderSheet"][locale.languageCode]; + String get discharged => localizedValues["discharged"]![locale.languageCode]!; - String get addNewProgressNote => - localizedValues["addNewProgressNote"][locale.languageCode]; + String get addNewOrderSheet => localizedValues["addNewOrderSheet"]![locale.languageCode]!; - String get notePending => localizedValues["notePending"][locale.languageCode]; + String get addNewProgressNote => localizedValues["addNewProgressNote"]![locale.languageCode]!; - String get noteCanceled => - localizedValues["noteCanceled"][locale.languageCode]; + String get notePending => localizedValues["notePending"]![locale.languageCode]!; - String get noteVerified => - localizedValues["noteVerified"][locale.languageCode]; + String get noteCanceled => localizedValues["noteCanceled"]![locale.languageCode]!; - String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; + String get noteVerified => localizedValues["noteVerified"]![locale.languageCode]!; - String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; + String get noteVerify => localizedValues["noteVerify"]![locale.languageCode]!; - String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; + String get noteConfirm => localizedValues["noteConfirm"]![locale.languageCode]!; - String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; + String get noteAdd => localizedValues["noteAdd"]![locale.languageCode]!; - String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get noteUpdate => localizedValues["noteUpdate"]![locale.languageCode]!; - String get order => localizedValues["order"][locale.languageCode]; + String get orderSheet => localizedValues["orderSheet"]![locale.languageCode]!; - String get sheet => localizedValues["sheet"][locale.languageCode]; + String get order => localizedValues["order"]![locale.languageCode]!; - String get medical => localizedValues["medical"][locale.languageCode]; + String get sheet => localizedValues["sheet"]![locale.languageCode]!; - String get report => localizedValues["report"][locale.languageCode]; + String get medical => localizedValues["medical"]![locale.languageCode]!; - String get discharge => localizedValues["discharge"][locale.languageCode]; + String get report => localizedValues["report"]![locale.languageCode]!; - String get none => localizedValues["none"][locale.languageCode]; + String get discharge => localizedValues["discharge"]![locale.languageCode]!; - String get notRepliedYet => - localizedValues["notRepliedYet"][locale.languageCode]; + String get none => localizedValues["none"]![locale.languageCode]!; - String get clearText => localizedValues["clearText"][locale.languageCode]; + String get notRepliedYet => localizedValues["notRepliedYet"]![locale.languageCode]!; - String get medicalReportAdd => - localizedValues['medicalReportAdd'][locale.languageCode]; + String get clearText => localizedValues["clearText"]![locale.languageCode]!; - String get medicalReportVerify => - localizedValues['medicalReportVerify'][locale.languageCode]; + String get medicalReportAdd => localizedValues['medicalReportAdd']![locale.languageCode]!; - String get comments => localizedValues['comments'][locale.languageCode]; + String get medicalReportVerify => localizedValues['medicalReportVerify']![locale.languageCode]!; - String get initiateCall => - localizedValues['initiateCall'][locale.languageCode]; + String get comments => localizedValues['comments']![locale.languageCode]!; - String get endCall => localizedValues['endCall'][locale.languageCode]; + String get initiateCall => localizedValues['initiateCall']![locale.languageCode]!; - String get transferTo => localizedValues['transferTo'][locale.languageCode]; + String get endCall => localizedValues['endCall']![locale.languageCode]!; - String get admin => localizedValues['admin'][locale.languageCode]; + String get transferTo => localizedValues['transferTo']![locale.languageCode]!; - String get instructions => - localizedValues['instructions'][locale.languageCode]; + String get admin => localizedValues['admin']![locale.languageCode]!; - String get sendLC => localizedValues['sendLC'][locale.languageCode]; + String get instructions => localizedValues['instructions']![locale.languageCode]!; - String get endLC => localizedValues['endLC'][locale.languageCode]; + String get sendLC => localizedValues['sendLC']![locale.languageCode]!; - String get consultation => - localizedValues['consultation'][locale.languageCode]; + String get endLC => localizedValues['endLC']![locale.languageCode]!; - String get resume => localizedValues['resume'][locale.languageCode]; + String get consultation => localizedValues['consultation']![locale.languageCode]!; - String get theCall => localizedValues['theCall'][locale.languageCode]; + String get resume => localizedValues['resume']![locale.languageCode]!; - String get createNewMedicalReport => - localizedValues['createNewMedicalReport'][locale.languageCode]; + String get theCall => localizedValues['theCall']![locale.languageCode]!; - String get historyPhysicalFinding => - localizedValues['historyPhysicalFinding'][locale.languageCode]; + String get createNewMedicalReport => localizedValues['createNewMedicalReport']![locale.languageCode]!; - String get laboratoryPhysicalData => - localizedValues['laboratoryPhysicalData'][locale.languageCode]; + String get historyPhysicalFinding => localizedValues['historyPhysicalFinding']![locale.languageCode]!; - String get impressionRecommendation => - localizedValues['impressionRecommendation'][locale.languageCode]; + String get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData']![locale.languageCode]!; - String get onHold => localizedValues['onHold'][locale.languageCode]; + String get impressionRecommendation => localizedValues['impressionRecommendation']![locale.languageCode]!; - String get verified => localizedValues['verified'][locale.languageCode]; + String get onHold => localizedValues['onHold']![locale.languageCode]!; - String get favoriteTemplates => - localizedValues['favoriteTemplates'][locale.languageCode]; + String get verified => localizedValues['verified']![locale.languageCode]!; - String get allProcedures => - localizedValues['allProcedures'][locale.languageCode]; + String get favoriteTemplates => localizedValues['favoriteTemplates']![locale.languageCode]!; - String get allRadiology => - localizedValues['allRadiology'][locale.languageCode]; + String get allProcedures => localizedValues['allProcedures']![locale.languageCode]!; - String get allLab => localizedValues['allLab'][locale.languageCode]; + String get allRadiology => localizedValues['allRadiology']![locale.languageCode]!; - String get allPrescription => - localizedValues['allPrescription'][locale.languageCode]; + String get allLab => localizedValues['allLab']![locale.languageCode]!; - String get addPrescription => - localizedValues['addPrescription'][locale.languageCode]; + String get allPrescription => localizedValues['allPrescription']![locale.languageCode]!; - String get edit => localizedValues['edit'][locale.languageCode]; + String get addPrescription => localizedValues['addPrescription']![locale.languageCode]!; - String get summeryReply => - localizedValues['summeryReply'][locale.languageCode]; + String get edit => localizedValues['edit']![locale.languageCode]!; - String get severityValidationError => - localizedValues['severityValidationError'][locale.languageCode]; + String get summeryReply => localizedValues['summeryReply']![locale.languageCode]!; - String get textCopiedSuccessfully => - localizedValues['textCopiedSuccessfully'][locale.languageCode]; + String get severityValidationError => localizedValues['severityValidationError']![locale.languageCode]!; - String get roomNo => localizedValues['roomNo'][locale.languageCode]; + String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully']![locale.languageCode]!; - String get seeMore => localizedValues['seeMore'][locale.languageCode]; + String get roomNo => localizedValues['roomNo']![locale.languageCode]!; - String get replayCallStatus => - localizedValues['replayCallStatus'][locale.languageCode]; + String get seeMore => localizedValues['seeMore']![locale.languageCode]!; - String get patientArrived => - localizedValues['patientArrived'][locale.languageCode]; + String get replayCallStatus => localizedValues['replayCallStatus']![locale.languageCode]!; - String get calledAndNoResponse => - localizedValues['calledAndNoResponse'][locale.languageCode]; + String get patientArrived => localizedValues['patientArrived']![locale.languageCode]!; - String get underProcess => - localizedValues['underProcess'][locale.languageCode]; + String get calledAndNoResponse => localizedValues['calledAndNoResponse']![locale.languageCode]!; - String get textResponse => - localizedValues['textResponse'][locale.languageCode]; + String get underProcess => localizedValues['underProcess']![locale.languageCode]!; - String get special => localizedValues['special'][locale.languageCode]; + String get textResponse => localizedValues['textResponse']![locale.languageCode]!; - String get requestType => localizedValues['requestType'][locale.languageCode]; + String get special => localizedValues['special']![locale.languageCode]!; - String get allClinic => localizedValues['allClinic'][locale.languageCode]; + String get requestType => localizedValues['requestType']![locale.languageCode]!; - String get notReplied => localizedValues['notReplied'][locale.languageCode]; + String get allClinic => localizedValues['allClinic']![locale.languageCode]!; - String get registerNewPatient => - localizedValues['registerNewPatient'][locale.languageCode]; + String get notReplied => localizedValues['notReplied']![locale.languageCode]!; - String get registeraPatient => - localizedValues['registeraPatient'][locale.languageCode]; + String get registerNewPatient => localizedValues['registerNewPatient']![locale.languageCode]!; - String get operationTimeStart => - localizedValues['operationTimeStart'][locale.languageCode]; + String get registeraPatient => localizedValues['registeraPatient']![locale.languageCode]!; - String get operationDate => - localizedValues['operationDate'][locale.languageCode]; + String get operationTimeStart => localizedValues['operationTimeStart']![locale.languageCode]!; - String get reservation => localizedValues['reservation'][locale.languageCode]; + String get operationDate => localizedValues['operationDate']![locale.languageCode]!; - String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; + String get reservation => localizedValues['reservation']![locale.languageCode]!; - String get bloodTransfusedDetail => - localizedValues['bloodTransfusedDetail'][locale.languageCode]; + String get anesthetist => localizedValues['anesthetist']![locale.languageCode]!; - String get circulatingNurse => - localizedValues['circulatingNurse'][locale.languageCode]; + String get bloodTransfusedDetail => localizedValues['bloodTransfusedDetail']![locale.languageCode]!; - String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; + String get circulatingNurse => localizedValues['circulatingNurse']![locale.languageCode]!; - String get otherSpecimen => - localizedValues['otherSpecimen'][locale.languageCode]; + String get scrubNurse => localizedValues['scrubNurse']![locale.languageCode]!; - String get microbiologySpecimen => - localizedValues['microbiologySpecimen'][locale.languageCode]; + String get otherSpecimen => localizedValues['otherSpecimen']![locale.languageCode]!; - String get histopathSpecimen => - localizedValues['histopathSpecimen'][locale.languageCode]; + String get microbiologySpecimen => localizedValues['microbiologySpecimen']![locale.languageCode]!; - String get bloodLossDetail => - localizedValues['bloodLossDetail'][locale.languageCode]; + String get histopathSpecimen => localizedValues['histopathSpecimen']![locale.languageCode]!; - String get complicationDetails1 => - localizedValues['complicationDetails1'][locale.languageCode]; + String get bloodLossDetail => localizedValues['bloodLossDetail']![locale.languageCode]!; - String get postOperationInstruction => - localizedValues['postOperationInstruction'][locale.languageCode]; + String get complicationDetails1 => localizedValues['complicationDetails1']![locale.languageCode]!; - String get surgeryProcedure => - localizedValues['surgeryProcedure'][locale.languageCode]; + String get postOperationInstruction => localizedValues['postOperationInstruction']![locale.languageCode]!; - String get finding => localizedValues['finding'][locale.languageCode]; + String get surgeryProcedure => localizedValues['surgeryProcedure']![locale.languageCode]!; - String get preOperationDiagnosis => - localizedValues['preOperationDiagnosis'][locale.languageCode]; + String get finding => localizedValues['finding']![locale.languageCode]!; - String get postOperationDiagnosis => - localizedValues['postOperationDiagnosis'][locale.languageCode]; + String get preOperationDiagnosis => localizedValues['preOperationDiagnosis']![locale.languageCode]!; - String get surgeon => localizedValues['surgeon'][locale.languageCode]; + String get postOperationDiagnosis => localizedValues['postOperationDiagnosis']![locale.languageCode]!; - String get assistant => localizedValues['assistant'][locale.languageCode]; + String get surgeon => localizedValues['surgeon']![locale.languageCode]!; - String get askForIdentification => - localizedValues['askForIdentification'][locale.languageCode]; + String get assistant => localizedValues['assistant']![locale.languageCode]!; - String get iDNumber => localizedValues['iDNumber'][locale.languageCode]; + String get askForIdentification => localizedValues['askForIdentification']![locale.languageCode]!; - String get calender => localizedValues['calender'][locale.languageCode]; + String get iDNumber => localizedValues['iDNumber']![locale.languageCode]!; - String get gregorian => localizedValues['gregorian'][locale.languageCode]; + String get calender => localizedValues['calender']![locale.languageCode]!; - String get hijri => localizedValues['hijri'][locale.languageCode]; + String get gregorian => localizedValues['gregorian']![locale.languageCode]!; - String get birthdate => localizedValues['birthdate'][locale.languageCode]; + String get hijri => localizedValues['hijri']![locale.languageCode]!; - String get activation => localizedValues['activation'][locale.languageCode]; + String get birthdate => localizedValues['birthdate']![locale.languageCode]!; - String get confirmation => - localizedValues['confirmation'][locale.languageCode]; + String get activation => localizedValues['activation']![locale.languageCode]!; - String get diabetic => localizedValues['diabetic'][locale.languageCode]; + String get confirmation => localizedValues['confirmation']![locale.languageCode]!; - String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; + String get diabetic => localizedValues['diabetic']![locale.languageCode]!; - String get intervention => localizedValues['intervention'][locale.languageCode]; + String get pharmacy => localizedValues['pharmacy']![locale.languageCode]!; - String get chart => localizedValues['chart'][locale.languageCode]; + String get intervention => localizedValues['intervention']![locale.languageCode]!; - String get investigation => localizedValues['investigation'][locale.languageCode]; + String get chart => localizedValues['chart']![locale.languageCode]!; - String get conditionOnDischarge => localizedValues['conditionOnDischarge'][locale.languageCode]; + String get investigation => localizedValues['investigation']![locale.languageCode]!; - String get planedProcedure => localizedValues['planedProcedure'][locale.languageCode]; + String get conditionOnDischarge => localizedValues['conditionOnDischarge']![locale.languageCode]!; - String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; + String get planedProcedure => localizedValues['planedProcedure']![locale.languageCode]!; - String get VTE_Type => localizedValues['VTE_Type'][locale.languageCode]; + String get moreDetails => localizedValues['moreDetails']![locale.languageCode]!; - String get pharmacology => localizedValues['pharmacology'][locale.languageCode]; + String get VTE_Type => localizedValues['VTE_Type']![locale.languageCode]!; - String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode]; + String get pharmacology => localizedValues['pharmacology']![locale.languageCode]!; - String get youDoNotHaveFavoriteTemplate => localizedValues['youDoNotHaveFavoriteTemplate'][locale.languageCode]; + String get reasonsThrombo => localizedValues['reasonsThrombo']![locale.languageCode]!; - String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode]; + String get youDoNotHaveFavoriteTemplate => localizedValues['youDoNotHaveFavoriteTemplate']![locale.languageCode]!; - String get searchFavoriteTemplate => localizedValues['searchFavoriteTemplate'][locale.languageCode]; + String get pleaseSelectItem => localizedValues['pleaseSelectItem']![locale.languageCode]!; - String get sorryNoMatch => localizedValues['sorryNoMatch'][locale.languageCode]; + String get searchFavoriteTemplate => localizedValues['searchFavoriteTemplate']![locale.languageCode]!; - String get thousandIsTheMAXForTheStrength => localizedValues['thousandIsTheMAXForTheStrength'][locale.languageCode]; + String get sorryNoMatch => localizedValues['sorryNoMatch']![locale.languageCode]!; - String get strengthCanNotBeZero => localizedValues['strengthCanNotBeZero'][locale.languageCode]; + String get thousandIsTheMAXForTheStrength => localizedValues['thousandIsTheMAXForTheStrength']![locale.languageCode]!; - String get old => localizedValues['old'][locale.languageCode]; + String get strengthCanNotBeZero => localizedValues['strengthCanNotBeZero']![locale.languageCode]!; - String get orderTypeDescription => localizedValues['orderTypeDescription'][locale.languageCode]; + String get old => localizedValues['old']![locale.languageCode]!; - String get doseDetails => localizedValues['doseDetails'][locale.languageCode]; + String get orderTypeDescription => localizedValues['orderTypeDescription']![locale.languageCode]!; - String get selectCondition => localizedValues['selectCondition'][locale.languageCode]; + String get doseDetails => localizedValues['doseDetails']![locale.languageCode]!; - String get yourOrderAddedSuccessfully => localizedValues['yourOrderAddedSuccessfully'][locale.languageCode]; + String get selectCondition => localizedValues['selectCondition']![locale.languageCode]!; - String get youCannotAddOnlySpaces => localizedValues['youCannotAddOnlySpaces'][locale.languageCode]; + String get yourOrderAddedSuccessfully => localizedValues['yourOrderAddedSuccessfully']![locale.languageCode]!; - String get conditionDescription => localizedValues['conditionDescription'][locale.languageCode]; + String get youCannotAddOnlySpaces => localizedValues['youCannotAddOnlySpaces']![locale.languageCode]!; - String get doctorSchedule => localizedValues['doctorSchedule'][locale.languageCode]; - String get doctorRota => localizedValues['doctorRota'][locale.languageCode]; - String get dateFrom => localizedValues['dateFrom'][locale.languageCode]; - String get searchFindSchedule => localizedValues['searchFindSchedule'][locale.languageCode]; + String get conditionDescription => localizedValues['conditionDescription']![locale.languageCode]!; + + String get doctorSchedule => localizedValues['doctorSchedule']![locale.languageCode]!; + + String get doctorRota => localizedValues['doctorRota']![locale.languageCode]!; + + String get dateFrom => localizedValues['dateFrom']![locale.languageCode]!; + + String get searchFindSchedule => localizedValues['searchFindSchedule']![locale.languageCode]!; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 9907a032..8c098c4b 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -1,9 +1,9 @@ import 'package:connectivity/connectivity.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; -import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -13,11 +13,11 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:html/parser.dart'; -import '../update_page.dart'; + import '../config/size_config.dart'; import '../locator.dart'; +import '../update_page.dart'; import '../utils/dr_app_toast_msg.dart'; -import 'dr_app_shared_pref.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -42,7 +42,7 @@ class Utils { ), actions: [ AppButton( - onPressed: okFunction, + onPressed: okFunction(), title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, color: AppGlobal.appGreenColor, @@ -70,7 +70,7 @@ class Utils { 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, @@ -99,7 +99,7 @@ class Utils { ], ), ), - Container(height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model)) + Container(height: SizeConfig.realScreenHeight! * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model)) ], ), ); @@ -115,7 +115,7 @@ class Utils { children: items.map((item) { return Text( '${item.facilityName}', - style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), + style: TextStyle(fontSize: SizeConfig.textMultiplier! * 2), ); }).toList(), itemExtent: 25, @@ -214,12 +214,12 @@ class Utils { static String parseHtmlString(String htmlString) { final document = parse(htmlString); - final String parsedString = parse(document.body.text).documentElement.text; + final String parsedString = parse(document.body!.text).documentElement!.text; return parsedString; } - static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon? suffixIcon, Color? dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -279,7 +279,7 @@ class Utils { return htmlRegex.hasMatch(text); } - static String timeFrom({Duration duration}) { + static String timeFrom({required Duration duration}) { String twoDigits(int n) => n.toString().padLeft(2, "0"); String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); @@ -287,7 +287,7 @@ class Utils { } static double getTextFieldHeight() { - return SizeConfig.heightMultiplier * + return SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 10 : SizeConfig.isHeightShort @@ -309,9 +309,9 @@ class Utils { return kpi; } - static String convertToTitleCase(String text) { + static String convertToTitleCase(String? text) { if (text == null) { - return null; + return ""; } if (text.length <= 1) { diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart index 19578c2b..87b5231e 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -14,27 +14,27 @@ import 'package:url_launcher/url_launcher.dart'; import '../large_avatar.dart'; import 'header_row.dart'; -class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { +class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidget { final PatiantInformtion patient; final double height; final bool isInpatient; final bool isDischargedPatient; final bool isFromLiveCare; - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; + 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 visitDate; - final String clinic; + final String? episode; + final String? visitDate; + final String? clinic; final bool isAppointmentHeader; final bool isFromLabResult; - final VoidCallback onPressed; + final VoidCallback? onPressed; PatientProfileAppBar(this.patient, {this.height = 0.0, @@ -62,9 +62,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient.gender!; } return Container( @@ -86,7 +86,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { icon: Icon(Icons.arrow_back_ios), color: Color(0xFF2B353E), //Colors.black, onPressed: () { - if (onPressed != null) onPressed(); + if (onPressed != null) onPressed!(); Navigator.pop(context); }, ), @@ -94,8 +94,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { child: AppText( patient.firstName != null ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) - : Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 1.8, + : Utils.capitalize(patient.fullName ?? patient.patientDetails!.fullName), + fontSize: SizeConfig.textMultiplier! * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -115,7 +115,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -159,13 +159,13 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ) : AppText( TranslationBase.of(context).notArrived, - color: Colors.red[800], + color: Colors.red[800]!, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), patient.startTime != null - ? AppText(patient.startTime != null ? patient.startTime : '', + ? AppText(patient.startTime != null ? patient.startTime! : '', fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A)) : SizedBox() ], @@ -206,10 +206,10 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -222,24 +222,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { HeaderRow( label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), - if (patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult) + if (patient.appointmentDate != null && patient.appointmentDate!.isNotEmpty && !isFromLabResult) HeaderRow( label: TranslationBase.of(context).appointmentDate + " : ", - value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate)), + value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate!)), ), if (isFromLabResult) HeaderRow( label: "Result Date: ", - value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patient.admissionDate != null && patient.admissionDate.isNotEmpty) + if (patient.admissionDate != null && patient.admissionDate!.isNotEmpty) HeaderRow( label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ", value: patient.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", @@ -248,8 +248,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}", ) ], ), @@ -268,8 +268,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { 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( @@ -332,7 +332,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { if (!isMedicalFile) HeaderRow( label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', - value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', ), ]), ), @@ -361,6 +361,6 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? 137 : SizeConfig.isHeightShort ? 190 - : SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge ? 25 : 20) + : SizeConfig.heightMultiplier! * (SizeConfig.isWidthLarge ? 25 : 20) : height); } diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart index 7f19b5e4..fe13efcc 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart @@ -15,7 +15,7 @@ import 'package:url_launcher/url_launcher.dart'; import 'header_row.dart'; -class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { +class PatientProfileHeaderNewDesignAppBar extends StatelessWidget implements PreferredSizeWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; @@ -27,15 +27,15 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred final Stream videoCallDurationStream; PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, - {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, this.videoCallDurationStream}); + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, required this.videoCallDurationStream}); @override Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient.gender!; } return Container( padding: EdgeInsets.only( @@ -68,8 +68,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred child: AppText( patient.firstName != null ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) - : Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 1.8, + : Utils.capitalize(patient.fullName ?? patient.patientDetails!.fullName), + fontSize: SizeConfig.textMultiplier! * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), @@ -91,7 +91,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred eventCategory: "Patient Profile Header", eventAction: "Call Patient", ); - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -109,7 +109,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), child: Text( - snapshot.data, + snapshot.data!, style: TextStyle(color: Colors.white), ), ), @@ -155,19 +155,19 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred ) : AppText( TranslationBase.of(context).notArrived, - color: Colors.red[800], + color: Colors.red[800]!, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, ), 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 ? AppDateUtils.convertStringToDateFormat(patient.arrivedOn, 'MM-dd-yyyy HH:mm') : '', + patient.arrivedOn != null ? AppDateUtils.convertStringToDateFormat(patient.arrivedOn!, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) @@ -194,7 +194,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred child: AppText( patient.startTime ?? "", color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier!, textAlign: TextAlign.center, fontWeight: FontWeight.bold, ), @@ -206,7 +206,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred Container( child: AppText( convertDateFormat2(patient.appointmentDate ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier!, fontWeight: FontWeight.bold, ), ), @@ -245,10 +245,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text(''); }, )) @@ -261,7 +261,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred HeaderRow( label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) Column( @@ -274,8 +274,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}", ) ], ) @@ -290,7 +290,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred } convertDateFormat2(String str) { - String newDate; + String? newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 44106147..09379b37 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -12,19 +12,20 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; - final Widget body; + final Widget? body; final bool isLoading; final bool isShowAppBar; - final BaseViewModel baseViewModel; - final Widget bottomSheet; - final Color backgroundColor; - final Widget appBar; - final Widget drawer; - final Widget bottomNavigationBar; - final String subtitle; + final BaseViewModel? baseViewModel; + final Widget? bottomSheet; + final Color? backgroundColor; + final PreferredSizeWidget? appBar; + final Widget? drawer; + final Widget? bottomNavigationBar; + final String? subtitle; final bool isHomeIcon; final bool extendBody; - final Widget actionButton; + final Widget? actionButton; + AppScaffold( {this.appBarTitle = '', this.body, @@ -36,7 +37,8 @@ class AppScaffold extends StatelessWidget { this.isHomeIcon = true, this.appBar, this.subtitle, - this.drawer, this.actionButton, + this.drawer, + this.actionButton, this.extendBody = false, this.bottomNavigationBar}); @@ -49,8 +51,7 @@ class AppScaffold extends StatelessWidget { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor - , + backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, drawer: drawer, extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, @@ -60,18 +61,23 @@ class AppScaffold extends StatelessWidget { elevation: 0, backgroundColor: Colors.white, //HexColor('#515B5D'), - textTheme: TextTheme( - headline6: TextStyle( + toolbarTextStyle: TextStyle( color: Colors.black87, fontSize: 16.8, - )), + ), + //TextTheme( + // headline6: TextStyle( + // color: Colors.black87, + // fontSize: 16.8, + // )) + title: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Text(appBarTitle.toUpperCase()), if (subtitle != null) Text( - subtitle, + subtitle!, style: TextStyle(fontSize: 12, color: Colors.red), ), ], @@ -89,10 +95,11 @@ class AppScaffold extends StatelessWidget { ? IconButton( icon: Icon(DoctorApp.home_icon_active), color: Colors.black, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil( - context, HOME, (r) => false), + onPressed: () => Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false), ) - : actionButton !=null ? actionButton :SizedBox() + : actionButton != null + ? actionButton! + : SizedBox() ], ) : null, @@ -100,11 +107,10 @@ class AppScaffold extends StatelessWidget { body: projectProvider.isInternetConnection ? baseViewModel != null ? NetworkBaseView( - baseViewModel: baseViewModel, - child: body, + baseViewModel: baseViewModel!, + child: body!, ) - : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) + : Stack(children: [body!, 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 2ea3aa8f..509e516c 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -1,35 +1,34 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { final String text; - final String variant; + final String? variant; final Color color; - final FontWeight fontWeight; - final double fontSize; - final double fontHeight; + 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 double letterSpacing; - final TextAlign textAlign; - final bool bold; - final bool regular; - final bool medium; - final int maxLines; + final double? letterSpacing; + 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; final bool isCopyable; AppText( @@ -97,7 +96,7 @@ class _AppTextState extends State { Widget build(BuildContext context) { return GestureDetector( child: Container( - margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), + margin: widget.margin != null ? EdgeInsets.all(widget.margin!) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -131,7 +130,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", @@ -167,7 +166,7 @@ class _AppTextState extends State { // : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) + ? _getFontStyle()!.copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Color(0xff2E303A), @@ -184,10 +183,10 @@ class _AppTextState extends State { return Text( !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, + overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) + ? _getFontStyle()!.copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, @@ -201,7 +200,7 @@ class _AppTextState extends State { } } - TextStyle _getFontStyle() { + TextStyle? _getFontStyle() { switch (widget.style) { case "headline2": return Theme.of(context).textTheme.headline2; @@ -216,7 +215,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": @@ -263,7 +262,7 @@ class _AppTextState extends State { case "date": return 24.0; default: - return SizeConfig.textMultiplier * 2; + return SizeConfig.textMultiplier! * 2; } } @@ -309,7 +308,7 @@ class _AppTextState extends State { return FontWeight.w500; } } else { - return null; + return FontWeight.normal; } } } diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index ed06506c..a89d5f6a 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -1,5 +1,5 @@ -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:flutter/material.dart'; import '../../../config/config.dart'; @@ -11,16 +11,16 @@ class ListSelectDialog extends StatefulWidget { 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, @@ -31,7 +31,7 @@ class ListSelectDialog extends StatefulWidget { } class _ListSelectDialogState extends State { - List items = List(); + List items = []; @override void initState() { @@ -72,12 +72,12 @@ class _ListSelectDialogState extends State { height: MediaQuery.of(context).size.height * 0.5, 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: Utils.textFieldSelectorDecoration(widget.hintSearchText ?? TranslationBase.of(context).search, null, false, + decoration: Utils.textFieldSelectorDecoration(widget.hintSearchText ?? TranslationBase.of(context).search, "", false, suffixIcon: Icon( Icons.search, )), @@ -119,10 +119,10 @@ class _ListSelectDialogState extends State { } void filterSearchResults(String query) { - List dummySearchList = 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); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 3ea6fa43..5d032c73 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -12,10 +12,10 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + MasterKeyModel? selectedValue; final bool isICD; - MasterKeyDailog({@required this.list, @required this.okText, @required this.okFunction, this.selectedValue, this.isICD = false}); + MasterKeyDailog({required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -52,7 +52,7 @@ class _MasterKeyDailogState extends State { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5), ), onPressed: () { - this.widget.okFunction(widget.selectedValue); + this.widget.okFunction(widget.selectedValue!); Navigator.of(context).pop(); }); // set up the AlertDialog @@ -78,10 +78,10 @@ class _MasterKeyDailogState extends State { title: AppText( '${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.id.toString(), + groupValue: widget.isICD ? 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(), + selected: widget.isICD ? item.code.toString() == widget.selectedValue!.code.toString() : item.id.toString() == widget.selectedValue!.id.toString(), onChanged: (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 0bfa2a42..7584c674 100644 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -9,7 +9,7 @@ class ListSelectDialog extends StatefulWidget { final Function(dynamic) okFunction; dynamic selectedValue; - ListSelectDialog({@required this.list, @required this.attributeName, @required this.attributeValueId, @required this.okText, @required this.okFunction}); + ListSelectDialog({required this.list, required this.attributeName, required this.attributeValueId, required this.okText, required this.okFunction}); @override _ListSelectDialogState createState() => _ListSelectDialogState(); diff --git a/lib/widgets/shared/text_fields/TextFields.dart b/lib/widgets/shared/text_fields/TextFields.dart index 005d4c0e..d679fd06 100644 --- a/lib/widgets/shared/text_fields/TextFields.dart +++ b/lib/widgets/shared/text_fields/TextFields.dart @@ -38,7 +38,7 @@ final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { TextFields({ - Key key, + Key? key, this.type, this.hintText, this.suffixIcon, @@ -62,7 +62,7 @@ class TextFields extends StatefulWidget { this.borderOnlyError = false, this.onSaved, this.onSuffixTap, - this.readOnly: false, + this.readOnly = false, this.maxLength, this.prefixIcon, this.bare = false, @@ -81,26 +81,26 @@ class TextFields extends StatefulWidget { 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 bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; + 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 bool maxLengthEnforced; final bool bare; final TextInputAction inputAction; @@ -108,16 +108,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; @@ -179,14 +179,14 @@ class _TextFieldsState extends State { break; default: if (widget.suffixIcon != null) - return InkWell(onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); + return InkWell(onTap: widget.onSuffixTap!(), child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else - return null; + return SizedBox(); } } bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { + if (widget.readOnly != null && widget.readOnly!) { _focusNode.unfocus(); return true; } else { @@ -211,14 +211,14 @@ class _TextFieldsState extends State { child: Column( children: [ TextFormField( - onTap: widget.onTapTextFields, + onTap: widget.onTapTextFields!(), 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!() : (val) { _focusNode.nextFocus(); }) @@ -240,7 +240,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, @@ -250,8 +250,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(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + onSaved: widget.onSaved!(), + style: Theme.of(context).textTheme.bodyText1!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ // WhitelistingTextInputFormatter.digitsOnly, @@ -286,14 +286,14 @@ class _TextFieldsState extends State { borderSide: widget.hasBorder ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), + borderSide: widget.hasBorder ? 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), ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), + borderSide: widget.hasBorder ? 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: Colors.transparent, width: 0), + borderSide: widget.hasBorder ? 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), ), ), diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 6b5cd080..cef783bc 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -14,13 +14,13 @@ import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { final String hint; - final String initialText; + final String? initialText; final double height; - final BoxDecoration decoration; + final BoxDecoration? decoration; final bool darkMode; final bool showBottomToolbar; - final List toolbar; - final HtmlEditorController controller; + final List? toolbar; + final HtmlEditorController? controller; HtmlRichEditor({ key, @@ -39,7 +39,7 @@ class HtmlRichEditor extends StatefulWidget { } class _HtmlRichEditorState extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); @@ -64,7 +64,7 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - controller: widget.controller, + controller: widget.controller!, htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ StyleButtons(), FontSettingButtons(), @@ -88,19 +88,16 @@ class _HtmlRichEditorState extends State { borderRadius: BorderRadius.all( Radius.circular(30.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), )), Positioned( top: 50, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { initSpeechState().then((value) => {onVoiceText()}); }, @@ -114,8 +111,7 @@ class _HtmlRichEditorState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -146,13 +142,12 @@ class _HtmlRichEditorState extends State { void resultListener(result) async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String txt = await widget.controller.getText(); + String txt = await widget.controller!.getText(); if (result.finalResult == true) { setState(() { - widget.controller.setText(txt + recognizedWord); + widget.controller!.setText(txt + recognizedWord); SpeechToText.closeAlertDialog(context); - // speech.stop(); - + // speech.stop(); }); } else { print(result.finalResult); @@ -160,8 +155,7 @@ class _HtmlRichEditorState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } diff --git a/pubspec.yaml b/pubspec.yaml index e73526f3..befc7a04 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,11 +11,11 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.3.9+19 +version: 4.3.5+1 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=3.0.0 <3.13.0" #dependency_overrides: @@ -28,104 +28,122 @@ dependencies: flutter: sdk: flutter hexcolor: ^3.0.1 - flutter_localizations: - sdk: flutter flutter_device_type: ^0.4.0 - intl: ^0.17.0 - http: ^0.13.0 - provider: ^6.0.1 - shared_preferences: ^2.0.6 + http: ^1.1.2 + provider: ^6.1.1 + shared_preferences: ^2.2.2 # imei_plugin: ^1.2.0 # flutter_flexible_toast: ^0.1.4 - fluttertoast: ^8.0.8 - local_auth: 1.1.8 - http_interceptor: ^1.0.2 + fluttertoast: ^8.2.4 + local_auth: ^2.1.7 + http_interceptor: any connectivity: ^3.0.6 - maps_launcher: ^2.0.0 - url_launcher: ^6.0.6 + maps_launcher: ^2.2.0 + url_launcher: ^6.2.1 charts_flutter: ^0.12.0 - flutter_swiper: ^1.1.6 + #flutter_charts: ^0.5.2 + #gelin: ^0.1.6 + #flutter_swiper: ^1.1.6 + flutter_swiper_view: ^1.1.8 #Icons - eva_icons_flutter: ^3.0.0 - font_awesome_flutter: ^10.3.0 - dropdown_search: ^3.0.1 - flutter_staggered_grid_view: ^0.4.0 + eva_icons_flutter: ^3.1.0 + font_awesome_flutter: ^10.6.0 + dropdown_search: ^5.0.6 + flutter_staggered_grid_view: ^0.7.0 expandable: ^5.0.1 # Qr code Scanner - barcode_scan2: ^4.1.4 + barcode_scan2: ^4.3.0 # permissions - permission_handler: ^10.2.0 + permission_handler: ^11.1.0 device_info: ^2.0.2 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.3 + cupertino_icons: ^1.0.6 # SVG #flutter_svg: ^1.0.0 - percent_indicator: ^4.2.2 + percent_indicator: ^4.2.3 #Dependency Injection - get_it: ^7.1.3 + get_it: ^7.6.4 #chart - fl_chart: ^0.45.0 + fl_chart: ^0.65.0 # Firebase - firebase_messaging: ^14.2.1 - firebase_analytics : ^10.1.0 + firebase_messaging: ^14.7.5 + firebase_analytics : ^10.7.1 #GIF image - flutter_gifimage: ^1.0.1 - + # flutter_gifimage: ^1.0.1 + flutter_gif: ^0.0.4 + gif: ^2.3.0 #Autocomplete TextField autocomplete_textfield: ^2.0.1 date_time_picker: ^2.0.0 + flutter_datetime_picker_plus: ^2.1.0 # Html - html: ^0.15.0 + html: ^0.15.4 # Flutter Html View - flutter_html: ^2.1.0 + flutter_html: ^3.0.0-beta.2 + sticky_headers: ^0.3.0+2 - file_picker: ^4.6.1 + file_picker: 5.2.0+1 #speech to text # speech_to_text: # path: speech_to_text - speech_to_text: ^6.1.1 - quiver: ^3.0.0 + speech_to_text: ^6.4.1 + + quiver: ^3.2.1 flutter_colorpicker: ^1.0.3 # Html Editor Enhanced - html_editor_enhanced: ^2.1.1 + #html_editor_enhanced: any + html_editor_enhanced: ^2.5.1 + jhijri_picker: ^1.0.1 + jhijri: ^1.0.0 #Network Image - cached_network_image: ^3.1.0+1 + cached_network_image: ^3.3.0 # Badges - badges: ^2.0.1 + badges: ^3.1.2 # Hijri # hijri: ^2.0.3 hijri_picker: ^3.0.0 - flutter_datetime_picker: ^1.5.1 + #flutter_datetime_picker: ^1.5.1 + localization: ^2.1.1 # flutter_math_fork: ^0.6.0 -# flutter_math_fork: ^0.6.0 + # flutter_math_fork: ^0.6.0 + + flutter_math_fork: ^0.7.2 +dependency_overrides: + flutter_localizations: + sdk: flutter + intl: ^0.18.1 + #hijri_picker: ^3.0.0 + + dev_dependencies: flutter_test: sdk: flutter build_runner: any build_web_compilers: any + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -187,4 +205,5 @@ flutter: - asset: assets/fonts/DoctorApp.ttf # # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages \ No newline at end of file + # see https://flutter.dev/custom-fonts/#from-packages +