From 329711a002354cf1c80fcd79dc6257b86ea7f647 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Jun 2021 16:18:38 +0300 Subject: [PATCH] fix error to make the code work with flutter 2 --- lib/config/size_config.dart | 6 +- .../live_care/AlternativeServicesList.dart | 8 +- .../live_care_login_reguest_model.dart | 10 +- .../PatientSearchRequestModel.dart | 4 +- .../referral/MyReferralPatientModel.dart | 2 +- .../MyReferralPatientRequestModel.dart | 46 +++--- .../add_referred_remarks_request.dart | 30 ++-- lib/core/service/NavigationService.dart | 10 +- lib/core/service/VideoCallService.dart | 28 ++-- lib/core/service/home/scan_qr_service.dart | 8 +- .../patient/LiveCarePatientServices.dart | 4 +- .../patient/MyReferralPatientService.dart | 16 +- .../patient-doctor-referral-service.dart | 2 +- lib/core/service/patient/patient_service.dart | 8 +- .../procedure/procedure_service.dart | 2 +- .../viewModel/LiveCarePatientViewModel.dart | 32 ++-- .../viewModel/PatientSearchViewModel.dart | 2 +- .../viewModel/authentication_view_model.dart | 2 +- lib/core/viewModel/dashboard_view_model.dart | 8 +- .../viewModel/patient-referral-viewmodel.dart | 8 +- lib/core/viewModel/patient_view_model.dart | 2 +- lib/core/viewModel/procedure_View_model.dart | 30 ++-- lib/core/viewModel/scan_qr_view_model.dart | 2 +- ...cial_clinical_care_List_Respose_Model.dart | 10 +- ...nical_care_mapping_List_Respose_Model.dart | 12 +- lib/models/livecare/start_call_req.dart | 22 +-- .../patient_profile_app_bar_model.dart | 36 ++-- lib/screens/auth/login_screen.dart | 4 +- .../auth/verification_methods_screen.dart | 34 ++-- .../home/dashboard_referral_patient.dart | 64 ++++---- .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/home_page_card.dart | 2 +- lib/screens/home/home_screen.dart | 57 ++++--- lib/screens/home/home_screen_header.dart | 14 +- lib/screens/home/label.dart | 10 +- lib/screens/live_care/end_call_screen.dart | 46 +++--- .../live-care_transfer_to_admin.dart | 2 +- lib/screens/live_care/video_call.dart | 2 +- .../medical-file/medical_file_details.dart | 68 ++++---- .../patients/PatientsInPatientScreen.dart | 8 +- .../patients/insurance_approvals_details.dart | 155 ++++++++---------- .../lab_result/laboratory_result_page.dart | 2 +- .../AddVerifyMedicalReport.dart | 6 +- .../medical_report/MedicalReportPage.dart | 2 +- .../PatientProfileCardModel.dart | 3 +- .../patient_profile_screen.dart | 13 +- .../radiology/radiology_details_page.dart | 2 +- .../referral/AddReplayOnReferralPatient.dart | 4 +- .../ReplySummeryOnReferralPatient.dart | 2 +- .../referral_patient_detail_in-paint.dart | 4 +- .../referral/referred-patient-screen.dart | 10 +- .../prescription/prescription_items_page.dart | 8 +- lib/screens/procedures/ProcedureType.dart | 34 ++-- .../procedures/add-favourite-procedure.dart | 34 ++-- .../procedures/add-procedure-page.dart | 52 +++--- .../base_add_procedure_tab_page.dart | 28 ++-- lib/util/NotificationPermissionUtils.dart | 2 +- lib/util/VideoChannel.dart | 8 +- lib/util/date-utils.dart | 4 +- lib/util/helpers.dart | 6 +- lib/util/translations_delegate_base.dart | 20 +-- lib/widgets/dashboard/row_count.dart | 2 +- lib/widgets/dialog/AskPermissionDialog.dart | 2 +- .../patients/patient_card/ShowTimer.dart | 4 +- .../profile/PatientProfileButton.dart | 4 +- .../profile/patient-profile-app-bar.dart | 128 +++++++-------- ...ent-profile-header-new-design-app-bar.dart | 6 +- lib/widgets/shared/app_scaffold_widget.dart | 8 +- lib/widgets/shared/app_texts_widget.dart | 2 +- .../shared/buttons/app_buttons_widget.dart | 2 +- lib/widgets/shared/drawer_item_widget.dart | 2 +- 71 files changed, 608 insertions(+), 614 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 8a9c7ac6..75c37643 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -75,7 +75,7 @@ class SizeConfig { print('isMobilePortrait $isMobilePortrait'); } - static getTextMultiplierBasedOnWidth({double width}){ + static getTextMultiplierBasedOnWidth({double? width}){ // TODO handel LandScape case if(width != null) { return width / 100; @@ -84,7 +84,7 @@ class SizeConfig { } - static getWidthMultiplier({double width}){ + static getWidthMultiplier({double? width}){ // TODO handel LandScape case if(width != null) { return width / 100; @@ -92,7 +92,7 @@ class SizeConfig { return widthMultiplier; } - static getHeightMultiplier({double height}){ + static getHeightMultiplier({double? height}){ // TODO handel LandScape case if(height != null) { return height / 100; diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart index 11f27b95..28d70805 100644 --- a/lib/core/model/live_care/AlternativeServicesList.dart +++ b/lib/core/model/live_care/AlternativeServicesList.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; class AlternativeService { - int serviceID; - String serviceName; - bool isSelected; + int? serviceID; + String? serviceName; + bool? isSelected; AlternativeService( {this.serviceID, this.serviceName, this.isSelected = false}); @@ -23,7 +23,7 @@ class AlternativeService { } class AlternativeServicesList with ChangeNotifier { - List _alternativeServicesList; + late List _alternativeServicesList; getServicesList(){ return _alternativeServicesList; diff --git a/lib/core/model/live_care/live_care_login_reguest_model.dart b/lib/core/model/live_care/live_care_login_reguest_model.dart index e14d4223..90ea0ff1 100644 --- a/lib/core/model/live_care/live_care_login_reguest_model.dart +++ b/lib/core/model/live_care/live_care_login_reguest_model.dart @@ -1,9 +1,9 @@ class LiveCareUserLoginRequestModel { - String tokenID; - String generalid; - int doctorId; - int isOutKsa; - int isLogin; + String? tokenID; + String? generalid; + int? doctorId; + int? isOutKsa; + int? isLogin; LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin}); diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 7117382c..d377916e 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -11,8 +11,8 @@ class PatientSearchRequestModel { int ?searchType; String? mobileNo; String? identificationNo; - int nursingStationID; - int clinicID=0; + int? nursingStationID; + int? clinicID=0; PatientSearchRequestModel( {this.doctorID = 0, diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index ec1f7758..86a0e9c7 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -61,7 +61,7 @@ class MyReferralPatientModel { String? priorityDescription; String? referringClinicDescription; String? referringDoctorName; - int referalStatus; + int? referalStatus; MyReferralPatientModel( {this.rowID, diff --git a/lib/core/model/referral/MyReferralPatientRequestModel.dart b/lib/core/model/referral/MyReferralPatientRequestModel.dart index 08b98a99..885653a1 100644 --- a/lib/core/model/referral/MyReferralPatientRequestModel.dart +++ b/lib/core/model/referral/MyReferralPatientRequestModel.dart @@ -1,27 +1,27 @@ class MyReferralPatientRequestModel { - int channel; - int clinicID; - int doctorID; - int editedBy; - String firstName; - String from; - String iPAdress; - bool isLoginForDoctorApp; - int languageID; - String lastName; - String middleName; - int patientID; - String patientIdentificationID; - String patientMobileNumber; - bool patientOutSA; - int patientTypeID; - int projectID; - String sessionID; - String stamp; - String to; - String tokenID; - double versionID; - String vidaAuthTokenID; + int? channel; + int? clinicID; + int? doctorID; + int? editedBy; + String? firstName; + String? from; + String? iPAdress; + bool? isLoginForDoctorApp; + int? languageID; + String? lastName; + String? middleName; + int? patientID; + String? patientIdentificationID; + String? patientMobileNumber; + bool? patientOutSA; + int? patientTypeID; + int? projectID; + String? sessionID; + String? stamp; + String? to; + String? tokenID; + double? versionID; + String? vidaAuthTokenID; MyReferralPatientRequestModel( {this.channel, diff --git a/lib/core/model/referral/add_referred_remarks_request.dart b/lib/core/model/referral/add_referred_remarks_request.dart index 14089513..5b7edbc6 100644 --- a/lib/core/model/referral/add_referred_remarks_request.dart +++ b/lib/core/model/referral/add_referred_remarks_request.dart @@ -1,19 +1,19 @@ class AddReferredRemarksRequestModel { - int projectID; - int admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int referalStatus; - bool isLoginForDoctorApp; - String iPAdress; - bool patientOutSA; - String tokenID; - int languageID; - double versionID; - int channel; - String sessionID; - int deviceTypeID; + int? projectID; + int? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? referalStatus; + bool? isLoginForDoctorApp; + String? iPAdress; + bool? patientOutSA; + String? tokenID; + int? languageID; + double? versionID; + int? channel; + String? sessionID; + int? deviceTypeID; AddReferredRemarksRequestModel( {this.projectID, diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 26191ffc..11b12ec5 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -3,16 +3,16 @@ import 'package:flutter/material.dart'; class NavigationService { final GlobalKey navigatorKey = new GlobalKey(); - Future navigateTo(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); + Future navigateTo(String routeName,{required Object arguments}) { + return navigatorKey.currentState!.pushNamed(routeName,arguments: arguments); } - Future pushReplacementNamed(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments); + Future pushReplacementNamed(String routeName,{required Object arguments}) { + return navigatorKey.currentState!.pushReplacementNamed(routeName,arguments: arguments); } Future pushNamedAndRemoveUntil(String routeName) { - return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); + return navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName,(asd)=>false); } } \ No newline at end of file diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index f72544a0..d07c640d 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -18,14 +18,14 @@ import 'NavigationService.dart'; class VideoCallService extends BaseService{ - StartCallRes startCallRes; - PatiantInformtion patient; + late StartCallRes startCallRes; + late PatiantInformtion patient; LiveCarePatientServices _liveCarePatientServices = locator(); openVideo(StartCallRes startModel,PatiantInformtion patientModel,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( kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg @@ -34,15 +34,15 @@ class VideoCallService extends BaseService{ 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); },onCallConnected: onCallConnected, onCallEnd: () { - WidgetsBinding.instance.addPostFrameCallback((_) async { - GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext); - endCall(patient.vcId, false,).then((value) { - GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext); + WidgetsBinding.instance!.addPostFrameCallback((_) async { + GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!); + endCall(patient.vcId!, false,).then((value) { + GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); }else @@ -54,10 +54,10 @@ class VideoCallService extends BaseService{ }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext); - endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext); + WidgetsBinding.instance!.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!); + endCall(patient.vcId!, sessionStatusModel.sessionStatus == 3,).then((value) { + GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); } else { @@ -76,13 +76,13 @@ 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; await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; } } diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index bc6c8820..7a0033b9 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class ScanQrService extends BaseService { - List myInPatientList = List(); - List inPatientList = List(); + List myInPatientList = []; + List inPatientList = []; Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID!; } else { requestModel.doctorID = 0; } @@ -26,7 +26,7 @@ class ScanQrService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile.doctorID) { + if (patient.doctorId == doctorProfile!.doctorID!) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index d8e56db7..40968550 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -113,10 +113,10 @@ class LiveCarePatientServices extends BaseService { }, isLiveCare: _isLive); } - Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { + Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async { hasError = false; await getDoctorProfile( ); - isLoginRequestModel.doctorId = super.doctorProfile.doctorID; + isLoginRequestModel!.doctorId = super.doctorProfile!.doctorID!; await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index c2e467d2..946d631f 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -13,7 +13,7 @@ class MyReferralInPatientService extends BaseService { await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile!.doctorID, + doctorID: doctorProfile!.doctorID!, firstName: "0", middleName: "0", lastName: "0", @@ -48,7 +48,7 @@ class MyReferralInPatientService extends BaseService { await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID!, firstName: "0", middleName: "0", lastName: "0", @@ -104,15 +104,15 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel( - editedBy: doctorProfile.doctorID, - projectID: doctorProfile.projectID, + editedBy: doctorProfile!.doctorID!, + projectID: doctorProfile!.projectID!, referredDoctorRemarks: referredDoctorRemarks, referalStatus: referalStatus); - _requestAddReferredDoctorRemarks.projectID = referral.projectID; - _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo); - _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; + _requestAddReferredDoctorRemarks.projectID = referral.projectID!; + _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo!); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; _requestAddReferredDoctorRemarks.referalStatus = referalStatus; // _requestAddReferredDoctorRemarks.patientID = referral.patientID; diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index 08e17574..fd9e25b3 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -155,7 +155,7 @@ class PatientReferralService extends LookupService { hasError = false; RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_OUT_PATIENT, diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 31632d27..52c10ad5 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -24,8 +24,8 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_mode class PatientService extends BaseService { List _patientVitalSignList = []; List patientVitalSignOrderdSubList = []; - List inPatientList = List(); - List myInPatientList = List(); + List inPatientList = []; + List myInPatientList = []; List get patientVitalSignList => _patientVitalSignList; @@ -141,7 +141,7 @@ class PatientService extends BaseService { await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID!; } else { requestModel.doctorID = 0; } @@ -155,7 +155,7 @@ class PatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile.doctorID) { + if (patient.doctorId == doctorProfile!.doctorID!) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 48a93853..51fdf98b 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -23,7 +23,7 @@ class ProcedureService extends BaseService { List procedureslist = []; List categoryList = []; - // List _templateList = List(); + // List _templateList = []; // List get templateList => _templateList; List templateList = []; diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 907bc1da..356a3826 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -71,15 +71,15 @@ class LiveCarePatientViewModel extends BaseViewModel { Future startCall({required int vCID, required bool isReCall}) async { StartCallReq startCallReq = new StartCallReq(); await getDoctorProfile(); - startCallReq.clinicId = super.doctorProfile!.clinicID; + startCallReq.clinicId = super.doctorProfile!.clinicID!; startCallReq.vCID = vCID; //["VC_ID"]; startCallReq.isrecall = isReCall; - startCallReq.doctorId = doctorProfile!.doctorID; + startCallReq.doctorId = doctorProfile!.doctorID!; startCallReq.isOutKsa = false; //["IsOutKSA"]; - startCallReq.projectName = doctorProfile!.projectName; - startCallReq.docotrName = doctorProfile!.doctorName; - startCallReq.clincName = doctorProfile!.clinicDescription; - startCallReq.docSpec = doctorProfile!.doctorTitleForProfile; + startCallReq.projectName = doctorProfile!.projectName!; + startCallReq.docotrName = doctorProfile!.doctorName!; + startCallReq.clincName = doctorProfile!.clinicDescription!; + startCallReq.docSpec = doctorProfile!.doctorTitleForProfile!; startCallReq.generalid = 'Cs2020@2016\$2958'; setState(ViewState.BusyLocal); @@ -92,9 +92,9 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - setSelectedCheckboxValues(AlternativeService service, bool isSelected) { - int index = alternativeServicesList.indexOf(service); - if (index != -1) alternativeServicesList[index].isSelected = isSelected; + setSelectedCheckboxValues(AlternativeService? service, bool? isSelected) { + int index = alternativeServicesList.indexOf(service!); + if (index != -1) alternativeServicesList[index].isSelected = isSelected!; notifyListeners(); } @@ -118,10 +118,10 @@ class LiveCarePatientViewModel extends BaseViewModel { } List getSelectedAlternativeServices() { - List selectedServices = List(); + List selectedServices = []; for (AlternativeService service in alternativeServicesList) { - if (service.isSelected) { - selectedServices.add(service.serviceID); + if (service.isSelected!) { + selectedServices.add(service.serviceID!); } } return selectedServices; @@ -131,7 +131,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.getAlternativeServices(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -154,7 +154,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.sendSMSInstruction(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -186,14 +186,14 @@ class LiveCarePatientViewModel extends BaseViewModel { await getDoctorProfile(isGetProfile: true); LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel(); - userLoginRequestModel.isOutKsa = (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0; + 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); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index d0bd9862..1e77f9e1 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -199,7 +199,7 @@ class PatientSearchViewModel extends BaseViewModel { } await _specialClinicsService.getSpecialClinicalCareMappingList(clinicId); if (_specialClinicsService.hasError) { - error = _specialClinicsService.error; + error = _specialClinicsService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index f63220d4..52819e43 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -232,7 +232,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess( SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " +sendActivationCodeForDoctorAppResponseModel.verificationCode); + print("VerificationCode : " +sendActivationCodeForDoctorAppResponseModel!.verificationCode!); // DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode!); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index e85c103c..27489733 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -66,7 +66,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Busy); await _specialClinicsService.getSpecialClinicalCareList(); if (_specialClinicsService.hasError) { - error = _specialClinicsService.error; + error = _specialClinicsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -82,7 +82,7 @@ class DashboardViewModel extends BaseViewModel { ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { - error = authProvider.error; + error = authProvider.error!; } } @@ -94,8 +94,8 @@ class DashboardViewModel extends BaseViewModel { } - GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){ - GetSpecialClinicalCareListResponseModel special ; + GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId){ + GetSpecialClinicalCareListResponseModel? special ; specialClinicalCareList.forEach((element) { if(element.clinicID == 1){ special = element; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 520004a4..8dd898bc 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -140,7 +140,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getMyReferredOutPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -183,7 +183,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralOutPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; if (localBusy) setState(ViewState.ErrorLocal); else @@ -239,7 +239,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo!), referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, @@ -395,7 +395,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replayReferred(referredDoctorRemarks, referral, referalStatus); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index af0130d8..188e4be2 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -277,7 +277,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getInPatient(requestModel, false); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { // setDefaultInPatientList(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6fc0f7e1..4d68ea52 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -315,27 +315,27 @@ class ProcedureViewModel extends BaseViewModel { } Future preparePostProcedure( - {String remarks, - String orderType, - PatiantInformtion patient, - List entityList, - ProcedureType procedureType}) async { + {String? remarks, + String? orderType, + PatiantInformtion? patient, + List ? entityList, + ProcedureType? procedureType}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); - procedureValadteRequestModel.patientMRN = patient.patientMRN; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + procedureValadteRequestModel.patientMRN = patient!.patientMRN; + 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", @@ -357,8 +357,8 @@ class ProcedureViewModel extends BaseViewModel { postProcedureReqModel.procedures = controlsProcedure; await valadteProcedure(procedureValadteRequestModel); if (state == ViewState.Idle) { - if (valadteProcedureList[0].entityList.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN); + if (valadteProcedureList[0].entityList!.length == 0) { + await postProcedure(postProcedureReqModel, patient!.patientMRN!); if (state == ViewState.ErrorLocal) { Helpers.showErrorToast(error); @@ -372,7 +372,7 @@ class ProcedureViewModel extends BaseViewModel { getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { Helpers.showErrorToast( - valadteProcedureList[0].entityList[0].warringMessages); + valadteProcedureList[0].entityList![0].warringMessages); } } } else { diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index 86e975e3..ea10d13c 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -15,7 +15,7 @@ class ScanQrViewModel extends BaseViewModel { await _scanQrService.getInPatient(requestModel, true); if (_scanQrService.hasError) { - error = _scanQrService.error; + error = _scanQrService.error!; setState(ViewState.ErrorLocal); } else { diff --git a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart index ec19abb0..c732fa71 100644 --- a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart +++ b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart @@ -1,9 +1,9 @@ class GetSpecialClinicalCareListResponseModel { - int projectID; - int clinicID; - String clinicDescription; - String clinicDescriptionN; - bool isActive; + int? projectID; + int? clinicID; + String? clinicDescription; + String? clinicDescriptionN; + bool? isActive; GetSpecialClinicalCareListResponseModel( {this.projectID, diff --git a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart b/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart index 287f40f1..a69f812f 100644 --- a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart +++ b/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart @@ -1,10 +1,10 @@ class GetSpecialClinicalCareMappingListResponseModel { - int mappingProjectID; - int clinicID; - int nursingStationID; - bool isActive; - int projectID; - String description; + int? mappingProjectID; + int? clinicID; + int? nursingStationID; + bool? isActive; + int? projectID; + String? description; GetSpecialClinicalCareMappingListResponseModel( {this.mappingProjectID, diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index b3ceabb5..cdc8c924 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,15 +1,15 @@ class StartCallReq { - String clincName; - int clinicId; - String docSpec; - String docotrName; - int doctorId; - String generalid; - bool isOutKsa; - bool isrecall; - String projectName; - String tokenID; - int vCID; + String ?clincName; + int ?clinicId; + String ?docSpec; + String? docotrName; + int ?doctorId; + String? generalid; + bool? isOutKsa; + bool ? isrecall; + String? projectName; + String ?tokenID; + int ?vCID; StartCallReq( {this.clincName, diff --git a/lib/models/patient/profile/patient_profile_app_bar_model.dart b/lib/models/patient/profile/patient_profile_app_bar_model.dart index f4654a29..ea576abc 100644 --- a/lib/models/patient/profile/patient_profile_app_bar_model.dart +++ b/lib/models/patient/profile/patient_profile_app_bar_model.dart @@ -1,24 +1,24 @@ import '../patiant_info_model.dart'; class PatientProfileAppBarModel { - double height; - bool isInpatient; - bool isDischargedPatient; - bool isFromLiveCare; - PatiantInformtion patient; - String doctorName; - String branch; - DateTime appointmentDate; - String profileUrl; - String invoiceNO; - String orderNo; - bool isPrescriptions; - bool isMedicalFile; - String episode; - String visitDate; - String clinic; - bool isAppointmentHeader; - bool isFromLabResult; + double? height; + bool? isInpatient; + bool? isDischargedPatient; + bool? isFromLiveCare; + PatiantInformtion? patient; + String? doctorName; + String? branch; + DateTime? appointmentDate; + String? profileUrl; + String? invoiceNO; + String? orderNo; + bool? isPrescriptions; + bool? isMedicalFile; + String? episode; + String? visitDate; + String? clinic; + bool? isAppointmentHeader; + bool? isFromLabResult; PatientProfileAppBarModel( {this.height = 0.0, diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 6adbbfe0..ba6215f2 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -55,7 +55,7 @@ class _LoginScreenState extends State { height: 10, ), Text( - TranslationBase.of(context).welcomeTo, + TranslationBase.of(context).welcomeTo??"", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -64,7 +64,7 @@ class _LoginScreenState extends State { fontFamily: 'Poppins'), ), Text( - TranslationBase.of(context).drSulaimanAlHabib, + TranslationBase.of(context).drSulaimanAlHabib!, style: TextStyle( color: Color(0xFF2B353E), fontWeight: FontWeight.bold, diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index f211781f..f8e62ea1 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -91,7 +91,7 @@ class _VerificationMethodsScreenState extends State { color: Color(0xFF2B353E), ), AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), + Helpers.capitalize(authenticationViewModel.user!.doctorName), fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, @@ -131,7 +131,7 @@ class _VerificationMethodsScreenState extends State { children: [ Text( TranslationBase.of(context) - .lastLoginAt, + .lastLoginAt!, overflow: TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', @@ -164,7 +164,7 @@ class _VerificationMethodsScreenState extends State { .getType( authenticationViewModel .user - .logInTypeID, + !.logInTypeID, context), style: TextStyle( color: @@ -191,21 +191,21 @@ class _VerificationMethodsScreenState extends State { children: [ AppText( authenticationViewModel - .user.editedOn != + .user!.editedOn != null ? AppDateUtils .getDayMonthYearDateFormatted( AppDateUtils .convertStringToDate( authenticationViewModel - .user - .editedOn)) + ! .user + !.editedOn!)) : authenticationViewModel - .user.createdOn != + .user!.createdOn! != null ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) + AppDateUtils.convertStringToDate(authenticationViewModel!.user + !.createdOn!)) : '--', textAlign: TextAlign.right, @@ -214,17 +214,17 @@ class _VerificationMethodsScreenState extends State { fontWeight: FontWeight.w700, ), AppText( - authenticationViewModel.user.editedOn != + authenticationViewModel.user!.editedOn != null ? AppDateUtils.getHour( AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != + authenticationViewModel!.user + !.editedOn!)) + : authenticationViewModel.user!.createdOn != null ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) + AppDateUtils.convertStringToDate(authenticationViewModel!.user + !.createdOn!)) : '--', textAlign: TextAlign.right, @@ -308,8 +308,8 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel:authenticationViewModel, authMethodType: SelectedAuthMethodTypesService .getMethodsTypeService( - authenticationViewModel.user - .logInTypeID), + authenticationViewModel!.user + !.logInTypeID!!), authenticateUser: (AuthMethodTypes authMethodType, diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 0b9e6765..a7e4339d 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -13,11 +13,11 @@ import 'package:flutter/material.dart'; import 'label.dart'; class DashboardReferralPatient extends StatelessWidget { - final List dashboardItemList; - final double height; - final DashboardViewModel model; + final List? dashboardItemList; + final double? height; + final DashboardViewModel? model; - const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + const DashboardReferralPatient({Key? key, this.dashboardItemList, this.height, this.model}) : super(key: key); @override Widget build(BuildContext context) { return RoundedContainer( @@ -101,30 +101,30 @@ class DashboardReferralPatient extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ RowCounts( - dashboardItemList[2] - .summaryoptions[0] + dashboardItemList![2] + .summaryoptions![0] .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black, height: height,), + dashboardItemList![2] + .summaryoptions![0] + .value!, + Colors.black, height: height!,), RowCounts( - dashboardItemList[2] - .summaryoptions[1] + dashboardItemList![2] + .summaryoptions![1] .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey, height: height,), + dashboardItemList![2] + .summaryoptions![1] + .value!, + Colors.grey, height: height!,), RowCounts( - dashboardItemList[2] - .summaryoptions[2] + dashboardItemList![2] + .summaryoptions![2] .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red, height: height,), + dashboardItemList![2] + .summaryoptions![2] + .value!, + Colors.red, height: height!,), ], ), ) @@ -138,21 +138,21 @@ class DashboardReferralPatient extends StatelessWidget { padding:EdgeInsets.all(0), child: GaugeChart( - _createReferralData(dashboardItemList))), + _createReferralData(dashboardItemList!))), Positioned( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ AppText( - model - .getPatientCount(dashboardItemList[2]) + model! + .getPatientCount(dashboardItemList![2]) .toString(), fontSize: SizeConfig.textMultiplier * 3.0, fontWeight: FontWeight.bold, ) ], ), - top: height * (SizeConfig.isHeightVeryShort?0.35:0.40), + top: height! * (SizeConfig.isHeightVeryShort?0.35:0.40), left: 0, right: 0) ]), @@ -164,16 +164,16 @@ class DashboardReferralPatient extends StatelessWidget { static List> _createReferralData(List dashboardItemList) { final data = [ new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), + dashboardItemList![2].summaryoptions![0].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![0].value), charts.MaterialPalette.black), new GaugeSegment( - dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), + dashboardItemList![2].summaryoptions![1].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![1].value), charts.MaterialPalette.gray.shadeDefault), new GaugeSegment( - dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), + dashboardItemList[2].summaryoptions![2].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault), ]; diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 0d1a0e73..a78cfd1f 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -18,7 +18,7 @@ class DashboardSliderItemWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Label(firstLine:Helpers.getLabelFromKPI(item.kPIName) ,secondLine:Helpers.getNameFromKPI(item.kPIName), ), + Label(firstLine:Helpers.getLabelFromKPI(item!.kPIName!) ,secondLine:Helpers.getNameFromKPI(item!.kPIName!), ), ], ), diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 2dac78b9..75d1b713 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -18,7 +18,7 @@ class HomePageCard extends StatelessWidget { final GestureTapCallback onTap; final Color color; final double opacity; - final double width; + final double? width; final EdgeInsets margin; @override Widget build(BuildContext context) { diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index d0fb3569..95897dd3 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -38,12 +38,12 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel projectsProvider; - DoctorProfileModel profile; + ProjectViewModel ?projectsProvider; + DoctorProfileModel ?profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; - String clinicId; + String? clinicId; late AuthenticationViewModel authenticationViewModel; int colorIndex = 0; final GlobalKey scaffoldKey = new GlobalKey(); @@ -142,8 +142,8 @@ class _HomeScreenState extends State { ), Container( child: Label( - firstLine: TranslationBase.of(context).patients, - secondLine: TranslationBase.of(context).services, + firstLine: TranslationBase.of(context).patients!, + secondLine: TranslationBase.of(context).services!, )), SizedBox( height: SizeConfig.heightMultiplier * .6, @@ -177,21 +177,38 @@ class _HomeScreenState extends State { List homePatientsCardsWidget(DashboardViewModel model,projectsProvider) { colorIndex = 0; - List backgroundColors = List(3); - backgroundColors[0] = Color(0xffD02127); - backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xff2B353E); - List backgroundIconColors = List(3); - backgroundIconColors[0] = Colors.white12; - backgroundIconColors[1] = Colors.white38; - backgroundIconColors[2] = Colors.white10; - List textColors = List(3); - textColors[0] = Colors.white; - textColors[1] = Color(0xFF353E47); - textColors[2] = Colors.white; + // List backgroundColors = List(3); + // backgroundColors[0] = Color(0xffD02127); + // backgroundColors[1] = Colors.grey[300]; + // backgroundColors[2] = Color(0xff2B353E); + // List backgroundIconColors = List(3); + // backgroundIconColors[0] = Colors.white12; + // backgroundIconColors[1] = Colors.white38; + // backgroundIconColors[2] = Colors.white10; + // List textColors = List(3); + // textColors[0] = Colors.white; + // textColors[1] = Color(0xFF353E47); + // textColors[2] = Colors.white; + // + // List patientCards = []; + // - List patientCards = List(); + List backgroundColors = []; + backgroundColors.add(Color(0xffD02127)); + backgroundColors.add(Colors.grey[300]!); + backgroundColors.add(Color(0xff2B353E)); + + List backgroundIconColors = []; + backgroundIconColors.add(Colors.white12); + backgroundIconColors.add(Colors.white38); + backgroundIconColors.add(Colors.white10); + + List textColors = []; + textColors.add(Colors.white); + textColors.add(Colors.black); + textColors.add(Colors.white); + List patientCards = []; if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], @@ -222,8 +239,8 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen(specialClinic: model.getSpecialClinic(clinicId??projectsProvider - .doctorClinicsList[0].clinicID),), + page: PatientInPatientScreen(specialClinic: model!.getSpecialClinic(clinicId??projectsProvider + !.doctorClinicsList[0]!.clinicID!),), ), ); }, diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 7284b659..9b1aa63c 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -23,7 +23,7 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { double height = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : 6); - HomeScreenHeader({Key key, this.model, this.onOpenDrawer}) : super(key: key); + HomeScreenHeader({Key? key, required this.model, required this.onOpenDrawer}) : super(key: key); @override _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); @@ -33,11 +33,11 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { } class _HomeScreenHeaderState extends State { - ProjectViewModel projectsProvider; - int clinicId; + ProjectViewModel? projectsProvider; + int? clinicId; - AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel? authenticationViewModel; @override @@ -170,15 +170,15 @@ class _HomeScreenHeaderState extends State { ); }).toList(); }, - onChanged: (newValue) async { + onChanged: (int? newValue) async { setState(() { clinicId = newValue; }); GifLoaderDialogUtils.showMyDialog( context); - await widget.model.changeClinic(newValue, - authenticationViewModel); + await widget.model.changeClinic(newValue!, + authenticationViewModel!); GifLoaderDialogUtils.hideDialog( context); if (widget.model.state == diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index 7e853323..59c396ac 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -7,13 +7,13 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + Key? key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, }) : super(key: key); - final String firstLine; - final String secondLine; + final String? firstLine; + final String? secondLine; Color color; - final double secondLineFontSize; - final double firstLineFontSize; + final double? secondLineFontSize; + final double? firstLineFontSize; @override Widget build(BuildContext context) { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 19bc2a92..ceec4474 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -24,9 +24,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { - final PatiantInformtion patient; + final PatiantInformtion? patient; - const EndCallScreen({Key? key, required this.patient,}) : super(key: key); + const EndCallScreen({Key? key, this.patient,}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -34,7 +34,7 @@ class EndCallScreen extends StatefulWidget { class _EndCallScreenState extends State { bool isInpatient = false; - PatiantInformtion patient; + PatiantInformtion ?patient; bool isDischargedPatient = false; bool isSearchAndOut = false; late String patientType; @@ -53,7 +53,7 @@ class _EndCallScreenState extends State { @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; if(routeArgs.containsKey('patient')) patient = routeArgs['patient']; } @@ -64,10 +64,10 @@ class _EndCallScreenState extends State { PatientProfileCardModel( TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.green[800], + color: Colors.green[800]!, onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.startCall(isReCall: false, vCID: patient.vcId!).then((value) async { + await liveCareModel.startCall(isReCall: false, vCID: patient!.vcId!).then((value) async { await liveCareModel.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { @@ -77,8 +77,8 @@ class _EndCallScreenState extends State { kToken: liveCareModel.startCallRes.openTokenID, kSessionId: liveCareModel.startCallRes.openSessionID, kApiKey: '46209962', - vcId: patient.vcId, - patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), + vcId: patient!.vcId, + patientName: patient!.fullName ?? (patient!.firstName != null ? "${patient!.firstName} ${patient!.lastName}" : "-"), tokenID: await liveCareModel.getToken(), generalId: GENERAL_ID, doctorId: liveCareModel.doctorProfile!.doctorID, @@ -89,7 +89,7 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient.vcId!, + patient!.vcId!, false, );GifLoaderDialogUtils.hideDialog(context); @@ -101,7 +101,7 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient.vcId!, + patient!.vcId!, sessionStatusModel.sessionStatus == 3, ); GifLoaderDialogUtils.hideDialog(context); @@ -118,21 +118,21 @@ class _EndCallScreenState extends State { PatientProfileCardModel( TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.red[800], + color: Colors.red[800]!, onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.getAlternativeServices(patient.vcId!); + await liveCareModel.getAlternativeServices(patient!.vcId!); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCallWithCharge(patient.vcId, isConfirmed); + await liveCareModel.endCallWithCharge(patient!.vcId!, isConfirmed); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -153,7 +153,7 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.sendSMSInstruction(patient.vcId); + await liveCareModel.sendSMSInstruction(patient!.vcId!); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -170,7 +170,7 @@ class _EndCallScreenState extends State { TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', onTap: () { Navigator.push(context, - MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient))); + MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!))); }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), ]; @@ -187,9 +187,9 @@ class _EndCallScreenState extends State { .of(context) .scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient,isInpatient: isInpatient, + appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient!,isInpatient: isInpatient, isDischargedPatient: isDischargedPatient, - height: (patient.patientStatusType != null && patient.patientStatusType == 43) + height: (patient!.patientStatusType != null && patient!.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -235,7 +235,7 @@ class _EndCallScreenState extends State { itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, + patient: patient!, patientType: patientType, arrivalType: arrivalType, from: from, @@ -251,7 +251,7 @@ class _EndCallScreenState extends State { isLoading: cardsList[index].isLoading, isDartIcon: cardsList[index].isDartIcon, dartIcon: cardsList[index].dartIcon, - color: cardsList[index].color, + color: cardsList[index].color, ), ), ], @@ -351,10 +351,10 @@ class _EndCallScreenState extends State { } class CheckBoxListWidget extends StatefulWidget { - final LiveCarePatientViewModel model; + final LiveCarePatientViewModel? model; const CheckBoxListWidget({ - Key key, + Key? key, this.model, }) : super(key: key); @@ -368,7 +368,7 @@ class _CheckBoxListState extends State { return SingleChildScrollView( child: Column( children: [ - ...widget.model.alternativeServicesList + ...widget.model!.alternativeServicesList .map( (element) => Container( child: CheckboxListTile( @@ -380,7 +380,7 @@ class _CheckBoxListState extends State { value: element.isSelected, onChanged: (newValue) { setState(() { - widget.model + widget.model! .setSelectedCheckboxValues(element, newValue); }); }, diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index d30f996c..4b9200ad 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -113,7 +113,7 @@ class _LivaCareTransferToAdminState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await model.transferToAdmin(widget.patient.vcId, noteController.text); + await model.transferToAdmin(widget!.patient!.vcId!, noteController.text); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 10bab392..6c959f3a 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -66,7 +66,7 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', vcId: widget.patientData.vcId, - patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", + patientName: widget.patientData.fullName != null ? widget.patientData.fullName! : widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", doctorId: doctorprofile['DoctorID'], diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 2ea90f0d..6dff0abc 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -90,8 +90,8 @@ class _MedicalFileDetailsState extends State { bool isHistoryExpand = true; bool isAssessmentExpand = true; - PatientProfileAppBarModel patientProfileAppBarModel; - ProjectViewModel projectViewModel; + PatientProfileAppBarModel? patientProfileAppBarModel; + ProjectViewModel? projectViewModel; @override void didChangeDependencies() { @@ -129,13 +129,13 @@ class _MedicalFileDetailsState extends State { } }, builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => + (BuildContext? context, MedicalFileViewModel? model, Widget ?child) => AppScaffold( - patientProfileAppBarModel: patientProfileAppBarModel, + patientProfileAppBarModel: patientProfileAppBarModel!, isShowAppBar: true, appBarTitle: TranslationBase - .of(context) - .medicalReport + .of(context!)! + .medicalReport! .toUpperCase(), body: NetworkBaseView( baseViewModel: model, @@ -144,13 +144,13 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && + model!.medicalFileList!.length != 0 && model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations + .medicalFileList![0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations! .length != 0 ? Padding( @@ -160,7 +160,7 @@ class _MedicalFileDetailsState extends State { children: [ SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -205,7 +205,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -224,7 +224,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -254,7 +254,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -297,7 +297,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -319,7 +319,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -342,7 +342,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -361,7 +361,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -383,7 +383,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -401,7 +401,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -432,7 +432,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -475,7 +475,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -498,7 +498,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -520,7 +520,7 @@ class _MedicalFileDetailsState extends State { AppText( AppDateUtils.getDateFormatted(DateTime.parse( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -544,7 +544,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -563,7 +563,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -600,7 +600,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -645,7 +645,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -663,7 +663,7 @@ class _MedicalFileDetailsState extends State { AppText(TranslationBase.of(context).examType! + ": "), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -678,7 +678,7 @@ class _MedicalFileDetailsState extends State { children: [ AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -694,7 +694,7 @@ class _MedicalFileDetailsState extends State { AppText(TranslationBase.of(context).abnormal! + ": "), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -710,7 +710,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 88f85440..c1c96c95 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -18,9 +18,9 @@ import 'DischargedPatientPage.dart'; import 'InPatientPage.dart'; class PatientInPatientScreen extends StatefulWidget { - GetSpecialClinicalCareListResponseModel specialClinic; + GetSpecialClinicalCareListResponseModel? specialClinic; - PatientInPatientScreen({Key key, this.specialClinic}); + PatientInPatientScreen({Key? key, this.specialClinic}); @override _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); @@ -30,7 +30,7 @@ class _PatientInPatientScreenState extends State with Si late TabController _tabController; int _activeTab = 0; - int selectedMapId; + int? selectedMapId; @override @@ -182,7 +182,7 @@ class _PatientInPatientScreenState extends State with Si ); }).toList(); }, - onChanged: (newValue) async { + onChanged: (int? newValue) async { setState(() { selectedMapId = newValue; }); diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 5275eff6..1d039a72 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -32,8 +32,8 @@ class _InsuranceApprovalsDetailsState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + ProjectViewModel projectViewModel = Provider.of(context!); + final routeArgs = ModalRoute.of(context!)!.settings.arguments as Map; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 @@ -44,7 +44,7 @@ class _InsuranceApprovalsDetailsState extends State { appointmentNo: patient.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient) : null, - builder: (BuildContext context, InsuranceViewModel model, Widget child) => + builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) => AppScaffold( isShowAppBar: true, baseViewModel: model, @@ -62,7 +62,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context!).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -72,7 +72,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context!).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -99,19 +99,16 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption != null - ? model - .insuranceApprovalInPatient[ + ? model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption ?? "" : "", - color: model - .insuranceApprovalInPatient[ + color: model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption != null @@ -128,10 +125,9 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - .doctorName + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -159,10 +155,9 @@ class _InsuranceApprovalsDetailsState extends State { BorderRadius.circular( 50), child: Image.network( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - .doctorImage, + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -191,15 +186,14 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .clinic + + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, ), Expanded( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .clinicName, fontSize: 14, @@ -212,14 +206,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .approvalNo + + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .approvalNo .toString(), @@ -235,8 +228,7 @@ class _InsuranceApprovalsDetailsState extends State { fontSize: 14, ), AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .unUsedCount .toString(), @@ -249,7 +241,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .companyName + + .companyName! + ": ", color: Colors.grey[500], ), @@ -261,13 +253,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .receiptOn + + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -280,12 +272,12 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .expiryDate + + .expiryDate! + ": ", color: Colors.grey[500], ), AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -312,21 +304,21 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .usageStatus, fontWeight: FontWeight.w700, ), @@ -343,10 +335,9 @@ class _InsuranceApprovalsDetailsState extends State { child: ListView.builder( shrinkWrap: true, physics: ScrollPhysics(), - itemCount: model - .insuranceApprovalInPatient[ + itemCount: model!.insuranceApprovalInPatient[ indexInsurance] - .apporvalDetails + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -359,10 +350,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -375,10 +365,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.status ?? "", @@ -391,10 +380,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", @@ -439,7 +427,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context!).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -449,7 +437,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context!).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -476,19 +464,16 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .approvalStatusDescption != null - ? model - .insuranceApproval[ + ? model!.insuranceApproval[ indexInsurance] .approvalStatusDescption ?? "" : "", - color: model - .insuranceApproval[ + color: model!.insuranceApproval[ indexInsurance] .approvalStatusDescption != null @@ -503,9 +488,8 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApproval[indexInsurance] - .doctorName + model!.insuranceApproval[indexInsurance] + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -533,10 +517,9 @@ class _InsuranceApprovalsDetailsState extends State { BorderRadius.circular( 50), child: Image.network( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - .doctorImage, + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -565,15 +548,14 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .clinic + + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, ), Expanded( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .clinicName, fontSize: 14, @@ -586,14 +568,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .approvalNo + + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .approvalNo .toString(), @@ -606,14 +587,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .unusedCount + + .unusedCount! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .unUsedCount .toString(), @@ -626,7 +606,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .companyName + + .companyName! + ": ", color: Colors.grey[500], ), @@ -638,13 +618,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .receiptOn + + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -657,17 +637,16 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .expiryDate + + .expiryDate! + ": ", color: Colors.grey[500], ), - if (model - .insuranceApproval[ + if (model!.insuranceApproval[ indexInsurance] .expiryDate != null) AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model!.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -694,21 +673,21 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .usageStatus, fontWeight: FontWeight.w700, ), @@ -725,10 +704,9 @@ class _InsuranceApprovalsDetailsState extends State { child: ListView.builder( shrinkWrap: true, physics: ScrollPhysics(), - itemCount: model - .insuranceApproval[ + itemCount: model!.insuranceApproval[ indexInsurance] - .apporvalDetails + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -741,10 +719,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -757,10 +734,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.status ?? "", @@ -773,10 +749,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 2f5f6e69..b9783a9b 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -39,7 +39,7 @@ class _LaboratoryResultPageState extends State { patientProfileAppBarModel: PatientProfileAppBarModel( patient:widget.patient,isInpatient:widget.isInpatient, isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate,), + appointmentDate: widget.patientLabOrders.orderDate!,), baseViewModel: model, body: AppScaffold( diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 06ca9256..1f78b242 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -59,10 +59,10 @@ class _AddVerifyMedicalReportState extends State { HtmlRichEditor( initialText: (medicalReport != null ? medicalReport.reportDataHtml - : model.medicalReportTemplate - .length > 0 ? model - .medicalReportTemplate[0] : ""), + : model!.medicalReportTemplate! + .length! > 0 ? model.medicalReportTemplate[0].templateTextHtml!: ""), hint: "Write the medical report ", + controller: _controller, height: MediaQuery .of(context) diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 0d40f0a3..47ab7ac1 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -112,7 +112,7 @@ class MedicalReportPage extends StatelessWidget { hasBorder: false, bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) - : Colors.green[700], + : Colors.green[700]!, widget: Column( children: [ Row( diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index 39148cf9..9808bb97 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -13,7 +13,8 @@ class PatientProfileCardModel { final bool isSelectInpatient; final bool isDartIcon; final IconData? dartIcon; - final Color color; + final Color? color; + PatientProfileCardModel(this.nameLine1, this.nameLine2, this.route, this.icon, {this.isInPatient = false, 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 228d87ae..a2ceb550 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -54,8 +54,8 @@ class _PatientProfileScreenState extends State with Single int index = 0; int _activeTab = 0; - StreamController videoCallDurationStreamController; - Stream videoCallDurationStream = (() async*{})(); + late StreamController videoCallDurationStreamController; + late Stream videoCallDurationStream; //= (() async*{})(); TODO Elham* @override void initState() { _tabController = TabController(length: 2, vsync: this); @@ -103,7 +103,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) ..onDone(() { @@ -117,7 +117,7 @@ class _PatientProfileScreenState extends State with Single callDisconnected(){ callTimer.cancel(); - videoCallDurationStreamController.sink.add(null); + videoCallDurationStreamController.sink.add(''); } @override @@ -299,7 +299,8 @@ class _PatientProfileScreenState extends State with Single onPressed: () async { // Navigator.push(context, MaterialPageRoute( // builder: (BuildContext context) => - // EndCallScreen(patient:patient)));if (isCallFinished) { + // EndCallScreen(patient:patient))) + if (isCallFinished) { Navigator.push( context, MaterialPageRoute( @@ -319,7 +320,7 @@ class _PatientProfileScreenState extends State with Single GifLoaderDialogUtils.hideDialog(context); AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); - }); + }, type: ''); } diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index db3d0bfd..79bb7614 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -33,7 +33,7 @@ class RadiologyDetailsPage extends StatelessWidget { builder: (_, model, widget) => AppScaffold( patientProfileAppBarModel: PatientProfileAppBarModel( patient: patient, - appointmentDate: finalRadiology.orderDate, + appointmentDate: finalRadiology.orderDate!, doctorName: finalRadiology.doctorName, clinic: finalRadiology.clinicDescription, branch: finalRadiology.projectName, diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 2069f446..76fabbbf 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -24,8 +24,8 @@ import 'ReplySummeryOnReferralPatient.dart'; class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; - final AddReferredRemarksRequestModel myReferralInPatientRequestModel; - final bool isEdited; + final AddReferredRemarksRequestModel? myReferralInPatientRequestModel; + final bool? isEdited; const AddReplayOnReferralPatient( {Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel, diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index 2a48e079..cfd37cd0 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -37,7 +37,7 @@ class _ReplySummeryOnReferralPatientState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).summeryReply, + appBarTitle: TranslationBase.of(context).summeryReply!, body: Container( child: Column( children: [ diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 7d6bdb08..68194da5 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -428,7 +428,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), ), - if (referredPatient.referredDoctorRemarks.isNotEmpty) + if (referredPatient.referredDoctorRemarks!.isNotEmpty) Container( width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), @@ -487,7 +487,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { widget: AddReplayOnReferralPatient( patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, - isEdited: referredPatient.referredDoctorRemarks.isNotEmpty, + isEdited: referredPatient.referredDoctorRemarks!.isNotEmpty, ), ), ); diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index c94de944..0848eee2 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -138,10 +138,10 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).inPatient), value: PatientType.IN_PATIENT, groupValue: patientType, - onChanged: (PatientType value) { + onChanged: (PatientType? value) { setState(() { - patientType = value; - radioOnChange(value); + patientType = value!; + radioOnChange(value!); }); }, ), @@ -151,9 +151,9 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).outpatient), value: PatientType.OUT_PATIENT, groupValue: patientType, - onChanged: (PatientType value) { + onChanged: (PatientType? value) { setState(() { - patientType = value; + patientType = value!; radioOnChange(value); }); }, diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 2d1d5c4d..bed9825f 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -34,13 +34,13 @@ class PrescriptionItemsPage extends StatelessWidget { baseViewModel: model, patientProfileAppBarModel: PatientProfileAppBarModel( patient: patient, - clinic: prescriptions.clinicDescription, - branch: prescriptions.name, + clinic: prescriptions.clinicDescription!, + branch: prescriptions.name!, isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( prescriptions.appointmentDate!), - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, + doctorName: prescriptions.doctorName!, + profileUrl: prescriptions.doctorImageURL!, isAppointmentHeader: true, ), body: SingleChildScrollView( diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 28a72041..39b52a28 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -10,19 +10,19 @@ enum ProcedureType { extension procedureType on ProcedureType { String getFavouriteTabName(BuildContext context) { - return TranslationBase.of(context).favoriteTemplates; + return TranslationBase.of(context).favoriteTemplates!; } String getAllLabelName(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).allProcedures; + return TranslationBase.of(context).allProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).allLab; + return TranslationBase.of(context).allLab!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).allRadiology; + return TranslationBase.of(context).allRadiology!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).allPrescription; + return TranslationBase.of(context).allPrescription!; default: return ""; } @@ -31,13 +31,13 @@ extension procedureType on ProcedureType { String getToolbarLabel(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures; + return TranslationBase.of(context).addProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder; + return TranslationBase.of(context).addLabOrder!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder; + return TranslationBase.of(context).addRadiologyOrder!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription; + return TranslationBase.of(context).addPrescription!; default: return ""; } @@ -46,13 +46,13 @@ extension procedureType on ProcedureType { String getAddButtonTitle(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures; + return TranslationBase.of(context).addProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder; + return TranslationBase.of(context).addLabOrder!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder; + return TranslationBase.of(context).addRadiologyOrder!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription; + return TranslationBase.of(context).addPrescription!; default: return ""; } @@ -61,7 +61,7 @@ extension procedureType on ProcedureType { String getCategoryId() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ''; case ProcedureType.LAB_RESULT: return "02"; case ProcedureType.RADIOLOGY: @@ -69,20 +69,20 @@ extension procedureType on ProcedureType { case ProcedureType.PRESCRIPTION: return "55"; default: - return null; + return ''; } } String getCategoryName() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ''; case ProcedureType.LAB_RESULT: return "Laboratory"; case ProcedureType.RADIOLOGY: return "Radiology"; default: - return null; + return ''; } } } diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 04194d80..6c9dfd8b 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -24,11 +24,11 @@ class AddFavouriteProcedure extends StatefulWidget { final ProcedureType procedureType; AddFavouriteProcedure({ - Key key, - this.model, - this.prescriptionModel, - this.patient, - @required this.procedureType, + Key? key, + required this.model, + required this.prescriptionModel, + required this.patient, + required this.procedureType, }); @override @@ -38,26 +38,26 @@ class AddFavouriteProcedure extends StatefulWidget { class _AddFavouriteProcedureState extends State { _AddFavouriteProcedureState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; - List entityList = List(); - ProcedureTempleteDetailsModel groupProcedures; + ProcedureViewModel? model; + PatiantInformtion? patient; + List entityList = []; + late ProcedureTempleteDetailsModel groupProcedures; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context!).size.height * 0.070, ), - if (model.templateList.length != 0) + if (model!.templateList.length != 0) Expanded( child: EntityListCheckboxSearchFavProceduresWidget( isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), @@ -88,8 +88,8 @@ class _AddFavouriteProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.procedureType.getAddButtonTitle(context) ?? - TranslationBase.of(context).addSelectedProcedures, + title: widget.procedureType.getAddButtonTitle(context!) ?? + TranslationBase.of(context!).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { @@ -114,7 +114,7 @@ class _AddFavouriteProcedureState extends State { } else { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .fillTheMandatoryProcedureDetails, ); return; @@ -126,8 +126,8 @@ class _AddFavouriteProcedureState extends State { items: entityList, model: model, patient: widget.patient, - addButtonTitle: widget.procedureType.getAddButtonTitle(context), - toolbarTitle: widget.procedureType.getToolbarLabel(context), + addButtonTitle: widget.procedureType.getAddButtonTitle(context!), + toolbarTitle: widget.procedureType.getToolbarLabel(context!), ), ), ); diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index e0b7374f..9f953267 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -21,7 +21,7 @@ class AddProcedurePage extends StatefulWidget { final ProcedureType procedureType; const AddProcedurePage( - {Key key, this.model, this.patient, @required this.procedureType}) + {Key? key, required this.model, required this.patient, required this.procedureType}) : super(key: key); @override @@ -30,17 +30,17 @@ class AddProcedurePage extends StatefulWidget { } class _AddProcedurePageState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - ProcedureType procedureType; + int? selectedType; + ProcedureViewModel? model; + PatiantInformtion ?patient; + ProcedureType? procedureType; _AddProcedurePageState({this.patient, this.model, this.procedureType}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -56,17 +56,17 @@ class _AddProcedurePageState extends State { return BaseView( onModelReady: (model) { model.getProcedureCategory( - categoryName: procedureType.getCategoryName(), - categoryID: procedureType.getCategoryId(), - patientId: patient.patientId); + categoryName: procedureType!.getCategoryName(), + categoryID: procedureType!.getCategoryId(), + patientId: patient!.patientId); }, - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context!).size.height * 0.070, ), Expanded( child: NetworkBaseView( @@ -86,7 +86,7 @@ class _AddProcedurePageState extends State { MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, @@ -95,15 +95,15 @@ class _AddProcedurePageState extends State { ), SizedBox( height: - MediaQuery.of(context).size.height * 0.02, + MediaQuery.of(context!).size.height * 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * + width: MediaQuery.of(context!).size.width * 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context!) .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, @@ -113,7 +113,7 @@ class _AddProcedurePageState extends State { ), ), SizedBox( - width: MediaQuery.of(context).size.width * + width: MediaQuery.of(context!).size.width * 0.02, ), Expanded( @@ -121,13 +121,13 @@ class _AddProcedurePageState extends State { onTap: () { if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, + model!.getProcedureCategory( + patientId: patient!.patientId, categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .atLeastThreeCharacters, ); }, @@ -144,13 +144,13 @@ class _AddProcedurePageState extends State { if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && - model.categoriesList.length != 0) + model!.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, masterList: - model.categoriesList[0].entityList, + model!.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -181,24 +181,24 @@ class _AddProcedurePageState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: procedureType.getAddButtonTitle(context), + title: procedureType!.getAddButtonTitle(context!), fontWeight: FontWeight.w700, color: Color(0xff359846), onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .fillTheMandatoryProcedureDetails, ); return; } - await this.model.preparePostProcedure( + await this.model!.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, remarks: remarksController.text); - Navigator.pop(context); + Navigator.pop(context!); }, ), ], diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index bdf19051..202a261f 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -15,13 +15,13 @@ import 'add-favourite-procedure.dart'; import 'add-procedure-page.dart'; class BaseAddProcedureTabPage extends StatefulWidget { - final ProcedureViewModel model; - final PrescriptionViewModel prescriptionModel; - final PatiantInformtion patient; - final ProcedureType procedureType; + final ProcedureViewModel? model; + final PrescriptionViewModel? prescriptionModel; + final PatiantInformtion? patient; + final ProcedureType? procedureType; const BaseAddProcedureTabPage( - {Key key, + {Key? key, this.model, this.prescriptionModel, this.patient, @@ -30,7 +30,7 @@ class BaseAddProcedureTabPage extends StatefulWidget { @override _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( - patient: patient, model: model, procedureType: procedureType); + patient: patient!, model: model!, procedureType: procedureType!); } class _BaseAddProcedureTabPageState extends State @@ -39,9 +39,9 @@ class _BaseAddProcedureTabPageState extends State final PatiantInformtion patient; final ProcedureType procedureType; - _BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType}); + _BaseAddProcedureTabPageState({required this.patient, required this.model, required this.procedureType}); - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -68,7 +68,7 @@ class _BaseAddProcedureTabPageState extends State final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( @@ -154,17 +154,17 @@ class _BaseAddProcedureTabPageState extends State AddFavouriteProcedure( model: this.model, prescriptionModel: - widget.prescriptionModel, + widget.prescriptionModel!, patient: patient, procedureType: procedureType, ), if (widget.procedureType == ProcedureType.PRESCRIPTION) PrescriptionFormWidget( - widget.prescriptionModel, - widget.patient, - widget.prescriptionModel - .prescriptionList) + widget.prescriptionModel!, + widget.patient!, + widget!.prescriptionModel! + .prescriptionList!) else AddProcedurePage( model: this.model, diff --git a/lib/util/NotificationPermissionUtils.dart b/lib/util/NotificationPermissionUtils.dart index 8950fae3..550fedc5 100644 --- a/lib/util/NotificationPermissionUtils.dart +++ b/lib/util/NotificationPermissionUtils.dart @@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart'; class AppPermissionsUtils { - static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { + static requestVideoCallPermission({required BuildContext context, required String type,required Function onTapGrant}) async { var cameraPermission = Permission.camera; var microphonePermission = Permission.microphone; diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index dc60efaf..d06e39c0 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -19,9 +19,9 @@ class VideoChannel { String? tokenID, String? generalId, int? doctorId, - String patientName, Function()? onCallEnd, + required String patientName, Function()? onCallEnd, Function(SessionStatusModel sessionStatusModel)? onCallNotRespond, - Function(String error)? onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { + Function(String error)? onFailure, VoidCallback? onCallConnected, VoidCallback? onCallDisconnected}) async { onCallConnected = onCallConnected ?? (){}; onCallDisconnected = onCallDisconnected ?? (){}; @@ -29,10 +29,10 @@ class VideoChannel { try { _channel.setMethodCallHandler((call) { if(call.method == 'onCallConnected'){ - onCallConnected(); + onCallConnected!(); } if(call.method == 'onCallDisconnected'){ - onCallDisconnected(); + onCallDisconnected!(); } return true as dynamic; }); diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 9b00ba2b..55700a75 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -396,7 +396,7 @@ class AppDateUtils { static convertDateFormatImproved(String str) { - String newDate; + String newDate =''; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -413,6 +413,6 @@ class AppDateUtils { date.day.toString().padLeft(2, '0'); } - return newDate??''; + return newDate; } } diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 2376e191..a0e2acda 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -271,10 +271,10 @@ class Helpers { } - static String timeFrom({Duration duration}) { + static String timeFrom({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)); + String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60)); + String twoDigitSeconds = twoDigits(duration!.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 270b4ad3..69f5eafe 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -847,8 +847,8 @@ class TranslationBase { String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; - String get addProcedures => - localizedValues['addProcedures'][locale.languageCode]; + String? get addProcedures => + localizedValues['addProcedures']![locale.languageCode]; String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; @@ -1081,14 +1081,14 @@ class TranslationBase { String? get impressionRecommendation => localizedValues['impressionRecommendation']![locale.languageCode]; String? get onHold => localizedValues['onHold']![locale.languageCode]; String? get verified => localizedValues['verified']![locale.languageCode]; - String get favoriteTemplates => localizedValues['favoriteTemplates'][locale.languageCode]; - String get allProcedures => localizedValues['allProcedures'][locale.languageCode]; - String get allRadiology => localizedValues['allRadiology'][locale.languageCode]; - String get allLab => localizedValues['allLab'][locale.languageCode]; - String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; - String get addPrescription => localizedValues['addPrescription'][locale.languageCode]; - String get edit => localizedValues['edit'][locale.languageCode]; - String get summeryReply => localizedValues['summeryReply'][locale.languageCode]; + String? get favoriteTemplates => localizedValues['favoriteTemplates']![locale.languageCode]; + String? get allProcedures => localizedValues['allProcedures']![locale.languageCode]; + String? get allRadiology => localizedValues['allRadiology']![locale.languageCode]; + String? get allLab => localizedValues['allLab']![locale.languageCode]; + String? get allPrescription => localizedValues['allPrescription']![locale.languageCode]; + String? get addPrescription => localizedValues['addPrescription']![locale.languageCode]; + String? get edit => localizedValues['edit']![locale.languageCode]; + String? get summeryReply => localizedValues['summeryReply']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index dcadb8be..ce401b2f 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class RowCounts extends StatelessWidget { final name; final int count; - final double height; + final double? height; final Color c; RowCounts(this.name, this.count, this.c, {this.height}); @override diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart index 58718373..f7a23925 100644 --- a/lib/widgets/dialog/AskPermissionDialog.dart +++ b/lib/widgets/dialog/AskPermissionDialog.dart @@ -10,7 +10,7 @@ class AskPermissionDialog extends StatefulWidget { final String type; final Function onTapGrant; - AskPermissionDialog({this.type, this.onTapGrant}); + AskPermissionDialog({required this.type, required this.onTapGrant}); @override _AskPermissionDialogState createState() => _AskPermissionDialogState(); diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index b769588b..022571fa 100644 --- a/lib/widgets/patients/patient_card/ShowTimer.dart +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -9,7 +9,7 @@ class ShowTimer extends StatefulWidget { const ShowTimer({ - Key key, this.patientInfo, + Key? key, required this.patientInfo, }) : super(key: key); @override @@ -50,7 +50,7 @@ class _ShowTimerState extends State { generateShowTimerString() { DateTime now = DateTime.now(); - DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); + DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!); String timer = AppDateUtils.differenceBetweenDateAndCurrent( liveCareDate, context, isShowSecond: true, isShowDays: false); diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 31d281ae..6191fd4d 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -27,8 +27,8 @@ class PatientProfileButton extends StatelessWidget { final bool isSelectInpatient; final bool isDartIcon; final IconData? dartIcon; - final bool isFromLiveCare; - final Color color; + final bool? isFromLiveCare; + final Color? color; PatientProfileButton({ Key? key, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index c39caef1..8b7a4c05 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -16,20 +16,20 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatientProfileAppBarModel patientProfileAppBarModel; final bool isFromLabResult; - final VoidCallback onPressed; + final VoidCallback? onPressed; PatientProfileAppBar( - {this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed}); + {required this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); int gender = 1; - if (patientProfileAppBarModel.patient.patientDetails != null) { - gender = patientProfileAppBarModel.patient.patientDetails.gender; + if (patientProfileAppBarModel.patient!.patientDetails != null) { + gender = patientProfileAppBarModel.patient!.patientDetails!.gender!; } else { - gender = patientProfileAppBarModel.patient.gender; + gender = patientProfileAppBarModel.patient!.gender!; } return Container( @@ -54,22 +54,22 @@ class PatientProfileAppBar extends StatelessWidget color: Color(0xFF2B353E), //Colors.black, onPressed: () { if(onPressed!=null) - onPressed(); + onPressed!(); Navigator.pop(context); }, ), Expanded( child: AppText( - patientProfileAppBarModel.patient.firstName != null + patientProfileAppBarModel.patient!.firstName != null ? (Helpers.capitalize( - patientProfileAppBarModel.patient.firstName) + + patientProfileAppBarModel.patient!.firstName) + " " + Helpers.capitalize( - patientProfileAppBarModel.patient.lastName)) + patientProfileAppBarModel.patient!.lastName)) : Helpers.capitalize( - patientProfileAppBarModel.patient.fullName ?? + patientProfileAppBarModel.patient!.fullName ?? patientProfileAppBarModel - .patient.patientDetails.fullName), + .patient!.patientDetails!.fullName!), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -90,7 +90,7 @@ class PatientProfileAppBar extends StatelessWidget child: InkWell( onTap: () { launch("tel://" + - patientProfileAppBarModel.patient.mobileNumber); + patientProfileAppBarModel.patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -121,13 +121,13 @@ class PatientProfileAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - patientProfileAppBarModel.patient.patientStatusType != null + patientProfileAppBarModel.patient!.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ patientProfileAppBarModel - .patient.patientStatusType == + .patient!.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, @@ -143,14 +143,14 @@ class PatientProfileAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - patientProfileAppBarModel.patient.startTime != + patientProfileAppBarModel.patient!.startTime != null ? AppText( patientProfileAppBarModel - .patient.startTime != + .patient!.startTime != null ? patientProfileAppBarModel - .patient.startTime + .patient!.startTime : '', fontWeight: FontWeight.w700, fontSize: 12, @@ -180,7 +180,7 @@ class PatientProfileAppBar extends StatelessWidget ), new TextSpan( text: patientProfileAppBarModel - .patient.patientId + .patient!.patientId .toString(), style: TextStyle( fontWeight: FontWeight.w700, @@ -194,28 +194,28 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText( - patientProfileAppBarModel.patient.nationalityName ?? + patientProfileAppBarModel.patient!.nationalityName ?? patientProfileAppBarModel - .patient.nationality ?? + .patient!.nationality ?? patientProfileAppBarModel - .patient.nationalityId ?? + .patient!.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), patientProfileAppBarModel - .patient.nationalityFlagURL != + .patient!.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( patientProfileAppBarModel - .patient.nationalityFlagURL, + .patient!.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -234,7 +234,7 @@ class PatientProfileAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", + text: TranslationBase.of(context).age! + " : ", style: TextStyle( fontSize: 10, fontWeight: FontWeight.w600, @@ -242,7 +242,7 @@ class PatientProfileAppBar extends StatelessWidget )), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient.patientDetails != null ? patientProfileAppBarModel.patient.patientDetails.dateofBirth ?? "" : patientProfileAppBarModel.patient.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare!)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12, @@ -253,15 +253,15 @@ class PatientProfileAppBar extends StatelessWidget ), ), - if (patientProfileAppBarModel.patient.appointmentDate != + if (patientProfileAppBarModel.patient!.appointmentDate != null && patientProfileAppBarModel - .patient.appointmentDate.isNotEmpty && !isFromLabResult) + .patient!.appointmentDate!.isNotEmpty && !isFromLabResult) Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 10, color: Color(0xFF575757), fontWeight: FontWeight.w600, @@ -274,7 +274,7 @@ class PatientProfileAppBar extends StatelessWidget AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( patientProfileAppBarModel - .patient.appointmentDate)), + .patient!.appointmentDate!)), fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), @@ -284,7 +284,7 @@ class PatientProfileAppBar extends StatelessWidget ) ], ), - if (patientProfileAppBarModel.isFromLabResult) + if (patientProfileAppBarModel.isFromLabResult!) Container( child: RichText( text: new TextSpan( @@ -304,7 +304,7 @@ class PatientProfileAppBar extends StatelessWidget )), new TextSpan( text: - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12)), @@ -316,10 +316,10 @@ class PatientProfileAppBar extends StatelessWidget Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patientProfileAppBarModel.patient.admissionDate != + if (patientProfileAppBarModel.patient!.admissionDate != null && patientProfileAppBarModel - .patient.admissionDate.isNotEmpty) + .patient!.admissionDate!.isNotEmpty) Container( child: RichText( text: new TextSpan( @@ -332,26 +332,26 @@ class PatientProfileAppBar extends StatelessWidget children: [ new TextSpan( text: patientProfileAppBarModel - .patient.admissionDate == + .patient!.admissionDate == null ? "" : TranslationBase.of(context) - .admissionDate + + .admissionDate! + " : ", style: TextStyle(fontSize: 10)), new TextSpan( text: patientProfileAppBarModel - .patient.admissionDate == + .patient!.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), )), ]))), - if (patientProfileAppBarModel.patient.admissionDate != + if (patientProfileAppBarModel.patient!.admissionDate != null) Row( children: [ @@ -360,20 +360,20 @@ class PatientProfileAppBar extends StatelessWidget fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), - if (patientProfileAppBarModel - .isDischargedPatient && + if (patientProfileAppBarModel! + .isDischargedPatient! && patientProfileAppBarModel - .patient.dischargeDate != + .patient!.dischargeDate != null) AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), ) else AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), @@ -386,7 +386,7 @@ class PatientProfileAppBar extends StatelessWidget ), ), ]), - if (patientProfileAppBarModel.isAppointmentHeader) + if (patientProfileAppBarModel.isAppointmentHeader!) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -401,8 +401,8 @@ class PatientProfileAppBar extends StatelessWidget shape: BoxShape.rectangle, border: Border( bottom: - BorderSide(color: Colors.grey[400], width: 2.5), - left: BorderSide(color: Colors.grey[400], width: 2.5), + BorderSide(color: Colors.grey[400]!, width: 2.5), + left: BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -436,7 +436,7 @@ class PatientProfileAppBar extends StatelessWidget if (patientProfileAppBarModel.orderNo != null && !patientProfileAppBarModel - .isPrescriptions) + .isPrescriptions!) Row( children: [ AppText( @@ -454,8 +454,8 @@ class PatientProfileAppBar extends StatelessWidget ), if (patientProfileAppBarModel.invoiceNO != null && - !patientProfileAppBarModel - .isPrescriptions) + !patientProfileAppBarModel! + .isPrescriptions!) Row( children: [ AppText( @@ -506,7 +506,7 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (patientProfileAppBarModel - .isMedicalFile && + .isMedicalFile! && patientProfileAppBarModel.episode != null) Row( @@ -525,7 +525,7 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (patientProfileAppBarModel - .isMedicalFile && + .isMedicalFile! && patientProfileAppBarModel.visitDate != null) Row( @@ -544,12 +544,12 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (!patientProfileAppBarModel - .isMedicalFile) + .isMedicalFile!) Row( children: [ AppText( !patientProfileAppBarModel - .isPrescriptions + .isPrescriptions! ? 'Result Date:' : 'Prescriptions Date ', fontSize: 10, @@ -557,7 +557,7 @@ class PatientProfileAppBar extends StatelessWidget color: Color(0xFF575757), ), AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', fontSize: 12, ) ], @@ -581,14 +581,14 @@ class PatientProfileAppBar extends StatelessWidget Size get preferredSize => Size( double.maxFinite, patientProfileAppBarModel.height == 0 - ? patientProfileAppBarModel.isAppointmentHeader + ? patientProfileAppBarModel.isAppointmentHeader! ? 270 - : ((patientProfileAppBarModel.patient.appointmentDate != null &&patientProfileAppBarModel.patient.appointmentDate.isNotEmpty ) - ? patientProfileAppBarModel.isFromLabResult?170:150 - : patientProfileAppBarModel.patient.admissionDate != null - ? patientProfileAppBarModel.isFromLabResult?170:150 - : patientProfileAppBarModel.isDischargedPatient - ? 240 - : 130) - : patientProfileAppBarModel.height); + : ((patientProfileAppBarModel.patient!.appointmentDate! != null &&patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty ) + ? patientProfileAppBarModel.isFromLabResult!?170:150 + : patientProfileAppBarModel.patient!.admissionDate != null + ? patientProfileAppBarModel.isFromLabResult!?170:150 + : patientProfileAppBarModel.isDischargedPatient! + ? 240! + : 130!) + : patientProfileAppBarModel.height!); } diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 251d2e65..d5ddd66c 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -20,10 +20,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred final bool isDischargedPatient; final bool isFromLiveCare; - final Stream videoCallDurationStream; + 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) { @@ -101,7 +101,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred child: Container( decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), - child: Text(snapshot.data, style: TextStyle(color: Colors.white),), + child: Text(snapshot.data!, style: TextStyle(color: Colors.white),), ), ); else diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index fa09aa72..a8c59032 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -21,12 +21,12 @@ class AppScaffold extends StatelessWidget { final Widget? bottomSheet; final Color? backgroundColor; final PreferredSizeWidget? appBar; - final Widget drawer; - final Widget bottomNavigationBar; + final Widget? drawer; + final Widget? bottomNavigationBar; final String? subtitle; final bool isHomeIcon; final bool extendBody; - final PatientProfileAppBarModel patientProfileAppBarModel; + final PatientProfileAppBarModel? patientProfileAppBarModel; AppScaffold( {this.appBarTitle = '', @@ -57,7 +57,7 @@ class AppScaffold extends StatelessWidget { bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar ? patientProfileAppBarModel != null ? PatientProfileAppBar( - patientProfileAppBarModel: patientProfileAppBarModel,) : appBar ?? + patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ?? AppBar( elevation: 0, backgroundColor: Colors.white, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 6c46ea36..108b987c 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -18,7 +18,7 @@ class AppText extends StatefulWidget { final double? marginRight; final double? marginBottom; final double? marginLeft; - final double letterSpacing; + final double? letterSpacing; final TextAlign? textAlign; final bool? bold; final bool? regular; diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 4b80ae0a..a4dafc9e 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -22,7 +22,7 @@ class AppButton extends StatefulWidget { final double? radius; final double? vPadding; final double? hPadding; - final double height; + final double? height; AppButton({ @required this.onPressed, diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 4a38bfac..5da3f232 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -11,7 +11,7 @@ class DrawerItem extends StatefulWidget { final IconData? icon; final Color? color; final String? assetLink; - final double drawerWidth; + final double? drawerWidth; DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth});