From 3b2ee0ef65464eee2aa3798c2ef54e8f1ab59ac7 Mon Sep 17 00:00:00 2001 From: Aamir Date: Wed, 13 Dec 2023 14:50:15 +0300 Subject: [PATCH] Null Safety Fixes --- lib/core/model/labs/lab_result_history.dart | 3 +- .../lab_order/labs_service.dart | 3 + .../viewModel/LiveCarePatientViewModel.dart | 52 +++---- lib/core/viewModel/SOAP_view_model.dart | 122 ++++++++-------- .../viewModel/patient-referral-viewmodel.dart | 88 ++++------- .../auth/verification_methods_screen.dart | 5 + lib/screens/live_care/end_call_screen.dart | 6 +- lib/screens/live_care/video_call.dart | 2 +- .../medicine/pharmacies_list_screen.dart | 12 +- lib/screens/patients/ECGPage.dart | 4 +- .../profile/UCAF/page_stepper_widget.dart | 27 +--- .../profile/UCAF/ucaf_pager_screen.dart | 127 ++++++++-------- .../lab_result_history_details_wideget.dart | 62 ++++---- .../notes/note/progress_note_screen.dart | 4 +- .../patient_profile_screen.dart | 8 +- .../profile_gird_for_InPatient.dart | 25 +--- .../profile_gird_for_other.dart | 10 +- .../radiology/radiology_report_screen.dart | 5 +- .../refer-patient-screen-in-patient.dart | 18 +-- .../refer_details/refer-patient-screen.dart | 4 +- .../assessment/add_assessment_details.dart | 22 +-- .../objective/add_examination_widget.dart | 22 +-- .../subjective/medication/add_medication.dart | 20 +-- .../subjective/update_subjective_page.dart | 2 +- .../add_prescription/add_prescription.dart | 4 +- .../search_preescription_widget.dart | 8 +- .../prescription/new_prescriptions_page.dart | 137 ++++++++---------- lib/screens/procedures/procedure_card.dart | 55 ++----- .../auth/verification_methods_list.dart | 36 ++--- .../profile/PatientProfileButton.dart | 4 +- .../app_bar/patient-profile-app-bar.dart | 6 +- ...ent-profile-header-new-design-app-bar.dart | 4 +- 32 files changed, 385 insertions(+), 522 deletions(-) diff --git a/lib/core/model/labs/lab_result_history.dart b/lib/core/model/labs/lab_result_history.dart index 79211594..fe2c983e 100644 --- a/lib/core/model/labs/lab_result_history.dart +++ b/lib/core/model/labs/lab_result_history.dart @@ -24,7 +24,6 @@ class LabResultHistory { String? verifiedOn; String? verifiedOnDateTime; - LabResultHistory( {this.description, this.femaleInterpretativeData, @@ -79,7 +78,7 @@ class LabResultHistory { } Map toJson() { - final Map data = new Map(); + final Map data = Map(); data['Description'] = this.description; data['FemaleInterpretativeData'] = this.femaleInterpretativeData; data['Gender'] = this.gender; 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 cd113840..40bb0e51 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,3 +1,5 @@ +import 'dart:convert'; + import 'package:doctor_app_flutter/config/config.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'; @@ -183,6 +185,7 @@ class LabsService extends BaseService { await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultHistoryList.clear(); response['ListGeneralResultHistory'].forEach((lab) { + print(jsonEncode(lab)); labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 6644a73e..84326d42 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -3,26 +3,24 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart'; -import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; -import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; -import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/core/model/livecare/start_call_req.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/home/dasboard_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import '../../locator.dart'; class LiveCarePatientViewModel extends BaseViewModel { List filterData = []; - LiveCarePatientServices _liveCarePatientServices = - locator(); + LiveCarePatientServices _liveCarePatientServices = locator(); - StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; + StartCallRes? get startCallRes => _liveCarePatientServices.startCallRes; - List get alternativeServicesList => - _liveCarePatientServices.alternativeServicesList; + List get alternativeServicesList => _liveCarePatientServices.alternativeServicesList; DashboardService _dashboardService = locator(); @@ -33,12 +31,8 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); } - PendingPatientERForDoctorAppRequestModel - pendingPatientERForDoctorAppRequestModel = - PendingPatientERForDoctorAppRequestModel( - sErServiceID: _dashboardService.sServiceID, outSA: false); - await _liveCarePatientServices.getPendingPatientERForDoctorApp( - pendingPatientERForDoctorAppRequestModel); + PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false); + await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; @@ -170,16 +164,11 @@ class LiveCarePatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { - String fullName = - _liveCarePatientServices.patientList[i].fullName!.toUpperCase(); - String patientID = - _liveCarePatientServices.patientList[i].patientId.toString(); - String mobile = - _liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase(); - - if (fullName.contains(str.toUpperCase()) || - patientID.contains(str) || - mobile.contains(str)) { + String fullName = _liveCarePatientServices.patientList[i].fullName!.toUpperCase(); + String patientID = _liveCarePatientServices.patientList[i].patientId.toString(); + String mobile = _liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase(); + + if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) { filterData.add(_liveCarePatientServices.patientList[i]); } } @@ -193,16 +182,13 @@ class LiveCarePatientViewModel extends BaseViewModel { Future isLogin(int loginStatus) async { await getDoctorProfile(isGetProfile: true); - LiveCareUserLoginRequestModel userLoginRequestModel = - new LiveCareUserLoginRequestModel(); - userLoginRequestModel.isOutKsa = - (doctorProfile!.projectID == 2 || doctorProfile!.projectID == 3) ? 1 : 0; + LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel(); + userLoginRequestModel.isOutKsa = (doctorProfile!.projectID == 2 || doctorProfile!.projectID == 3) ? 1 : 0; userLoginRequestModel.isLogin = loginStatus; userLoginRequestModel.generalid = "Cs2020@2016\$2958"; setState(ViewState.BusyLocal); - await _liveCarePatientServices.isLogin( - loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel); + await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); @@ -220,8 +206,7 @@ class LiveCarePatientViewModel extends BaseViewModel { AlternativeService(serviceID: 2, serviceName: "LABORATORY"), ); alternativeServicesList.add( - AlternativeService( - serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"), + AlternativeService(serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"), ); alternativeServicesList.add( AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"), @@ -242,8 +227,7 @@ class LiveCarePatientViewModel extends BaseViewModel { AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"), ); alternativeServicesList.add( - AlternativeService( - serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"), + AlternativeService(serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"), ); alternativeServicesList.add( AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 1306b7ca..5e197448 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -95,7 +95,7 @@ class SOAPViewModel extends BaseViewModel { get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; - List get allMedicationList => _prescriptionService.allMedicationList; + List? get allMedicationList => _prescriptionService.allMedicationList; late SubjectiveCallBack subjectiveCallBack; @@ -249,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; } @@ -447,7 +447,7 @@ class SOAPViewModel extends BaseViewModel { episodeId: patientInfo.episodeNo, episodeID: patientInfo.episodeNo, doctorID: ''); - var services = [_SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)]; + var services = [await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)]; if (patientInfo.admissionNo == null) { complaintsControllerError = ''; @@ -455,62 +455,62 @@ class SOAPViewModel extends BaseViewModel { illnessControllerError = ''; GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); - services.add(_SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true)); + services.add(await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true)); GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); - services.add(_SOAPService.getPatientAllergy(generalGetReqForSOAP)); + services.add(await _SOAPService.getPatientAllergy(generalGetReqForSOAP)); } - final results = await Future.wait(services); + final results = services; await callServicesAfterGetPatientInfoForUpdateSubject(); } callServicesAfterGetPatientInfoForUpdateSubject() async { - var services; + List services = []; if (patientHistoryList.isNotEmpty) { if (historyFamilyList.isEmpty) { - if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)]; + if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)); } } if (historyMedicalList.isEmpty) { - if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)]; + if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)]; } else - services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)); } if (historySurgicalList.length == 0) { - if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)]; + if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)]; } else - services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)); } if (historySportList.length == 0) { - if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySports)]; + if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.HistorySports)]; } else - services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySports)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistorySports)); } } if (patientAllergiesList.isNotEmpty) { - if (allergiesList.isEmpty) if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.Allergies)]; + if (allergiesList.isEmpty) if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.Allergies)]; } else - services.add(_SOAPService.getMasterLookup(MasterKeysService.Allergies)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.Allergies)); if (allergySeverityList.isEmpty) { - if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)]; + if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)]; } else - services.add(_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)); } } - final results = await Future.wait(services ?? []); + final results = services; if (_SOAPService.hasError) { error = _SOAPService.error; @@ -524,37 +524,37 @@ class SOAPViewModel extends BaseViewModel { List services = []; if (medicationStrengthList.length == 0) { if (services.isEmpty) { - services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)]; + services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)); } } if (medicationFrequencyList.length == 0) { if (services.isEmpty) { - services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)]; + services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)); } } if (medicationDoseTimeList.length == 0) { if (services.isEmpty) { - services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)]; + services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)); } } if (medicationRouteList.length == 0) { if (services.isEmpty) { - services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)]; + services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)); } } - if (allMedicationList.length == 0) { + if (allMedicationList!.isEmpty) { if (services.isEmpty) { - services = [_prescriptionService.getMedicationList()]; + services = [await _prescriptionService.getMedicationList()]; } else { - services.add(_prescriptionService.getMedicationList()); + services.add(await _prescriptionService.getMedicationList()); } } @@ -568,30 +568,30 @@ class SOAPViewModel extends BaseViewModel { callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async { if (allowSetState) setState(ViewState.Busy); - var services; - if (listOfDiagnosisCondition.length == 0) { - if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)]; + List services = []; + if (listOfDiagnosisCondition.isEmpty) { + if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)); } } if (listOfDiagnosisType.length == 0) { - if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)]; + if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)); } } if (listOfICD10.length == 0) { - if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)]; + if (services.isEmpty) { + services = [await _SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)); + services.add(await _SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)); } } - final results = await Future.wait(services ?? []); + final results = services; if (allowSetState) { if (_SOAPService.hasError) { error = _SOAPService.error; @@ -605,9 +605,9 @@ class SOAPViewModel extends BaseViewModel { GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString())); - var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)]; + var services = [await _SOAPService.getPatientAssessment(getAssessmentReqModel)]; - final results = await Future.wait(services); + final results = services; if (patientAssessmentList.isNotEmpty) { await callAddAssessmentLookupsServices(allowSetState: false); @@ -621,38 +621,38 @@ class SOAPViewModel extends BaseViewModel { } postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List? myHistoryList, List? myAllergiesList}) async { - var services; + List services = []; PostChiefComplaintRequestModel postChiefComplaintRequestModel = createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!); if (patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; - services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)]; + services = [await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel)]; } else { postChiefComplaintRequestModel.editedBy = ''; - services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)]; + services = [await _SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)]; } if (myHistoryList!.length != 0) { PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList); if (patientHistoryList.isEmpty) { - services.add(_SOAPService.postHistories(postHistoriesRequestModel)); + services.add(await _SOAPService.postHistories(postHistoriesRequestModel)); } else { - services.add(_SOAPService.patchHistories(postHistoriesRequestModel)); + services.add(await _SOAPService.patchHistories(postHistoriesRequestModel)); } } if (myAllergiesList!.length != 0) { PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo); if (patientAllergiesList.isEmpty) { - services.add(_SOAPService.postAllergy(postAllergyRequestModel)); + services.add(await _SOAPService.postAllergy(postAllergyRequestModel)); } else { - services.add(_SOAPService.patchAllergy(postAllergyRequestModel)); + services.add(await _SOAPService.patchAllergy(postAllergyRequestModel)); } } - final results = await Future.wait(services); + final results = services; if (_SOAPService.hasError) { error = _SOAPService.error; @@ -662,7 +662,7 @@ class SOAPViewModel extends BaseViewModel { } PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) { - return new PostChiefComplaintRequestModel( + return PostChiefComplaintRequestModel( admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo ?? 0, diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 0074a496..d786b98a 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -1,5 +1,10 @@ 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/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; @@ -7,57 +12,41 @@ import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart'; import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart'; -import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart'; -import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:flutter/cupertino.dart'; import '../../locator.dart'; class PatientReferralViewModel extends BaseViewModel { - PatientReferralService _referralPatientService = - locator(); + PatientReferralService _referralPatientService = locator(); ReferralService _referralService = locator(); - MyReferralInPatientService _myReferralService = - locator(); + MyReferralInPatientService _myReferralService = locator(); - DischargedPatientService _dischargedPatientService = - locator(); + DischargedPatientService _dischargedPatientService = locator(); - List get myDischargeReferralPatient => - _dischargedPatientService.myDischargeReferralPatients; + List get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients; - List get branchesList => _referralPatientService.projectsList; + List? get branchesList => _referralPatientService.projectsList; List get clinicsList => _referralPatientService.clinicsList; - List get referralFrequencyList => - _referralPatientService.frequencyList; + List get referralFrequencyList => _referralPatientService.frequencyList; List doctorsList = []; - List get clinicDoctorsList => - _referralPatientService.doctorsList; + List get clinicDoctorsList => _referralPatientService.doctorsList; - List get myReferralPatients => - _myReferralService.myReferralPatients; + List get myReferralPatients => _myReferralService.myReferralPatients; - List get listMyReferredPatientModel => - _referralPatientService.listMyReferredPatientModel; + List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; - List get pendingReferral => - _referralPatientService.pendingReferralList; + List get pendingReferral => _referralPatientService.pendingReferralList; - List get patientReferral => - _referralPatientService.patientReferralList; + List get patientReferral => _referralPatientService.patientReferralList; - List get patientArrivalList => - _referralPatientService.patientArrivalList; + List get patientArrivalList => _referralPatientService.patientArrivalList; Future getPatientReferral(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -106,8 +95,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getClinicDoctors( - PatiantInformtion patient, int clinicId, int branchId) async { + Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { @@ -125,10 +113,7 @@ class PatientReferralViewModel extends BaseViewModel { Future getDoctorBranch() async { DoctorProfileModel doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { - dynamic _selectedBranch = { - "facilityId": doctorProfile.projectID, - "facilityName": doctorProfile.projectName - }; + dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName}; return _selectedBranch; } return null; @@ -206,8 +191,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future replay( - String referredDoctorRemarks, MyReferralPatientModel referral) async { + Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { setState(ViewState.Busy); await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { @@ -217,8 +201,7 @@ class PatientReferralViewModel extends BaseViewModel { getMyReferralPatientService(); } - Future responseReferral( - MyReferralPatientModel referralPatient, bool isAccepted) async { + Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async { setState(ViewState.Busy); await _referralPatientService.responseReferral(referralPatient, isAccepted); if (_referralPatientService.hasError) { @@ -228,11 +211,9 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future makeReferral(PatiantInformtion patient, String isoStringDate, - int projectID, int clinicID, int doctorID, String remarks) async { + Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, String remarks) async { setState(ViewState.BusyLocal); - await _referralPatientService.makeReferral( - patient, isoStringDate, projectID, clinicID, doctorID, remarks); + await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.ErrorLocal); @@ -252,7 +233,7 @@ class PatientReferralViewModel extends BaseViewModel { String? remarks, String? ext, bool isLocalBusy = false}) async { - if(isLocalBusy) + if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); @@ -286,8 +267,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future verifyReferralDoctorRemarks( - MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { setState(ViewState.Busy); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); if (_referralPatientService.hasError) { @@ -326,8 +306,7 @@ class PatientReferralViewModel extends BaseViewModel { } } - PatiantInformtion getPatientFromReferral( - MyReferredPatientModel referredPatient) { + PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -355,8 +334,7 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - PatiantInformtion getPatientFromReferralO( - MyReferralPatientModel referredPatient) { + PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -381,8 +359,7 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - PatiantInformtion getPatientFromDischargeReferralPatient( - DischargeReferralPatient referredPatient) { + PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -401,18 +378,15 @@ class PatientReferralViewModel extends BaseViewModel { patient.roomId = referredPatient.roomID; patient.bedId = referredPatient.bedID; patient.nationalityName = referredPatient.nationalityName; - patient.nationalityFlagURL = - ''; // TODO from backend referredPatient.nationalityFlagURL; + patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; patient.clinicDescription = referredPatient.clinicDescription; return patient; } - Future replayReferred(String referredDoctorRemarks, - MyReferralPatientModel referral, int referralStatus) async { + Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referralStatus) async { setState(ViewState.Busy); - await _myReferralService.replayReferred( - referredDoctorRemarks, referral, referralStatus); + await _myReferralService.replayReferred(referredDoctorRemarks, referral, referralStatus); if (_myReferralService.hasError) { error = _myReferralService.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 0183d691..10cd1679 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -252,6 +252,7 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel: authenticationViewModel, authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + onShowMore: () {}, )), ), Expanded( @@ -276,12 +277,14 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel: authenticationViewModel, authMethodType: AuthMethodTypes.Fingerprint, authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + onShowMore: () {}, )), Expanded( child: VerificationMethodsList( authenticationViewModel: authenticationViewModel, authMethodType: AuthMethodTypes.FaceID, authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + onShowMore: () {}, )) ], ) @@ -294,12 +297,14 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel: authenticationViewModel, authMethodType: AuthMethodTypes.SMS, authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + onShowMore: () {}, )), Expanded( child: VerificationMethodsList( authenticationViewModel: authenticationViewModel, authMethodType: AuthMethodTypes.WhatsApp, authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + onShowMore: () {}, )) ], ), diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 4ee6bdd0..7a9014b6 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -72,11 +72,11 @@ class _EndCallScreenState extends State { DrAppToastMsg.showErrorToast(liveCareModel.error); } else await VideoChannel.openVideoCallScreen( - kToken: liveCareModel.startCallRes.openTokenID, - kSessionId: liveCareModel.startCallRes.openSessionID, + kToken: liveCareModel.startCallRes!.openTokenID, + kSessionId: liveCareModel.startCallRes!.openSessionID, kApiKey: '46209962', vcId: patient.vcId!, - isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording! : false, + isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes!.isRecording! : false, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await liveCareModel.getToken(), generalId: GENERAL_ID, diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 6d67e7c3..6496e551 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -47,7 +47,7 @@ class _VideoCallPageState extends State { super.didChangeDependencies(); if (_isInit) { _liveCareProvider = Provider.of(context); - connectOpenTok(widget.model.startCallRes); + connectOpenTok(widget.model.startCallRes!); // widget.model.startCall(vCID: widget.patientData.vcId, isReCall: false); } _isInit = false; diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 92f4550d..64b6af34 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -3,25 +3,21 @@ import 'dart:typed_data'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_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/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/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'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; -import 'package:url_launcher/url_launcher.dart'; - -import '../../locator.dart'; +import 'package:url_launcher/url_launcher_string.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); @@ -157,7 +153,7 @@ class _PharmaciesListState extends State { ), InkWell( onTap: () { - launch("tel://" + model.pharmaciesList[index]["PhoneNumber"]); + launchUrlString("tel://" + model.pharmaciesList[index]["PhoneNumber"]); }, child: Container( decoration: BoxDecoration( @@ -247,7 +243,7 @@ class _PharmaciesListState extends State { return Image.memory(base64Decode(base64String)); } - Uint8List dataFromBase64String(String base64String) { + Uint8List dataFromBase64String(String? base64String) { if (base64String != null) { return base64Decode(base64String); } else { diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 14468b55..46cb2cdc 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -19,8 +19,8 @@ class ECGPage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patient-type']; - String arrivalType = routeArgs['arrival-type']; + String patientType = routeArgs['patient-type'] ?? ""; + String arrivalType = routeArgs['arrival-type'] ?? ""; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId), diff --git a/lib/screens/patients/profile/UCAF/page_stepper_widget.dart b/lib/screens/patients/profile/UCAF/page_stepper_widget.dart index 08c62ff6..c003dbce 100644 --- a/lib/screens/patients/profile/UCAF/page_stepper_widget.dart +++ b/lib/screens/patients/profile/UCAF/page_stepper_widget.dart @@ -5,18 +5,13 @@ import 'package:flutter/material.dart'; import '../../../../config/config.dart'; - class PageStepperWidget extends StatelessWidget { final int stepsCount; final int currentStepIndex; final Size? screenSize; final List? stepsTitles; - PageStepperWidget( - {this.stepsCount = 0, - this.currentStepIndex = 0, - this.screenSize, - this.stepsTitles}); + PageStepperWidget({this.stepsCount = 0, this.currentStepIndex = 0, this.screenSize, this.stepsTitles}); @override Widget build(BuildContext context) { @@ -37,7 +32,7 @@ class PageStepperWidget extends StatelessWidget { i == stepsCount, i < currentStepIndex, dividerWidth, - stepsTitles: stepsTitles!, + stepsTitles: stepsTitles, ) else StepWidget( @@ -46,7 +41,7 @@ class PageStepperWidget extends StatelessWidget { i == stepsCount, i < currentStepIndex, dividerWidth, - stepsTitles: stepsTitles!, + stepsTitles: stepsTitles, ) ], ) @@ -64,9 +59,7 @@ class StepWidget extends StatelessWidget { final double dividerWidth; final List? stepsTitles; - StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, - this.dividerWidth, - {this.stepsTitles}); + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles}); @override Widget build(BuildContext context) { @@ -110,9 +103,7 @@ class StepWidget extends StatelessWidget { child: Icon( Icons.check, size: 20, - color: status == StepStatus.Locked - ? Color(0xFF969696) - : Colors.white, + color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.white, )), ), if (!isFinalStep) @@ -120,9 +111,7 @@ class StepWidget extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), width: dividerWidth, height: 2, - color: status == StepStatus.Completed - ? AppGlobal.appGreenColor - : Color(0xFFCCCCCC), + color: status == StepStatus.Completed ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), ], ), @@ -130,9 +119,7 @@ class StepWidget extends StatelessWidget { height: 8, ), AppText( - stepsTitles == null - ? "${TranslationBase.of(context).step} $index" - : "${stepsTitles![index - 1]}", + stepsTitles == null ? "${TranslationBase.of(context).step} $index" : "${stepsTitles![index - 1]}", fontWeight: FontWeight.bold, color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black, fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index a0c8b0c5..8903ed28 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -10,6 +10,7 @@ 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/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; + import 'ucaf_detail_screen.dart'; import 'ucaf_input_screen.dart'; @@ -20,8 +21,7 @@ class UCAFPagerScreen extends StatefulWidget { _UCAFPagerScreenState createState() => _UCAFPagerScreenState(); } -class _UCAFPagerScreenState extends State - with TickerProviderStateMixin { +class _UCAFPagerScreenState extends State with TickerProviderStateMixin { PageController? _controller; int _currentIndex = 0; bool _isLoading = true; @@ -60,73 +60,72 @@ class _UCAFPagerScreenState extends State final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - isLoading: _isLoading, - appBar: PatientProfileAppBar(patient!), - appBarTitle: TranslationBase.of(context).ucaf, - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - ServiceTitle( - title: "${TranslationBase.of(context).patient}", - subTitle: "${TranslationBase.of(context).ucaf}", - ), - PageStepperWidget( - stepsCount: 2, - currentStepIndex: _currentIndex + 1, - screenSize: screenSize, - ), - SizedBox( - height: 10, - ), - Expanded( - child: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UCAFInputScreen( - patient!, - changeLoadingState: changeLoadingState, - ), - UcafDetailScreen( - patient!, - model, - changeLoadingState: changeLoadingState, - ), - ]), - ), - ), - ], + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + isLoading: _isLoading, + appBar: PatientProfileAppBar(patient!), + appBarTitle: TranslationBase.of(context).ucaf, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ServiceTitle( + title: "${TranslationBase.of(context).patient}", + subTitle: "${TranslationBase.of(context).ucaf}", + ), + PageStepperWidget( + stepsCount: 2, + currentStepIndex: _currentIndex + 1, + screenSize: screenSize, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UCAFInputScreen( + patient!, + changeLoadingState: changeLoadingState, + ), + UcafDetailScreen( + patient!, + model, + changeLoadingState: changeLoadingState, + ), + ]), ), ), - ), - - ], + ], + ), ), - bottomSheet: _isLoading - ? Container( - height: 0, - ) - : UcafButtons(model),),); + ), + ], + ), + bottomSheet: _isLoading + ? Container( + height: 0, + ) + : UcafButtons(model), + ), + ); } - - /// TODO Elham* Move to real widget + /// TODO Elham* Move to real widget Widget UcafButtons(UcafViewModel model) { switch (_currentIndex) { case 0: diff --git a/lib/screens/patients/profile/lab_result/history/lab_result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/history/lab_result_history_details_wideget.dart index d5626896..1f422df4 100644 --- a/lib/screens/patients/profile/lab_result/history/lab_result_history_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/history/lab_result_history_details_wideget.dart @@ -4,7 +4,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/shared/app_texts_widget.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -19,8 +18,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); } -class _VitalSignDetailsWidgetState - extends State { +class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -79,33 +77,39 @@ class _VitalSignDetailsWidgetState List fullData(ProjectViewModel projectViewModel) { List tableRow = []; - widget.labResultHistory.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); - tableRow.add(TableRow(children: [ - Container( - child: Container( - padding: EdgeInsets.all(8), - color: Colors.white, - child: AppText( - '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', - fontSize: SizeConfig.textMultiplier! * 1.8, - fontWeight: FontWeight.w600, - ), - ), - ), - Container( - child: Container( - padding: EdgeInsets.all(8), - color: Colors.white, - child: AppText( - '${vital.resultValue}', - fontSize: SizeConfig.textMultiplier! * 1.8, - fontWeight: FontWeight.w600, - ), + widget.labResultHistory.forEach( + (vital) { + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + padding: EdgeInsets.all(8), + color: Colors.white, + child: AppText( + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', + fontSize: SizeConfig.textMultiplier! * 1.8, + fontWeight: FontWeight.w600, + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(8), + color: Colors.white, + child: AppText( + '${vital.resultValue}', + fontSize: SizeConfig.textMultiplier! * 1.8, + fontWeight: FontWeight.w600, + ), + ), + ), + ], ), - ), - ])); - }); + ); + }, + ); return tableRow; } } 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 1d43b1fa..9ef3ac64 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -47,8 +47,8 @@ class _ProgressNoteState extends State { getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { 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); + String? token = await sharedPref.getString(TOKEN); + String? type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( 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 1cbe3430..d0622caf 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -158,7 +158,7 @@ class _PatientProfileScreenState extends State with Single children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!, + PatientProfileHeaderNewDesignAppBar(patient, arrivalType!, patientType!, videoCallDurationStream: videoCallDurationStream, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, @@ -356,9 +356,9 @@ class _PatientProfileScreenState extends State with Single Utils.showErrorToast(model.error); } else { await model.getDoctorProfile(); - patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString()); + patient.appointmentNo = int.parse(model.startCallRes!.appointmentNo.toString()); patient.episodeNo = 0; - model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes.appointmentNo.toString())); + model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes!.appointmentNo.toString())); setState(() { isCallStarted = true; }); @@ -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); }); } } diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 5556f74d..69b3c04f 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -31,7 +31,6 @@ class ProfileGridForInPatient extends StatelessWidget { VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).lab, @@ -39,7 +38,6 @@ class ProfileGridForInPatient extends StatelessWidget { LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).lab, @@ -47,7 +45,6 @@ class ProfileGridForInPatient extends StatelessWidget { ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).radiology, @@ -55,7 +52,6 @@ class ProfileGridForInPatient extends StatelessWidget { RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/Radiology.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).patient, @@ -63,7 +59,6 @@ class ProfileGridForInPatient extends StatelessWidget { ORDER_PRESCRIPTION_OLD, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).patient, @@ -71,7 +66,6 @@ class ProfileGridForInPatient extends StatelessWidget { ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).progress, @@ -80,7 +74,6 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).order, @@ -89,7 +82,6 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/order sheets.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).orders, @@ -105,7 +97,6 @@ class ProfileGridForInPatient extends StatelessWidget { HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).medical, @@ -114,7 +105,6 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/medical report.svg', isInPatient: isInpatient, isDisable: false, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).referral, @@ -123,7 +113,6 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).insurance, @@ -139,7 +128,6 @@ class ProfileGridForInPatient extends StatelessWidget { DISCHARGE_SUMMARY, 'assets/images/svgs/profile_screen/discharge summary.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).patientSick, @@ -155,7 +143,6 @@ class ProfileGridForInPatient extends StatelessWidget { GET_OPERATION_REPORT, 'assets/images/svgs/profile_screen/operating report.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).pending, @@ -163,7 +150,6 @@ class ProfileGridForInPatient extends StatelessWidget { PENDING_ORDERS, 'assets/images/svgs/profile_screen/pending orders.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).admission, @@ -171,7 +157,6 @@ class ProfileGridForInPatient extends StatelessWidget { ADMISSION_ORDERS, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( "Nursing", @@ -179,7 +164,6 @@ class ProfileGridForInPatient extends StatelessWidget { NURSING_PROGRESS_NOTE, 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).diagnosis, @@ -187,7 +171,6 @@ class ProfileGridForInPatient extends StatelessWidget { DIAGNOSIS_FOR_IN_PATIENT, 'assets/images/svgs/profile_screen/diagnosis.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).diabetic, @@ -195,7 +178,6 @@ class ProfileGridForInPatient extends StatelessWidget { DIABETIC_CHART_VALUES, 'assets/images/svgs/profile_screen/diabetic chart.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( "VTE", @@ -203,7 +185,6 @@ class ProfileGridForInPatient extends StatelessWidget { VTE_ASSESSMENT, 'assets/images/svgs/profile_screen/diabetic chart.svg', isInPatient: isInpatient, - //onTap: () {}, ), PatientProfileCardModel( TranslationBase.of(context).pharmacy, @@ -211,7 +192,6 @@ class ProfileGridForInPatient extends StatelessWidget { PHARMACY_INTERVENTION, 'assets/images/svgs/profile_screen/medical report.svg', isInPatient: isInpatient, - //onTap: () {}, ), ]; @@ -219,7 +199,6 @@ class ProfileGridForInPatient extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), child: GridView( shrinkWrap: true, - physics: BouncingScrollPhysics(), // if you want IOS bouncing effect, otherwise remove this line gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( @@ -242,9 +221,7 @@ class ProfileGridForInPatient extends StatelessWidget { isInPatient: item.isInPatient, isDischargedPatient: item.isDischargedPatient, isDisable: item.isDisable, - onTap: () { - //item.onTap(); - }, + onTap: item.onTap, isLoading: item.isLoading, ); }).toList(), 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 e9e03576..4010575f 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 @@ -51,14 +51,8 @@ class ProfileGridForOther extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, - REFER_PATIENT_TO_DOCTOR, - 'assets/images/svgs/profile_screen/refer patient.svg', - isInPatient: isInpatient, - isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null, - ), + PatientProfileCardModel(TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', + isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index 9e9aef27..79358fa8 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -3,9 +3,8 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class RadiologyReportScreen extends StatelessWidget { final String reportData; @@ -64,7 +63,7 @@ class RadiologyReportScreen extends StatelessWidget { AppButton( title: TranslationBase.of(context).openRad, onPressed: () async { - launch(url); + launchUrlString(url); }, ), ], diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart index dd320d0b..8b24e722 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart @@ -188,7 +188,7 @@ class _PatientMakeInPatientReferralScreenState extends State 0 && _referTo != null && _referTo['id'] == 2 + validationError: hospitalError, + onClick: model.branchesList != null && model.branchesList!.length > 0 && _referTo != null && _referTo['id'] == 2 ? () { ListSelectDialog dialog = ListSelectDialog( - list: model.branchesList, + list: model.branchesList!, attributeName: 'facilityName', attributeValueId: 'facilityId', okText: TranslationBase.of(context).ok, @@ -278,7 +278,7 @@ class _PatientMakeInPatientReferralScreenState extends State 0 ? () { ListSelectDialog dialog = ListSelectDialog( @@ -319,7 +319,7 @@ class _PatientMakeInPatientReferralScreenState extends State 0 ? () { ListSelectDialog dialog = ListSelectDialog( @@ -362,7 +362,7 @@ class _PatientMakeInPatientReferralScreenState extends State { enabled: false, isTextFieldHasSuffix: true, validationError: hospitalError, - onClick: model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2 + onClick: model.branchesList != null && model.branchesList!.length > 0 && _referTo != null && _referTo['id'] == 2 ? () { ListSelectDialog dialog = ListSelectDialog( - list: model.branchesList, + list: model.branchesList!, attributeName: 'facilityName', attributeValueId: 'facilityId', okText: TranslationBase.of(context).ok, 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 127f3d80..2c159486 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 @@ -60,7 +60,7 @@ class _AddAssessmentDetailsState extends State { 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), @@ -161,7 +161,7 @@ class _AddAssessmentDetailsState extends State { if (icdNameController.text.length <= 3) { DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); } else { - model.listOfICD10.clear(); + model.listOfICD10!.clear(); model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); } }, @@ -172,20 +172,20 @@ class _AddAssessmentDetailsState extends State { onFieldSubmitted: () {}, )), - model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty + 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, + 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)), + 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(); + widget.mySelectedAssessment.selectedICD = model.listOfICD10![index]; + icdNameController.text = model.listOfICD10![index].description; + model.listOfICD10!.clear(); setState(() {}); }); }, @@ -264,9 +264,9 @@ class _AddAssessmentDetailsState extends State { onClick: model.listOfDiagnosisCondition != null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, + list: model.listOfDiagnosisCondition!, okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition!, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, okFunction: (MasterKeyModel selectedValue) { setState(() { widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; @@ -303,7 +303,7 @@ class _AddAssessmentDetailsState extends State { onClick: model.listOfDiagnosisType != null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, + list: model.listOfDiagnosisType!, okText: TranslationBase.of(context).ok, selectedValue: widget.mySelectedAssessment.selectedDiagnosisType!, okFunction: (MasterKeyModel selectedValue) { diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index b2afe58d..8058a638 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -19,7 +19,7 @@ class AddExaminationWidget extends StatefulWidget { final bool Function(MasterKeyModel)? isServiceSelected; bool isExpand; - final Function? expandClick; + final Function() expandClick; final List? mySelectedExamination; AddExaminationWidget({ @@ -28,7 +28,7 @@ class AddExaminationWidget extends StatefulWidget { this.addExamination, this.isServiceSelected, this.isExpand = false, - this.expandClick, + required this.expandClick, this.mySelectedExamination, }); @@ -44,10 +44,10 @@ class _AddExaminationWidgetState extends State { @override void initState() { if (getSelectedExam(widget.item!) != null) { - examination = getSelectedExam(widget.item!); - status = examination.isNormal! + examination = getSelectedExam(widget.item!)!; + status = examination.isNormal ? 1 - : examination.isAbnormal! + : examination.isAbnormal ? 2 : 3; remarksController.text = examination.remark!; @@ -96,8 +96,8 @@ class _AddExaminationWidgetState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 8), child: InkWell( - onTap: widget.expandClick!(), - child: Icon(widget.isExpand! ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down), + onTap: widget.expandClick, + child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down), ), ), ], @@ -264,23 +264,23 @@ class _AddExaminationWidgetState extends State { setState(() { if (widget.isServiceSelected!(widget.item!)) { if (examination.isLocal) widget.removeExamination!(examination); - widget.expandClick!(); + widget.expandClick; } else { examination.isNormal = status == 1; examination.isAbnormal = status == 2; examination.notExamined = status == 3; examination.remark = remarksController.text; widget.addExamination!(examination); - widget.expandClick!(); + widget.expandClick; } }); } - MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { + MySelectedExamination? getSelectedExam(MasterKeyModel masterKey) { Iterable exam = widget.mySelectedExamination!.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId); if (exam.length > 0) { return exam.first; } - return MySelectedExamination(); + return null; } } 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 694645db..c89b16a2 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 @@ -34,10 +34,10 @@ class AddMedication extends StatefulWidget { } class _AddMedicationState extends State { - MasterKeyModel _selectedMedicationDose = MasterKeyModel(); - MasterKeyModel _selectedMedicationStrength = MasterKeyModel(); - MasterKeyModel _selectedMedicationRoute = MasterKeyModel(); - MasterKeyModel _selectedMedicationFrequency = MasterKeyModel(); + MasterKeyModel? _selectedMedicationDose; + MasterKeyModel? _selectedMedicationStrength; + MasterKeyModel? _selectedMedicationRoute; + MasterKeyModel? _selectedMedicationFrequency; TextEditingController doseController = TextEditingController(); TextEditingController strengthController = TextEditingController(); @@ -45,7 +45,7 @@ class _AddMedicationState extends State { TextEditingController frequencyController = TextEditingController(); GetMedicationResponseModel? _selectedMedication; - GlobalKey> key = new GlobalKey>(); + GlobalKey> key = GlobalKey>(); bool isFormSubmitted = false; @override @@ -101,7 +101,7 @@ class _AddMedicationState extends State { decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search), itemSubmitted: (item) => setState(() => _selectedMedication = item), key: key, - suggestions: model.allMedicationList, + suggestions: model.allMedicationList!, itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => @@ -165,7 +165,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationDose = selectedValue; - doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr! : _selectedMedicationDose.nameEn!; + doseController.text = projectViewModel.isArabic ? _selectedMedicationDose!.nameAr! : _selectedMedicationDose!.nameEn!; }); }, ); @@ -204,7 +204,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationStrength = selectedValue; - strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr! : _selectedMedicationStrength.nameEn!; + strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength!.nameAr! : _selectedMedicationStrength!.nameEn!; }); }, ); @@ -245,7 +245,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationRoute = selectedValue; - routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr! : _selectedMedicationRoute.nameEn!; + routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute!.nameAr! : _selectedMedicationRoute!.nameEn!; }); }, ); @@ -284,7 +284,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationFrequency = selectedValue; - frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr! : _selectedMedicationFrequency.nameEn!; + frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency!.nameAr! : _selectedMedicationFrequency!.nameEn!; }); }, ); 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 68fbd6b1..b19e79d0 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 @@ -95,7 +95,7 @@ class _UpdateSubjectivePageState extends State implements if (model.patientAllergiesList.isNotEmpty) { model.patientAllergiesList.forEach((element) { MasterKeyModel? selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - MasterKeyModel selectedAllergySeverity; + MasterKeyModel? selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { diff --git a/lib/screens/prescription/add_prescription/add_prescription.dart b/lib/screens/prescription/add_prescription/add_prescription.dart index a48811a6..ea277e51 100644 --- a/lib/screens/prescription/add_prescription/add_prescription.dart +++ b/lib/screens/prescription/add_prescription/add_prescription.dart @@ -45,7 +45,7 @@ class _AddPrescriptionState extends State { final myController = TextEditingController(); DateTime? selectedDate; int strengthChar = 0; - GetMedicationResponseModel? _selectedMedication; + GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel(); MedicineViewModel? medicineViewModel; GlobalKey> key = GlobalKey>(); @@ -138,7 +138,7 @@ class _AddPrescriptionState extends State { prescriptionViewModel: widget.prescriptionViewModel, medicineViewModel: model, prescriptionList: widget.prescriptionList, - selectedMedication: _selectedMedication!, + selectedMedication: _selectedMedication, ), ], ), diff --git a/lib/screens/prescription/add_prescription/search_preescription_widget.dart b/lib/screens/prescription/add_prescription/search_preescription_widget.dart index 0476e45b..959dfee8 100644 --- a/lib/screens/prescription/add_prescription/search_preescription_widget.dart +++ b/lib/screens/prescription/add_prescription/search_preescription_widget.dart @@ -1,12 +1,12 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; + import '../../../config/config.dart'; import '../../../core/model/search_drug/get_medication_response_model.dart'; import '../../../core/viewModel/medicine_view_model.dart'; import '../../../core/viewModel/prescription/prescription_view_model.dart'; -import '../../../utils/utils.dart'; import '../../../utils/translations_delegate_base_utils.dart'; +import '../../../utils/utils.dart'; import '../../../widgets/medicine/medicine_item_widget.dart'; import '../../../widgets/shared/buttons/app_buttons_widget.dart'; import '../../../widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -41,9 +41,9 @@ class SearchPrescriptionWidget extends StatelessWidget { widthFactor: 0.9, child: Container( decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), + padding: EdgeInsets.all(6), child: AppTextFormField( - borderColor: Colors.white, + borderColor: Colors.transparent, hintText: TranslationBase.of(context).searchMedicineNameHere, controller: myController, onSaved: (value) {}, diff --git a/lib/screens/prescription/new_prescriptions_page.dart b/lib/screens/prescription/new_prescriptions_page.dart index b57cf479..a793871e 100644 --- a/lib/screens/prescription/new_prescriptions_page.dart +++ b/lib/screens/prescription/new_prescriptions_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; @@ -12,8 +12,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import '../../utils/utils.dart'; import '../../widgets/shared/errors/error_message.dart'; @@ -26,8 +26,7 @@ class NewPrescriptionsPage extends StatelessWidget { bool isFromLiveCare = routeArgs['isFromLiveCare']; return BaseView( onModelReady: (model) async { - model.getPrescriptionListNew( - mrn: patient.patientMRN, appNo: patient.appointmentNo); + model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo ?? 0); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -58,9 +57,7 @@ class NewPrescriptionsPage extends StatelessWidget { ], ), ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || - (isFromLiveCare && patient.appointmentNo != null)) + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( @@ -74,8 +71,7 @@ class NewPrescriptionsPage extends StatelessWidget { settingRoute: 'AddProcedureTabPage'), ); }, - label: TranslationBase.of(context) - .applyForNewPrescriptionsOrder, + label: TranslationBase.of(context).applyForNewPrescriptionsOrder, ), Center( child: FractionallySizedBox( @@ -86,80 +82,63 @@ class NewPrescriptionsPage extends StatelessWidget { shrinkWrap: true, itemBuilder: (BuildContext ctxt, int index) { return InkWell( - child: CardWithBgWidget( - bgColor: Colors.transparent, - widget: Column( - children: [ - CustomRow( - label: "", - value: Utils.convertToTitleCase(model - .prescriptionListNew[index] - .medicationName), - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - ), - SizedBox( - height: 10, - ), - CustomRow( - label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :", - value: model - .prescriptionListNew[index].doctorName, - ), - CustomRow( - label: TranslationBase.of(context).orderTypeDescription + ': ',//"Order Type Description :", - value: model.prescriptionListNew[index] - .orderTypeDescription, - ), - CustomRow( - label: TranslationBase.of(context).status + ': ', - value: - model.prescriptionListNew[index].status, - ), - CustomRow( - label: TranslationBase.of(context).indication + ': ', //"indication :", - value: model - .prescriptionListNew[index].indication, - ), - CustomRow( - label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :", - value: model - .prescriptionListNew[index].doseDetail, - ), - CustomRow( - label: TranslationBase.of(context).quantity + ': ',//"quantity :", - value: model - .prescriptionListNew[index].quantity - .toString(), - ),CustomRow( - label: TranslationBase.of(context).startDate + ': ', //"start Date :", - value: model - .prescriptionListNew[index].startDate - .toString(), - ),CustomRow( - label: TranslationBase.of(context).stopDate + ': ',//"stop Date :", - value: model - .prescriptionListNew[index].stopDate - .toString(), - ), - if(model - .prescriptionListNew[index].remarks != null&& model - .prescriptionListNew[index].remarks!= "") - CustomRow( - label: TranslationBase.of(context).remarks + ': ',//"Remark :", - value: model - .prescriptionListNew[index].remarks - .toString(), - ), - ], + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Utils.convertToTitleCase(model.prescriptionListNew[index].medicationName), + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :", + value: model.prescriptionListNew[index].doctorName, + ), + CustomRow( + label: TranslationBase.of(context).orderTypeDescription + ': ', //"Order Type Description :", + value: model.prescriptionListNew[index].orderTypeDescription, + ), + CustomRow( + label: TranslationBase.of(context).status + ': ', + value: model.prescriptionListNew[index].status, + ), + CustomRow( + label: TranslationBase.of(context).indication + ': ', //"indication :", + value: model.prescriptionListNew[index].indication, + ), + CustomRow( + label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :", + value: model.prescriptionListNew[index].doseDetail, + ), + CustomRow( + label: TranslationBase.of(context).quantity + ': ', //"quantity :", + value: model.prescriptionListNew[index].quantity.toString(), + ), + CustomRow( + label: TranslationBase.of(context).startDate + ': ', //"start Date :", + value: model.prescriptionListNew[index].startDate.toString(), + ), + CustomRow( + label: TranslationBase.of(context).stopDate + ': ', //"stop Date :", + value: model.prescriptionListNew[index].stopDate.toString(), + ), + if (model.prescriptionListNew[index].remarks != null && model.prescriptionListNew[index].remarks != "") + CustomRow( + label: TranslationBase.of(context).remarks + ': ', //"Remark :", + value: model.prescriptionListNew[index].remarks.toString(), + ), + ], + ), ), - ),); + ); }), ), ), - if (model.prescriptionListNew.isEmpty && - patient.patientStatusType != 43) + if (model.prescriptionListNew.isEmpty && patient.patientStatusType != 43) Center( child: ErrorMessage( error: TranslationBase.of(context).noPrescriptionsFound, diff --git a/lib/screens/procedures/procedure_card.dart b/lib/screens/procedures/procedure_card.dart index d9ceb305..802b5eef 100644 --- a/lib/screens/procedures/procedure_card.dart +++ b/lib/screens/procedures/procedure_card.dart @@ -9,14 +9,13 @@ 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/user-guid/CusomRow.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; /// TODO Roaa Add translation and make sure it working fine class ProcedureCard extends StatelessWidget { - final Function? onTap; + final Function()? onTap; final EntityList? entityList; final String? categoryName; final int? categoryID; @@ -59,15 +58,12 @@ class ProcedureCard extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: - entityList!.orderType == 0 ? Colors.black : Colors.red[500], + color: entityList!.orderType == 0 ? Colors.black : Colors.red[500], ), ), Expanded( child: Container( - padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, - right: projectViewModel.isArabic ? 15 : 0), + padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), child: InkWell( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -80,20 +76,15 @@ class ProcedureCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - entityList!.orderType == 0 - ? 'Routine' - : 'Urgent', - color: entityList!.orderType == 0 - ? Colors.black - : AppGlobal.appRedColor, + entityList!.orderType == 0 ? 'Routine' : 'Urgent', + color: entityList!.orderType == 0 ? Colors.black : AppGlobal.appRedColor, fontWeight: FontWeight.w600, ), SizedBox( height: 5, ), AppText( - Utils.convertToTitleCase( - entityList!.procedureName!), + Utils.convertToTitleCase(entityList!.procedureName!), bold: true, fontSize: 14, ), @@ -109,8 +100,7 @@ class ProcedureCard extends StatelessWidget { children: [ AppText( '${AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertISOStringToDateTime( - entityList!.createdOn!), + AppDateUtils.convertISOStringToDateTime(entityList!.createdOn!), isMonthShort: true, isArabic: projectViewModel.isArabic, )}', @@ -145,8 +135,7 @@ class ProcedureCard extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, @@ -157,9 +146,7 @@ class ProcedureCard extends StatelessWidget { 'assets/images/dr_avatar.png', height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, ))), @@ -167,14 +154,12 @@ class ProcedureCard extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - Utils.convertToTitleCase( - entityList!.doctorName!), + Utils.convertToTitleCase(entityList!.doctorName!), fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier!, @@ -182,12 +167,10 @@ class ProcedureCard extends StatelessWidget { ), if (entityList!.clinicDescription != null) AppText( - Utils.convertToTitleCase( - entityList!.clinicDescription!), + Utils.convertToTitleCase(entityList!.clinicDescription!), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.4 * SizeConfig.textMultiplier!, + fontSize: 1.4 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ], @@ -203,20 +186,14 @@ class ProcedureCard extends StatelessWidget { children: [ Expanded( child: AppText( - entityList!.remarks != null - ? Utils.convertToTitleCase( - entityList!.remarks.toString()) - : '', + entityList!.remarks != null ? Utils.convertToTitleCase(entityList!.remarks.toString()) : '', fontSize: 12, ), ), - if ((entityList!.categoryID == 2 || - entityList!.categoryID == 4) && - doctorID == entityList!.doctorID && - !isInpatient!) + if ((entityList!.categoryID == 2 || entityList!.categoryID == 4) && doctorID == entityList!.doctorID && !isInpatient!) InkWell( child: Icon(DoctorApp.edit), - onTap: onTap!(), + onTap: onTap, ) ], ), diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 232c263c..22fada76 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -10,20 +10,13 @@ import 'package:provider/provider.dart'; class VerificationMethodsList extends StatefulWidget { final AuthMethodTypes? authMethodType; final Function(AuthMethodTypes type, bool isActive)? authenticateUser; - final Function? onShowMore; + final Function() onShowMore; final AuthenticationViewModel? authenticationViewModel; - const VerificationMethodsList( - {Key? key, - this.authMethodType, - this.authenticateUser, - this.onShowMore, - this.authenticationViewModel}) - : super(key: key); + const VerificationMethodsList({Key? key, this.authMethodType, this.authenticateUser, required this.onShowMore, this.authenticationViewModel}) : super(key: key); @override - _VerificationMethodsListState createState() => - _VerificationMethodsListState(); + _VerificationMethodsListState createState() => _VerificationMethodsListState(); } class _VerificationMethodsListState extends State { @@ -38,51 +31,44 @@ class _VerificationMethodsListState extends State { case AuthMethodTypes.WhatsApp: return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg', - onTap: () => - {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, - label: TranslationBase.of(context).verifyWith + - TranslationBase.of(context).verifyWhatsApp, + onTap: () => {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, + label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyWhatsApp, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/svgs/verification/verify-sms.svg", onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, - label: TranslationBase.of(context).verifyWith + - TranslationBase.of(context).verifySMS, + label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifySMS, ); break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-finger.svg', onTap: () async { - if (await widget.authenticationViewModel! - .checkIfBiometricAvailable(BiometricType.fingerprint)) { + if (await widget.authenticationViewModel!.checkIfBiometricAvailable(BiometricType.fingerprint)) { widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); } }, - label: TranslationBase.of(context).verifyWith + - TranslationBase.of(context).verifyFingerprint, + label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyFingerprint, ); break; case AuthMethodTypes.FaceID: return MethodTypeCard( assetPath: 'assets/images/svgs/verification/verify-face.svg', onTap: () async { - if (await widget.authenticationViewModel! - .checkIfBiometricAvailable(BiometricType.face)) { + if (await widget.authenticationViewModel!.checkIfBiometricAvailable(BiometricType.face)) { widget.authenticateUser!(AuthMethodTypes.FaceID, true); } }, - label: TranslationBase.of(context).verifyWith + - TranslationBase.of(context).verifyFaceID, + label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyFaceID, ); break; default: return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', - onTap: widget.onShowMore!(), + onTap: widget.onShowMore, isSvg: false, label: TranslationBase.of(context).moreVerification, height: 0, diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 97f72488..f5a89f7b 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -42,7 +42,7 @@ class PatientProfileButton extends StatelessWidget { this.icon, this.route, this.isDisable = false, - required this.onTap, + this.onTap, this.isLoading = false, this.from, this.to, @@ -66,7 +66,7 @@ class PatientProfileButton extends StatelessWidget { onTap: isDisable ? null : onTap != null - ? onTap!() + ? onTap : () { navigator(context, this.route); }, 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 87b5231e..f64d1ff8 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 @@ -9,7 +9,7 @@ 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'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; import '../large_avatar.dart'; import 'header_row.dart'; @@ -86,7 +86,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge icon: Icon(Icons.arrow_back_ios), color: Color(0xFF2B353E), //Colors.black, onPressed: () { - if (onPressed != null) onPressed!(); + if (onPressed != null) onPressed; Navigator.pop(context); }, ), @@ -115,7 +115,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber!); + launchUrlString("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, 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 fe13efcc..7bf903e2 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 @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; import 'header_row.dart'; @@ -91,7 +91,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget implements Pre eventCategory: "Patient Profile Header", eventAction: "Call Patient", ); - launch("tel://" + patient.mobileNumber!); + launchUrlString("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone,