From 8284f1d475772be006da5e3ee5c5bbcb240775a9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 11:49:42 +0200 Subject: [PATCH] Fix profile widget --- .../profile/profile_medical_info_widget.dart | 146 +++++++++--------- 1 file changed, 70 insertions(+), 76 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 016b5972..8860a7dc 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,14 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; + import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; - -import 'PatientProfileButton.dart'; /* *@author: Elham Rababah @@ -45,16 +44,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), - Visibility( - visible: selectedPatientType == 6 || selectedPatientType == 7, - child: PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: PATIENT_VITAL_SIGN, - icon: 'heartbeat.png'), - ), + if(selectedPatientType == 6 || selectedPatientType == 7) + PatientProfileButton( + key: key, + patient: patient, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: PATIENT_VITAL_SIGN, + icon: 'heartbeat.png'), + if(selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -62,13 +60,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'lab.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // route: PRESCRIPTIONS, - // nameLine1: TranslationBase.of(context).medicines, - // nameLine2: TranslationBase.of(context).prescription, - // icon: 'note.png'), + PatientProfileButton( key: key, patient: patient, @@ -76,32 +68,22 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - Visibility( - visible: selectedPatientType != 0 && selectedPatientType != 5, - child: PatientProfileButton( - key: key, - patient: patient, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'heartbeat.png')), - Visibility( - visible: selectedPatientType == 6 || selectedPatientType == 7, - child: PatientProfileButton( + if (selectedPatientType != 0 && selectedPatientType != 5) + PatientProfileButton( + key: key, + patient: patient, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'heartbeat.png'), + if (selectedPatientType == 7) + PatientProfileButton( key: key, patient: patient, route: PATIENT_ADMISSION_REQUEST, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'heartbeat.png'), - ), - // PatientProfileButton( - // key: key, - // patient: patient, - // route: PATIENT_INSURANCE_APPROVALS, - // nameLine1: TranslationBase.of(context).insurance, - // nameLine2: TranslationBase.of(context).approvals, - // icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, @@ -116,42 +98,54 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: 'Order Test', nameLine2: 'Or Procedures', icon: 'lab.png'), - Visibility( - visible: selectedPatientType == 6 || selectedPatientType == 7, - child: PatientProfileButton( - key: key, - patient: patient, - route: REFER_PATIENT_TO_DOCTOR, - nameLine1: TranslationBase.of(context).myReferral, - nameLine2: TranslationBase.of(context).patient, - icon: 'note.png')), - Visibility( - visible: selectedPatientType != 0 && selectedPatientType != 5, - child: PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_ORDERS, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).list, - icon: 'radiology-1.png')), - Visibility( - visible: selectedPatientType != 0 && selectedPatientType != 5, - child: PatientProfileButton( - key: key, - patient: patient, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'sick_leaves_icons.png')), - Visibility( - visible: selectedPatientType == 6 || selectedPatientType == 7, - child: PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_UCAF_REQUEST, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'lab.png')), + if(selectedPatientType == 7) + PatientProfileButton( + key: key, + patient: patient, + route: REFER_PATIENT_TO_DOCTOR, + nameLine1: TranslationBase + .of(context) + .myReferral, + nameLine2: TranslationBase + .of(context) + .patient, + icon: 'note.png'), + if(selectedPatientType != 0 && selectedPatientType != 5) + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ORDERS, + nameLine1: TranslationBase + .of(context) + .orders, + nameLine2: TranslationBase + .of(context) + .list, + icon: 'radiology-1.png'), + if(selectedPatientType != 0 && selectedPatientType != 5) + PatientProfileButton( + key: key, + patient: patient, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase + .of(context) + .patientSick, + nameLine2: TranslationBase + .of(context) + .leave, + icon: 'sick_leaves_icons.png'), + if( selectedPatientType == 7) + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_UCAF_REQUEST, + nameLine1: TranslationBase + .of(context) + .patient, + nameLine2: TranslationBase + .of(context) + .ucaf, + icon: 'lab.png'), ]); } }