From fbd0143d50aeb53ed790984cd957898acb337388 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Wed, 1 Jan 2025 10:56:05 +0300 Subject: [PATCH] WD: Displayed Allergy status along side its name. --- lib/config/localized_values.dart | 1 + .../allergies/update_allergies_widget.dart | 23 +++++++++++++++---- .../widgets/SoapDetailItem.dart | 17 ++++++++++---- .../translations_delegate_base_utils.dart | 1 + 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index fca9679f..10f97042 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1225,6 +1225,7 @@ const Map> localizedValues = { "ar": "هل أنت متأكد من أنك تريد حذف التشخيص" }, "activate": {"en": "Activate", "ar":"فعل"}, + "stable": {"en": "Stable", "ar":"مستقر"}, "resolved": {"en": "Resolved", "ar":"تم الحل"}, "diagnosisAlreadyDeleted": {"en": "Diagnosis Already Deleted", "ar":"تم حذف التشخيص بالفعل"}, "diagnosisAlreadyResolved": {"en": "Diagnosis Already Resolved", "ar":"تم حل التشخيص بالفعل"}, diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart index 82c6a943..755e49a6 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_al import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/allergies/reactions_selection.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; @@ -102,11 +103,23 @@ class _UpdateAllergiesWidgetState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - selectedAllergy.allergyName!, - fontSize: 12, - fontWeight: FontWeight.w800, - letterSpacing: -0.48, + Row( + children: [ + Expanded( + child: AppText( + selectedAllergy.allergyName!, + fontSize: 12, + fontWeight: FontWeight.w800, + letterSpacing: -0.48, + ), + ), + SizedBox( + width: 8, + ), + Status( + status: (selectedAllergy.isActivePatientsAllergy == true ) ? TranslationBase.of(context).active : TranslationBase.of(context).resolved, + ) + ], ), selectedAllergy.patientsAllergyReactionsDTOs! .isNotEmpty && diff --git a/lib/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart b/lib/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart index d4d9a4b0..26b2d8f2 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart @@ -204,16 +204,23 @@ class Status extends StatelessWidget { borderRadius: BorderRadius.circular(3), ), // color: Color(0xFF359846), - color: (status.toLowerCase() == 'active' || - status.toLowerCase() == 'stable') + color: (status.toLowerCase() == + TranslationBase.of(context).active.toLowerCase() || + status.toLowerCase() == + TranslationBase.of(context).stable.toLowerCase()) ? Color(0xFFD8E8DB) - : Color(0x98d02127), + : (status.toLowerCase() == + TranslationBase.of(context).resolved.toLowerCase()) + ? Colors.lightBlue + : Color(0x98d02127), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6), child: AppText( status, - color: (status.toLowerCase() == 'active' || - status.toLowerCase() == 'stable') + color: (status.toLowerCase() == + TranslationBase.of(context).active.toLowerCase() || + status.toLowerCase() == + TranslationBase.of(context).stable.toLowerCase()) ? Color(0xFF359846) : Colors.white, fontSize: 8, diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index 3fa6f0c4..eba08a2a 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -1185,6 +1185,7 @@ class TranslationBase { localizedValues['onlyOfftimeHoliday']![locale.languageCode]!; String get active => localizedValues['active']![locale.languageCode]!; + String get stable => localizedValues['stable']![locale.languageCode]!; String get hold => localizedValues['hold']![locale.languageCode]!;