From 8dade058a4582ae8c13aae58656ec0de2fb4d26e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 26 Dec 2021 14:05:24 +0200 Subject: [PATCH] fix vital sign items --- .../patient_profile_screen.dart | 57 ++++++++++++------- .../vital_sign_item_details_screen.dart | 10 +++- 2 files changed, 45 insertions(+), 22 deletions(-) diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 0a9997e1..21c964a5 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -34,7 +34,8 @@ class PatientProfileScreen extends StatefulWidget { _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { late PatiantInformtion patient; LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); @@ -140,8 +141,10 @@ class _PatientProfileScreenState extends State with Single onModelReady: (model) async { if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient!.vcId!); - },builder: (_, model, w) => AppScaffold( - baseViewModel: model,isLoading: true, + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isLoading: true, appBarTitle: TranslationBase.of(context).patientProfile ?? "", isShowAppBar: false, body: Column( @@ -151,7 +154,7 @@ class _PatientProfileScreenState extends State with Single Column( children: [ PatientProfileAppBar( - patient, + patient, patientProfileAppBarModel: PatientProfileAppBarModel( patient: patient, videoCallDurationStream: videoCallDurationStream, @@ -191,7 +194,8 @@ class _PatientProfileScreenState extends State with Single isInpatient: isInpatient, from: from, to: to, - isDischargedPatient: isDischargedPatient, + isDischargedPatient: + isDischargedPatient, isFromSearch: isFromSearch, ) : ProfileGridForOther( @@ -214,9 +218,10 @@ class _PatientProfileScreenState extends State with Single ), if ((isInpatient && !isDischargedPatient) ? true - :isFromLiveCare - ? patient.episodeNo != null - : patient.patientStatusType != null && patient.patientStatusType == 43) + : isFromLiveCare + ? patient.episodeNo != null + : patient.patientStatusType != null && + patient.patientStatusType == 43) BaseView( onModelReady: (model) async { model.getDoctorProfile(); @@ -228,14 +233,14 @@ class _PatientProfileScreenState extends State with Single top: 180, left: 20, right: 20, - child: Row( + child: Row( children: [ Expanded(child: Container()), if (patient.episodeNo == 0) AppButton( - loading: model.state== ViewState.BusyLocal, - disabled: model.state== ViewState.BusyLocal, - + loading: model.state == ViewState.BusyLocal, + disabled: + model.state == ViewState.BusyLocal, title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", color: isFromLiveCare || isInpatient @@ -257,7 +262,8 @@ class _PatientProfileScreenState extends State with Single onPressed: () async { if ((isFromLiveCare && patient.appointmentNo != null) || - patient.patientStatusType == 43 || isInpatient ) { + patient.patientStatusType == 43 || + isInpatient) { createEpisode( patient: patient, model: model); } @@ -265,12 +271,15 @@ class _PatientProfileScreenState extends State with Single ), if (patient.episodeNo != 0) AppButton( - loading: model.state== ViewState.BusyLocal, - disabled: model.state== ViewState.BusyLocal, - + loading: + model.state == ViewState.BusyLocal, + disabled: + model.state == ViewState.BusyLocal, title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: ((isInpatient) || isFromLiveCare) && model.state!= ViewState.BusyLocal + color: ((isInpatient) || + isFromLiveCare) && + model.state != ViewState.BusyLocal ? Colors.red.shade700 : patient.patientStatusType == 43 ? Colors.red.shade700 @@ -399,7 +408,8 @@ class _PatientProfileScreenState extends State with Single : true, callConnected, callDisconnected); - }, type: ''); + }, + type: ''); } } }, @@ -418,7 +428,9 @@ class _PatientProfileScreenState extends State with Single ); } - createEpisode({required PatiantInformtion patient, required SOAPViewModel model}) async { + createEpisode( + {required PatiantInformtion patient, + required SOAPViewModel model}) async { await locator().logEvent( eventCategory: "Patient Profile", eventAction: "Create Episode", @@ -458,7 +470,12 @@ class AvatarWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], borderRadius: BorderRadius.all(Radius.circular(35.0)), color: Color(0xffCCCCCC), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index b8b8958f..dfff4756 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.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/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; @@ -190,8 +191,13 @@ class VitalSignItemDetailsScreen extends StatelessWidget { appBarTitle: pageTitle ?? "", backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - appBar: PatientProfileAppBar( - patient,), + // appBar: PatientProfileAppBar( + // patient,), + + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, + + ), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start,