From 0134e8f5deb57890943545cb930e6ed09ded5ad6 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 6 Dec 2021 10:29:07 +0200 Subject: [PATCH] small fixes inside HEADERS --- .../patient_sick_leave_screen.dart | 7 +-- .../profile/UCAF/page-stepper-widget.dart | 2 +- .../profile/UCAF/ucaf_pager_screen.dart | 8 ++- .../admission_orders_screen.dart | 6 ++- .../diabetic_chart/diabetic_chart.dart | 6 ++- .../profile/diagnosis/diagnosis_screen.dart | 6 ++- .../discharge_summary/discharge_summary.dart | 6 +-- .../all_lab_special_result_page.dart | 7 +-- .../notes/note/progress_note_screen.dart | 7 +-- .../nursing_note/nursing_note_screen.dart | 6 ++- .../operation_report/operation_report.dart | 6 ++- .../pending_orders/pending_orders_screen.dart | 5 +- .../profile/patient-profile-app-bar.dart | 51 ++++++++++++------- 13 files changed, 79 insertions(+), 44 deletions(-) diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index a1817985..70bff0cd 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.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/screens/patient-sick-leave/add_patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -40,9 +41,9 @@ class PatientSickLeaveScreen extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, + isInpatient: true, ), body: Column(children: [ patient.patientStatusType == 43 diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 8b85a492..4dea2d0c 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -136,7 +136,7 @@ class StepWidget extends StatelessWidget { height: 8, ), AppText( - stepsTitles == null + stepsTitles.isEmpty ? "${TranslationBase.of(context).step} $index" : "${stepsTitles[index - 1]}", fontWeight: FontWeight.bold, diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index f95fea71..ca44f039 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -64,7 +65,11 @@ class _UCAFPagerScreenState extends State builder: (_, model, w) => AppScaffold( isShowAppBar: true, isLoading: _isLoading, - appBar: PatientProfileAppBar(patient), + // appBar: PatientProfileAppBar(patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, + isInpatient: true, + ), appBarTitle: TranslationBase.of(context).ucaf!, body: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -99,6 +104,7 @@ class _UCAFPagerScreenState extends State stepsCount: 2, currentStepIndex: _currentIndex + 1, screenSize: screenSize, + stepsTitles: [], ), SizedBox( height: 10, diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 98936870..0a70b1f8 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -43,10 +44,11 @@ class _AdmissionOrdersScreenState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, //appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, isInpatient: true, ), + isShowAppBar: true, body: model.admissionOrderList == null || model.admissionOrderList.length == 0 ? DrAppEmbeddedError( diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index e7eca146..cab8500b 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/model/diabetic_chart/DiabeticType.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/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/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart'; @@ -66,10 +67,11 @@ class _DiabeticChartState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, isInpatient: true, ), + isShowAppBar: true, body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 640e3061..932a42b3 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -10,6 +10,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/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; @@ -71,10 +72,11 @@ class _ProgressNoteState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, isInpatient: true, ), + isShowAppBar: true, body: model.diagnosisForInPatientList == null || model.diagnosisForInPatientList.length == 0 ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index b5ab77a7..e251fcce 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.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/util/translations_delegate_base.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'; @@ -58,9 +59,8 @@ class _DoctorReplyScreenState extends State child: AppScaffold( appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: true, - // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, isInpatient: true, ), body: Column( 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 6efac930..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 @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/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/screens/patients/profile/lab_result/special_lab_result_details_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -51,9 +52,9 @@ class _AllLabSpecialResultState extends State { baseViewModel: model, backgroundColor: Colors.grey[100], isShowAppBar: true, - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, + isInpatient: true, ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), 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 f17688f5..deca73eb 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -8,6 +8,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/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; @@ -79,11 +80,11 @@ class _ProgressNoteState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, isInpatient: true, ), + isShowAppBar: true, body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( 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 472f3f85..d233e311 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 @@ -9,6 +9,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/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; @@ -73,10 +74,11 @@ class _ProgressNoteState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, isInpatient: true, ), + isShowAppBar: true, body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0 ? DrAppEmbeddedError( diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 961641e6..87352e0b 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/update_operation_report.dart'; @@ -60,10 +61,11 @@ class _ProgressNoteState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, isInpatient: true, ), + isShowAppBar: true, body: Container( color: Colors.grey[200], child: Column( 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 6fc9fb4f..1f6491c2 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/pednding_orders_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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; @@ -22,8 +23,8 @@ class PendingOrdersScreen extends StatelessWidget { return BaseView( onModelReady: (model) async {}, builder: (_, model, w) => AppScaffold( - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient: isInpatient, ), isShowAppBar: true, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 05372d81..6b287b49 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -40,7 +40,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { { this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed, - this.height, + this.height=0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, @@ -55,8 +55,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { this.episode, this.visitDate, this.clinic, - this.isAppointmentHeader}); - late PatiantInformtion localPatient; + this.isAppointmentHeader= false}); + PatiantInformtion? localPatient; @override Widget build(BuildContext context) { @@ -438,21 +438,36 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { @override Size get preferredSize => Size( double.maxFinite, - patientProfileAppBarModel!.height == 0 - ? patientProfileAppBarModel!.isAppointmentHeader! - ? 270 - : ((localPatient!.appointmentDate!.isNotEmpty) - ? patientProfileAppBarModel!.isFromLabResult! - ? 190 - : 170 - : localPatient!.admissionDate != null - ? patientProfileAppBarModel!.isFromLabResult! - ? 190 - : 170 - : patientProfileAppBarModel!.isDischargedPatient! - ? 240 - : 130) - : patientProfileAppBarModel!.height!); + height! == 0 + ? isInpatient + ? (isFromLabResult! ? 210 : 200) + : isAppointmentHeader! + ? 290 + : SizeConfig.isHeightVeryShort + ? 137 + : SizeConfig.isHeightShort + ? 190 + : SizeConfig.heightMultiplier * + (SizeConfig.isWidthLarge ? 25 : 20) + : height! + // TODO Elham*2 + // patientProfileAppBarModel!.height == 0 + // ? patientProfileAppBarModel!.isAppointmentHeader! + // ? 270 + // : ((localPatient!.appointmentDate!.isNotEmpty) + // ? patientProfileAppBarModel!.isFromLabResult! + // ? 190 + // : 170 + // : localPatient!.admissionDate != null + // ? patientProfileAppBarModel!.isFromLabResult! + // ? 190 + // : 170 + // : patientProfileAppBarModel!.isDischargedPatient! + // ? 240 + // : 130) + // : patientProfileAppBarModel!.height! + + ); } class HeaderRow extends StatelessWidget {