diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index b7e64233..56bf327c 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -405,7 +405,7 @@ class _CheckBoxListState extends State { onChanged: (newValue) { setState(() { widget.model! - .setSelectedCheckboxValues(element, newValue); + .setSelectedCheckboxValues(element, newValue!); }); }, activeColor: Color(0xFFD02127), diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 544723b7..3da6fa9a 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -166,7 +166,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn), + .createdOn!), isArabic: projectViewModel .isArabic, @@ -192,7 +192,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn)) + .createdOn!)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, @@ -214,7 +214,7 @@ class _ProgressNoteState extends State { children: [ AppText( TranslationBase.of(context) - .icd + + .icd! + " : ", fontSize: 12, ), diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index a892b7be..4b6c87d4 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -40,7 +40,7 @@ class _DischargeSummaryWidgetState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: EdgeInsets.all(15.0), @@ -52,14 +52,14 @@ class _DischargeSummaryWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ CustomRow( - label: TranslationBase.of(context).doctorName + ": ", + label: TranslationBase.of(context).doctorName! + ": ", value: widget.dischargeSummary.createdByName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).branch + ": ", + label: TranslationBase.of(context).branch! + ": ", value: widget.dischargeSummary.projectName.toString() ?? "".toString(), isCopyable: false, @@ -72,7 +72,7 @@ class _DischargeSummaryWidgetState extends State { ), CustomRow( label: - TranslationBase.of(context).dischargeDate + ": ", + TranslationBase.of(context).dischargeDate! + ": ", value: AppDateUtils.getDateTimeFromServerFormat( widget.dischargeSummary.createdOn!) .day @@ -132,7 +132,7 @@ class _DischargeSummaryWidgetState extends State { children: [ new TextSpan( text: TranslationBase.of(context) - .pastMedicalHistory + + .pastMedicalHistory! + ": ", style: TextStyle( fontSize: SizeConfig @@ -171,7 +171,7 @@ class _DischargeSummaryWidgetState extends State { children: [ new TextSpan( text: TranslationBase.of(context) - .investigation + + .investigation! + ": ", style: TextStyle( fontSize: SizeConfig @@ -211,7 +211,7 @@ class _DischargeSummaryWidgetState extends State { children: [ new TextSpan( text: TranslationBase.of(context) - .investigation + + .investigation! + ": ", style: TextStyle( fontSize: SizeConfig @@ -250,7 +250,7 @@ class _DischargeSummaryWidgetState extends State { children: [ new TextSpan( text: TranslationBase.of(context) - .planedProcedure + + .planedProcedure! + ": ", style: TextStyle( fontSize: SizeConfig diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index f5d92340..88018c4e 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -13,9 +13,8 @@ import 'all_discharge_summary.dart'; import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { - final Function changeCurrentTab; - const DischargeSummaryPage({Key ? key, this.changeCurrentTab}) + const DischargeSummaryPage({Key? key, }) : super(key: key); @override @@ -24,7 +23,7 @@ class DischargeSummaryPage extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -50,16 +49,15 @@ class _DoctorReplyScreenState extends State @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return WillPopScope( onWillPop: () async { - widget.changeCurrentTab(); return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: true, patientProfileAppBarModel: PatientProfileAppBarModel( patient:patient, @@ -98,12 +96,12 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 0, - TranslationBase.of(context).pending, + TranslationBase.of(context).pending!, ), tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all, + TranslationBase.of(context).all!, ), ], ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 2deb1dd5..aca2c27e 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -9,10 +9,9 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; final PatiantInformtion patient; - const PendingDischargeSummary({Key ? key, this.changeCurrentTab, this.patient}) + const PendingDischargeSummary({Key? key, required this.patient}) : super(key: key); @override @@ -29,17 +28,16 @@ class _PendingDischargeSummaryState extends State { onModelReady: (model) { model.getPendingDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), ); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, body: model.pendingDischargeSummaryList.isEmpty - ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable), - ) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ? ErrorMessage( + error: TranslationBase.of(context) + .noDataAvailable!) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index be863b87..7e344990 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -20,7 +20,7 @@ class FlowChartPage extends StatelessWidget { final bool isInpatient; FlowChartPage( - {this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); + {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart index 118bc476..4a23710f 100644 --- a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart +++ b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart @@ -14,7 +14,7 @@ class LabResultHistoryPage extends StatelessWidget { final String filterName; final PatiantInformtion patient; - LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient}); + LabResultHistoryPage({required this.patientLabOrder, required this.filterName, required this.patient}); // TODO mosa UI changes @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index c0d3d6b6..e5fc4475 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -21,14 +21,14 @@ class LabResultWidget extends StatelessWidget { final bool isInpatient; LabResultWidget( - {Key ? key, - this.filterName, - this.patientLabResultList, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key? key, + required this.filterName, + required this.patientLabResultList, + required this.patientLabOrder, + required this.patient, + required this.isInpatient}) : super(key: key); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -222,7 +222,7 @@ class LabResultWidget extends StatelessWidget { FadePage( page: FlowChartPage( filterName: - patientLabResultList[index].description, + patientLabResultList[index].description!, patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient, diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 697d16d2..764cef34 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultDetailsWidget extends StatefulWidget { final List labResult; LabResultDetailsWidget({ - this.labResult, + required this.labResult, }); @override diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart index 490d0ec4..7eb168a1 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { final List labResultHistory; LabResultHistoryDetailsWidget({ - this.labResultHistory, + required this.labResultHistory, }); @override @@ -72,7 +72,7 @@ class _VitalSignDetailsWidgetState extends State ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -85,7 +85,7 @@ class _VitalSignDetailsWidgetState extends State List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResultHistory.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); tableRow.add(TableRow(children: [ Container( child: Container( diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index e9dfe476..45ded281 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -15,24 +15,24 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AllLabSpecialResult extends StatefulWidget { - const AllLabSpecialResult({Key key}) : super(key: key); + const AllLabSpecialResult({Key? key}) : super(key: key); @override _AllLabSpecialResultState createState() => _AllLabSpecialResultState(); } class _AllLabSpecialResultState extends State { - String patientType; + late String patientType; - String arrivalType; - PatiantInformtion patient; - bool isInpatient; - bool isFromLiveCare; + late String arrivalType; + late PatiantInformtion patient; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -47,7 +47,7 @@ class _AllLabSpecialResultState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - model.getAllSpecialLabResult(patientId: patient.patientMRN), + model.getAllSpecialLabResult(patientId: patient!.patientMRN!), builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -72,9 +72,9 @@ class _AllLabSpecialResultState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).special + + TranslationBase.of(context).special! + " " + - TranslationBase.of(context).lab, + TranslationBase.of(context).lab!, style: "caption2", color: Colors.black, fontSize: 13, @@ -111,10 +111,10 @@ class _AllLabSpecialResultState extends State { height: 160, decoration: BoxDecoration( color: model.allSpecialLabList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? Colors.red[900] : !model.allSpecialLabList[index] - .isInOutPatient + .isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -136,17 +136,17 @@ class _AllLabSpecialResultState extends State { child: Center( child: Text( model.allSpecialLabList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? TranslationBase.of(context) - .liveCare + .liveCare! .toUpperCase() : !model.allSpecialLabList[index] - .isInOutPatient + .isInOutPatient! ? TranslationBase.of(context) - .inPatientLabel + .inPatientLabel! .toUpperCase() : TranslationBase.of(context) - .outpatient + .outpatient! .toUpperCase(), style: TextStyle(color: Colors.white), ), @@ -160,21 +160,21 @@ class _AllLabSpecialResultState extends State { FadePage( page: SpecialLabResultDetailsPage( resultData: model.allSpecialLabList[index] - .resultDataHTML, + .resultDataHTML!, patient: patient, ), ), ), doctorName: - model.allSpecialLabList[index].doctorName, + model.allSpecialLabList[index].doctorName!, invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}', profileUrl: model - .allSpecialLabList[index].doctorImageURL, + .allSpecialLabList[index].doctorImageURL!, branch: - model.allSpecialLabList[index].projectName, - clinic: model - .allSpecialLabList[index].clinicDescription, + model.allSpecialLabList[index].projectName!, + clinic: model.allSpecialLabList[index] + .clinicDescription!, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( model.allSpecialLabList[index].createdOn, diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index d8303cd9..04bea7ac 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -11,9 +11,9 @@ import 'Lab_Result_details_wideget.dart'; class LabResultChartAndDetails extends StatelessWidget { LabResultChartAndDetails({ - Key ? key, - @required this.labResult, - @required this.name, + Key? key, + required this.labResult, + required this.name, }) : super(key: key); final List labResult; diff --git a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart index 4b9ffa44..fdf95b2c 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart @@ -9,9 +9,9 @@ import 'LineChartCurvedLabHistory.dart'; class LabResultHistoryChartAndDetails extends StatelessWidget { LabResultHistoryChartAndDetails({ - Key ? key, - @required this.labResultHistory, - @required this.name, + Key? key, + required this.labResultHistory, + required this.name, }) : super(key: key); final List labResultHistory; diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index 4c67f9ed..37af7382 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; class LabResult extends StatefulWidget { final LabOrdersResModel labOrders; - LabResult({Key ? key, this.labOrders}); + LabResult({Key? key, required this.labOrders}); @override _LabResultState createState() => _LabResultState(); @@ -27,10 +27,9 @@ class _LabResultState extends State { onModelReady: (model) => model.getLabResult(widget.labOrders), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).labOrders, + appBarTitle: TranslationBase.of(context).labOrders ?? "", body: model.labResultList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoLabOrders) + ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoLabOrders ?? "") : Container( margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), 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 84465b20..c8555069 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -17,12 +18,12 @@ class LaboratoryResultPage extends StatefulWidget { final bool isInpatient; LaboratoryResultPage( - {Key ? key, - this.patientLabOrders, - this.patient, - this.patientType, - this.arrivalType, - this.isInpatient}); + {Key? key, + required this.patientLabOrders, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.isInpatient}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -33,16 +34,14 @@ class _LaboratoryResultPageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - isInpatient: true), + patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBar: PatientProfileAppBar( - widget.patient, - isInpatient:widget.isInpatient, - isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: widget.patient, + isInpatient: widget.isInpatient, + isFromLabResult: true, + appointmentDate: widget.patientLabOrders.orderDate!, ), baseViewModel: model, @@ -51,11 +50,10 @@ class _LaboratoryResultPageState extends State { body: SingleChildScrollView( child: LaboratoryResultWidget( onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult.length > 0 - ? model.patientLabSpecialResult[0].resultDataHTML - : null, - orderNo: widget.patientLabOrders.orderNo, + billNo: widget.patientLabOrders.invoiceNo!, + details: + model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML : null, + orderNo: widget.patientLabOrders.orderNo!, patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: widget.patientType == "1", diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 0da094ab..96ae6ed9 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -18,21 +18,21 @@ import 'package:provider/provider.dart'; class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; - final String details; + final String? details; final String orderNo; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; final bool isInpatient; const LaboratoryResultWidget( - {Key ? key, - this.onTap, - this.billNo, - this.details, - this.orderNo, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key? key, + required this.onTap, + required this.billNo, + required this.details, + required this.orderNo, + required this.patientLabOrder, + required this.patient, + required this.isInpatient}) : super(key: key); @override @@ -42,7 +42,7 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; bool _isShowMore = true; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -158,13 +158,13 @@ class _LaboratoryResultWidgetState extends State { else if (widget.details == null) Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, + error: TranslationBase.of(context).noDataAvailable!, ), ), SizedBox( height: 15, ), - if (widget.details != null && widget.details.isNotEmpty) + if (widget.details != null && widget.details!.isNotEmpty) Column( children: [ InkWell( @@ -223,7 +223,7 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: !Helpers.isTextHtml(widget.details) + child: !Helpers.isTextHtml(widget.details!) ? AppText( widget.details ?? TranslationBase.of(context) diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index 014015a0..e338635a 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget { final String resultData; final PatiantInformtion patient; - const SpecialLabResultDetailsPage({Key ? key, this.resultData, this.patient}) : super(key: key); + const SpecialLabResultDetailsPage({Key? key, required this.resultData, required this.patient}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index b9a3f09f..c76b82aa 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -14,13 +14,13 @@ import 'package:html_editor_enhanced/html_editor.dart'; import 'package:permission_handler/permission_handler.dart'; class AddVerifyMedicalReport extends StatefulWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final MedicalReportModel medicalReport; - final PatientMedicalReportViewModel model; - final MedicalReportStatus status; - final String medicalNote; + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final MedicalReportModel? medicalReport; + final PatientMedicalReportViewModel? model; + final MedicalReportStatus? status; + final String? medicalNote; const AddVerifyMedicalReport( {Key? key, @@ -38,6 +38,7 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { + HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { String txtOfMedicalReport; @@ -50,8 +51,8 @@ class _AddVerifyMedicalReportState extends State { baseViewModel: model, isShowAppBar: true, appBarTitle: widget.status == MedicalReportStatus.ADD - ? TranslationBase.of(context).medicalReportAdd - : TranslationBase.of(context).medicalReportVerify, + ? TranslationBase.of(context).medicalReportAdd! + : TranslationBase.of(context).medicalReportVerify!, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: Column( children: [ @@ -68,13 +69,26 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: (widget.medicalReport != null + initialText: (widget.medicalReport != + null ? widget.medicalNote - : widget.model.medicalReportTemplate[0].templateText.length > 0 - ? widget.model.medicalReportTemplate[0].templateText + : widget + .model! + .medicalReportTemplate[ + 0] + .templateText! + .length > + 0 + ? widget + .model! + .medicalReportTemplate[0] + .templateText : ""), hint: "Write the medical report ", - height: MediaQuery.of(context).size.height * 0.75, + height: + MediaQuery.of(context).size.height * + 0.75, + controller: _controller, ), ], ), @@ -100,64 +114,77 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); + txtOfMedicalReport = await _controller.getText(); - if (txtOfMedicalReport.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); + if (txtOfMedicalReport.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + widget.medicalReport != null + ? await widget.model!.updateMedicalReport( + widget.patient!, + txtOfMedicalReport, widget.medicalReport != null - ?await widget.model.updateMedicalReport( - widget.patient, - txtOfMedicalReport, - widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, - widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) - : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); - //model.getMedicalReportList(patient); + ? widget.medicalReport!.lineItemNo! + : '', + widget.medicalReport != null + ? widget.medicalReport!.invoiceNo! + : '') + : await widget.model!.addMedicalReport( + widget.patient!, txtOfMedicalReport); + //model.getMedicalReportList(patient); - Navigator.pop(context); + Navigator.pop(context); - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); - } - } else { - DrAppToastMsg.showErrorToast("Please enter medical note"); + GifLoaderDialogUtils.hideDialog(context); + if (widget.model!.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model!.error); + } + } else { + DrAppToastMsg.showErrorToast( + "Please enter medical note"); + } + }, + ), + ), + SizedBox( + width: 8, + ), + if (widget.medicalReport != null) + Expanded( + child: AppButton( + title: widget.status == MedicalReportStatus.ADD + ? TranslationBase.of(context).add + : TranslationBase.of(context).verify, + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + txtOfMedicalReport = + await _controller.getText(); + if (txtOfMedicalReport.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.model!.verifyMedicalReport( + widget.patient!, widget.medicalReport!); + GifLoaderDialogUtils.hideDialog(context); + Navigator.pop(context); + if (widget.model!.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model!.error); } - }, - ), - ), - SizedBox( - width: 8, + } else { + DrAppToastMsg.showErrorToast( + "Please enter medical note"); + } + }, ), - if (widget.medicalReport != null) - Expanded( - child: AppButton( - title: widget.status == MedicalReportStatus.ADD - ? TranslationBase.of(context).add - : TranslationBase.of(context).verify, - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); - if (txtOfMedicalReport.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport); - GifLoaderDialogUtils.hideDialog(context); - Navigator.pop(context); - if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); - } - } else { - DrAppToastMsg.showErrorToast("Please enter medical note"); - } - }, - ), - ), - ], - ), - ), - ], + ), + ], + ), ), - )); + ], + ), + )); } void requestPermissions() async { diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index ab24f8e0..c22511af 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -20,7 +20,7 @@ class MedicalReportDetailPage extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index bb03a9bc..92bae5bb 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -34,7 +35,7 @@ class MedicalReportPage extends StatefulWidget { class _MedicalReportPageState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -49,9 +50,8 @@ class _MedicalReportPageState extends State { baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileAppBar( - patient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( @@ -85,22 +85,21 @@ class _MedicalReportPageState extends State { await locator().logEvent( eventCategory: "Medical Report Page", eventAction: "Add New Medical Report", - ); - Navigator.push( + );Navigator.push( context, MaterialPageRoute( builder: (context) => AddVerifyMedicalReport( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - model: model, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + model: model, status: MedicalReportStatus.ADD, - ), + ), settings: RouteSettings(name: 'AddVerifyMedicalReport'), ), ); }, - label: TranslationBase.of(context).createNewMedicalReport, + label: TranslationBase.of(context).createNewMedicalReport!, ), // if (model.state != ViewState.ErrorLocal)ß ...List.generate( @@ -191,8 +190,8 @@ class _MedicalReportPageState extends State { margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), child: LargeAvatar( name: projectViewModel.isArabic - ? model.medicalReportList[index].doctorNameN - : model.medicalReportList[index].doctorName, + ? model.medicalReportList[index].doctorNameN??"" + : model.medicalReportList[index].doctorName??"", url: model.medicalReportList[index].doctorImageURL, ), width: 50, diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index 1794a741..5fe9b4b4 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; @@ -35,22 +34,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { final int visitType; - const ProgressNoteScreen({Key ? key, this.visitType}) : super(key: key); + const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, - {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -59,15 +57,12 @@ class _ProgressNoteState extends State { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( visitType: widget.visitType, // if equal 5 then this will return progress note - admissionNo: int.parse(patient!.admissionNo!), + admissionNo: int.parse(patient.admissionNo ?? ""), projectID: patient.projectId, tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model - .getPatientProgressNote(progressNoteRequest.toJson(), - isLocalBusy: isLocalBusy) - .then((c) { + model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { notesList = model.patientProgressNoteList; }); } @@ -76,11 +71,10 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; - if (routeArgs.containsKey('isDischargedPatient')) - isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), builder: (_, model, w) => AppScaffold( @@ -92,578 +86,473 @@ class _ProgressNoteState extends State { ), isShowAppBar: true, body: model.patientProgressNoteList == null || - model.patientProgressNoteList.length == 0 + model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).errorNoProgressNote!) : Container( - color: Colors.grey[200], - child: Column( - children: [ - if (!isDischargedPatient) - AddNewOrder( - onTap: () async { - await locator().logEvent( - eventCategory: "Progress Note Screen", - eventAction: "Update Progress Note", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - ), - settings: RouteSettings(name: 'UpdateNoteOrder'), - ), - ); - }, - label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet - : TranslationBase.of(context).addProgressNote, + color: Colors.grey[200], + child: Column( + children: [ + if (!isDischargedPatient) + AddNewOrder( + onTap: () async { + await locator().logEvent( + eventCategory: "Progress Note Screen", + eventAction: "Update Progress Note", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + ), + settings: RouteSettings(name: 'UpdateNoteOrder'), ), - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index] - .status == - 1 && - authenticationViewModel - .doctorProfile!.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy - ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index] - .status == - 4 - ? Colors.red.shade700 - : model.patientProgressNoteList[index] - .status == - 2 - ? AppGlobal.appGreenColor - : Color(0xFFCC9B14), - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model - .patientProgressNoteList[ - index] - .status == - 1 && - authenticationViewModel - .doctorProfile!.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy) - AppText( + ); + }, + label: widget.visitType == 3 + ? TranslationBase.of(context).addNewOrderSheet! + : TranslationBase.of(context).addProgressNote!, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authenticationViewModel + .doctorProfile!.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index] + .status == + 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index] + .status == + 2 + ? Colors.green[600]! + : Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authenticationViewModel + .doctorProfile!.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( - TranslationBase.of(context) - .notePending, + TranslationBase.of(context) + .notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model - .patientProgressNoteList[ - index] - .status == - 4) - AppText( - TranslationBase.of(context) - .noteCanceled, - fontWeight: FontWeight.bold, - color: Colors.red.shade700, - fontSize: 12, - ), - if (model - .patientProgressNoteList[ - index] - .status == - 2) - AppText( - TranslationBase.of(context) - .noteVerified, - fontWeight: FontWeight.bold, - color: AppGlobal.appGreenColor, - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status != 2 && - model - .patientProgressNoteList[ - index] - .status != - 4 && - authenticationViewModel - .doctorProfile!.doctorID == - model - .patientProgressNoteList[ - index] - .createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - note: model - .patientProgressNoteList[ - index], - patientModel: - model, - patient: - patient, - visitType: widget - .visitType, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 4) + AppText( + TranslationBase.of(context) + .noteCanceled, + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 2) + AppText( + TranslationBase.of(context) + .noteVerified, + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status != 2 && + model + .patientProgressNoteList[ + index] + .status != + 4 && + authenticationViewModel + .doctorProfile!.doctorID == + model + .patientProgressNoteList[ + index] + .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + note: model + .patientProgressNoteList[ + index], + patientModel: + model, + patient: + patient, + visitType: widget + .visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .update, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "verify", - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: - false, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, - verifiedNote: true, - patientTypeID: - patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: AppGlobal.appGreenColor, - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - FontAwesomeIcons - .check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .noteVerify, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + SizedBox( + width: 2, ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: - TranslationBase.of( - context) - .cancel, - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context, - ); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: true, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, - verifiedNote: false, - patientTypeID: - patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - FontAwesomeIcons - .trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + AppText( + TranslationBase.of(context).update, + fontSize: 10, + color: Colors.white, ), - ), - SizedBox( - width: 10, - ) - ], + ], + ), + padding: EdgeInsets.all(6), ), + ), SizedBox( - height: 10, + width: 10, ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .createdBy, - fontSize: 10, - ), - Expanded( - child: AppText( - model - .patientProgressNoteList[ - index] - .doctorName ?? - '', - fontWeight: - FontWeight.w600, - fontSize: 12, - isCopyable:true, - ), - ), - ], - ), - ], - ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: false, + lineItemNo: + model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: true, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: BorderRadius.circular(10), ), - Column( + // color:Colors.red[600], + + child: Row( children: [ - AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .patientProgressNoteList[ - index] - .createdOn), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - isCopyable:true, + Icon( + FontAwesomeIcons.check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, ), AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils - .getDateTimeFromServerFormat(model - .patientProgressNoteList[ - index] - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - isCopyable:true, + TranslationBase.of(context).noteVerify, + fontSize: 10, + color: Colors.white, ), ], - crossAxisAlignment: - CrossAxisAlignment.end, - ) - ], + ), + padding: EdgeInsets.all(6), + ), ), SizedBox( - height: 8, + width: 10, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model - .patientProgressNoteList[ - index] - .notes, + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: TranslationBase.of(context).cancel!, + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog( + context, + ); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: true, + lineItemNo: + model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: false, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + FontAwesomeIcons.trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', fontSize: 10, - isCopyable:true, + color: Colors.white, ), - ), - ]) + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ) ], ), - SizedBox( - height: 20, + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model.patientProgressNoteList[index].doctorName ?? '', + fontWeight: FontWeight.w600, + fontSize: 12, + isCopyable:true,), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? ""), + isArabic: projectViewModel.isArabic, + isMonthShort: true): AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), + isArabic: projectViewModel.isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable:true,), + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getHour( + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14,isCopyable:true, + ), + ], + crossAxisAlignment: CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + child: AppText( + model.patientProgressNoteList[index].notes, + fontSize: 10,isCopyable:true, + ), ), - ], - ), + ]) + ], ), - ); - }), - ), - ), - ], + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), ), ), + ], + ), + ), ), ); } - showMyDialog({BuildContext context, Function confirmFun, String actionName}) { + showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { showDialog( context: context, builder: (ctx) => Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.8, - height: 200, - child: AppScaffold( - isShowAppBar: false, - body: Container( - color: Colors.white, - child: Center( - child: Column( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 200, + child: AppScaffold( + isShowAppBar: false, + body: Container( + color: Colors.white, + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // SizedBox(height: 20,), + SizedBox( + height: 10, + ), + Row( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ - // SizedBox(height: 20,), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), - ], - ), - SizedBox( - height: 10, - ), - DividerWithSpacesAround(), - SizedBox( - height: 12, + AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, ), + ], + ), + SizedBox( + height: 10, + ), + DividerWithSpacesAround(), + SizedBox( + height: 12, + ), - Container( - padding: EdgeInsets.all(20), - color: Colors.white, - child: AppText( - projectViewModel.isArabic - ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" - : 'Are you sure you want $actionName this order?', - fontSize: 15, - textAlign: TextAlign.center, - ), - ), + Container( + padding: EdgeInsets.all(20), + color: Colors.white, + child: AppText( + projectViewModel.isArabic + ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" + : 'Are you sure you want $actionName this order?', + fontSize: 15, + textAlign: TextAlign.center, + ), + ), - SizedBox( - height: 8, - ), - DividerWithSpacesAround(), - FractionallySizedBox( - widthFactor: 0.75, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - FlatButton( - child: AppText( - TranslationBase.of(context).cancel, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), //Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }), - FlatButton( - child: AppText( - TranslationBase.of(context).noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.red.shade700, - fontSize: 16, - ), //Text("Confirm", ), - onPressed: () async { - await confirmFun(); - Navigator.of(context).pop(); - }) - ], - ), - ) - ], + SizedBox( + height: 8, ), - ), + DividerWithSpacesAround(), + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FlatButton( + child: AppText( + TranslationBase.of(context).cancel, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), //Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16, + ), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) + ], + ), + ) + ], ), ), ), - )); + ), + ), + )); } } diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index 82baf0da..300c9560 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -28,19 +28,19 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateNoteOrder extends StatefulWidget { - final NoteModel note; + final NoteModel? note; final PatientViewModel patientModel; final PatiantInformtion patient; final int visitType; final bool isUpdate; const UpdateNoteOrder( - {Key ? key, + {Key? key, this.note, - this.patientModel, - this.patient, - this.visitType, - this.isUpdate}) + required this.patientModel, + required this.patient, + required this.visitType, + required this.isUpdate}) : super(key: key); @override @@ -48,12 +48,12 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { - int selectedType; + int? selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + ProjectViewModel? projectViewModel; TextEditingController progressNoteController = TextEditingController(); @@ -81,7 +81,7 @@ class _UpdateNoteOrderState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note.notes; + progressNoteController.text = widget.note!.notes!; } return AppScaffold( @@ -99,12 +99,12 @@ class _UpdateNoteOrderState extends State { title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).progressNote!, ), SizedBox( height: 10.0, @@ -119,17 +119,13 @@ class _UpdateNoteOrderState extends State { AppTextFieldCustom( hintText: widget.visitType == 3 ? (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).progressNote!, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -144,11 +140,8 @@ class _UpdateNoteOrderState extends State { : null, ), Positioned( - top: - -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + top: -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel!.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( @@ -195,12 +188,12 @@ class _UpdateNoteOrderState extends State { title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? TranslationBase.of(context).noteUpdate! + : TranslationBase.of(context).noteAdd!) + + TranslationBase.of(context).progressNote!, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -219,8 +212,8 @@ class _UpdateNoteOrderState extends State { UpdateNoteReqModel reqModel = UpdateNoteReqModel( admissionNo: int.parse(widget.patient!.admissionNo!), cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, + lineItemNo: widget.note!.lineItemNo, + createdBy: widget.note?.createdBy, notes: progressNoteController.text, verifiedNote: false, patientTypeID: widget.patient.patientType, diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index fa37e9e0..5acd1926 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -32,22 +32,22 @@ import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class NursingProgressNoteScreen extends StatefulWidget { - const NursingProgressNoteScreen({Key key}) : super(key: key); + const NursingProgressNoteScreen({Key? key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -55,7 +55,7 @@ class _ProgressNoteState extends State { GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel( admissionNo: int.parse(patient!.admissionNo!), - patientTypeID: patient.patientType, + patientTypeID: patient!.patientType!, patientID: patient.patientId, setupID: "010266"); model.getNursingProgressNote(getNursingProgressNoteRequestModel); @@ -65,7 +65,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -168,8 +168,8 @@ class _ProgressNoteState extends State { AppDateUtils .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ - index] - .createdOn), + index]! + .createdOn!), isArabic: projectViewModel .isArabic, @@ -194,8 +194,8 @@ class _ProgressNoteState extends State { AppDateUtils .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ - index] - .createdOn)) + index]! + .createdOn!)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index d93117c8..b67f3583 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -43,22 +43,22 @@ class OperationReportScreen extends StatefulWidget { } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( - onModelReady: (model) => model.getReservations(patient.patientMRN), + onModelReady: (model) => model.getReservations(patient!.patientMRN!), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index dd2a4d8f..e4eac5ab 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -134,7 +134,7 @@ class _UpdateOperationReportState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: BottomSheetTitle( - title: TranslationBase.of(context).operationReports, + title: TranslationBase.of(context).operationReports!, ), body: SingleChildScrollView( child: Container( @@ -523,8 +523,8 @@ class _UpdateOperationReportState extends State { child: AppButton( title: (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) +" "+ - TranslationBase.of(context).operationReports, + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).operationReports!, color: Color(0xff359846), // disabled: operationReportsController.text.isEmpty, fontWeight: FontWeight.w700, diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index 0909376d..a3eef424 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -36,7 +36,7 @@ class PendingOrdersScreen extends StatelessWidget { model.pendingOrdersList.length == 0 ? Center( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, ), + error: TranslationBase.of(context).noDataAvailable!, ), ) : Column( children: [ diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index ca8be2c0..7df00041 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -17,10 +17,10 @@ class InpatientPrescriptionDetailsScreen extends StatefulWidget { class _InpatientPrescriptionDetailsScreenState extends State { bool _showDetails = false; - String error; - TextEditingController answerController; + String? error; + TextEditingController? answerController; bool _isInit = true; - PrescriptionReportForInPatient prescription; + late PrescriptionReportForInPatient prescription; @override void initState() { @@ -31,7 +31,7 @@ class _InpatientPrescriptionDetailsScreenState void didChangeDependencies() { super.didChangeDependencies(); if (_isInit) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; prescription = routeArgs['prescription']; } _isInit = false; @@ -40,7 +40,7 @@ class _InpatientPrescriptionDetailsScreenState @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionInfo, + appBarTitle: TranslationBase.of(context).prescriptionInfo ?? "", body: CardWithBgWidgetNew( widget: Container( child: ListView( @@ -96,11 +96,11 @@ class _InpatientPrescriptionDetailsScreenState key: 'UOM'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.startDatetime)}', + '${AppDateUtils.getDate(prescription.startDatetime!)}', key: 'Start Date'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.stopDatetime)}', + '${AppDateUtils.getDate(prescription.stopDatetime!)}', key: 'Stop Date'), buildTableRow( des: '${prescription.noOfDoses}', @@ -115,7 +115,7 @@ class _InpatientPrescriptionDetailsScreenState key: 'Pharmacy Remarks'), buildTableRow( des: - '${AppDateUtils.getDate(prescription.prescriptionDatetime)}', + '${AppDateUtils.getDate(prescription.prescriptionDatetime!)}', key: 'Prescription Date'), buildTableRow( des: '${prescription.refillID}', diff --git a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart index ebc6ac0a..75300769 100644 --- a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart +++ b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsItem extends StatefulWidget { final PrescriptionReport prescriptionReport; - OutPatientPrescriptionDetailsItem({Key? key, this.prescriptionReport}); + OutPatientPrescriptionDetailsItem({Key? key, required this.prescriptionReport}); @override _OutPatientPrescriptionDetailsItemState createState() => diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index e4351d91..9af68ead 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -8,12 +8,12 @@ class PatientProfileCardModel { final bool isInPatient; final bool isDisable; final bool isLoading; - final Function onTap; + final GestureTapCallback? onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData dartIcon; - final Color color; + final IconData? dartIcon; + final Color? color; PatientProfileCardModel( this.nameLine1, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 142efba6..2de6c04c 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -36,14 +36,14 @@ class ProfileGridForInPatient extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel( - TranslationBase.of(context).vital , - TranslationBase.of(context).signs , + TranslationBase.of(context).vital ?? "", + TranslationBase.of(context).signs ?? "", VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab , - TranslationBase.of(context).result , + TranslationBase.of(context).lab ?? "", + TranslationBase.of(context).result ?? "", LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), @@ -54,116 +54,116 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).result, + TranslationBase.of(context).radiology!, + TranslationBase.of(context).result!, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/Radiology.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, + TranslationBase.of(context).patient!, + TranslationBase.of(context).prescription!, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).progress, - TranslationBase.of(context).note, + TranslationBase.of(context).progress!, + TranslationBase.of(context).note!, PROGRESS_NOTE, 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( - TranslationBase.of(context).order, - TranslationBase.of(context).sheet, + TranslationBase.of(context).order!, + TranslationBase.of(context).sheet!, ORDER_NOTE, 'assets/images/svgs/profile_screen/order sheets.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, + TranslationBase.of(context).orders!, + TranslationBase.of(context).procedures!, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, + TranslationBase.of(context).health!, + TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).medical, - TranslationBase.of(context).report, + TranslationBase.of(context).medical!, + TranslationBase.of(context).report!, PATIENT_MEDICAL_REPORT, 'assets/images/svgs/profile_screen/medical report.svg', isInPatient: isInpatient, isDisable: false), PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context).referral!, + TranslationBase.of(context).patient!, REFER_IN_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).approvals, + TranslationBase.of(context).insurance!, + TranslationBase.of(context).approvals!, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).discharge, - TranslationBase.of(context).report, + TranslationBase.of(context).discharge!, + TranslationBase.of(context).report!, DISCHARGE_SUMMARY, 'assets/images/svgs/profile_screen/discharge summary.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context).patientSick!, + TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).operation, - TranslationBase.of(context).report, + "Operation", + "Report", GET_OPERATION_REPORT, 'assets/images/svgs/profile_screen/operating report.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).pending, - TranslationBase.of(context).orders, + TranslationBase.of(context).pending!, + TranslationBase.of(context).orders!, PENDING_ORDERS, 'assets/images/svgs/profile_screen/pending orders.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).orders, + TranslationBase.of(context).admission!, + TranslationBase.of(context).orders!, ADMISSION_ORDERS, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, ), PatientProfileCardModel( "Nursing", - TranslationBase.of(context).progressNote, + TranslationBase.of(context).progressNote!, NURSING_PROGRESS_NOTE, 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).diagnosis, + TranslationBase.of(context).diagnosis!, "", DIAGNOSIS_FOR_IN_PATIENT, 'assets/images/svgs/profile_screen/diagnosis.svg', isInPatient: isInpatient, ), PatientProfileCardModel( - TranslationBase.of(context).diabetic, - TranslationBase.of(context).chart, + TranslationBase.of(context).diabetic!, + TranslationBase.of(context).chart!, DIABETIC_CHART_VALUES, 'assets/images/svgs/profile_screen/diabetic chart.svg', isInPatient: isInpatient,