From d2bd3b68e1c53e004b27313c57b8cd3954adc819 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 15:32:42 +0300 Subject: [PATCH] small fix on history --- lib/config/localized_values.dart | 6 +- lib/util/translations_delegate_base.dart | 2 + .../soap_update/expandable_SOAP_widget.dart | 2 +- .../subjective/update_allergies_widget.dart | 95 +++++++++++-------- .../subjective/update_history_widget.dart | 50 +++++++--- 5 files changed, 100 insertions(+), 55 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 980a2e9b..31487256 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -824,8 +824,12 @@ const Map> localizedValues = { "accepted": {"en": "Accepted", "ar": "وافقت"}, "cancelled": {"en": "Cancelled", "ar": "ألغيت"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, - "replied": {"en": "Replied", "ar": " تم الرد"},"typeHereToReply": { + "replied": {"en": "Replied", "ar": " تم الرد"}, + "typeHereToReply": { "en": "Type here to reply", "ar": "اكتب هنا للرد" + },"remove": { + "en": "Remove", + "ar": "حذف" }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 243f742e..9a2e1b71 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1205,6 +1205,8 @@ class TranslationBase { String get unReplied => localizedValues['unReplied'][locale.languageCode]; String get replied => localizedValues['replied'][locale.languageCode]; String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; + String get remove => localizedValues['remove'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart index 57eb065b..5a0bcd8e 100644 --- a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart +++ b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart @@ -37,7 +37,7 @@ class ExpandableSOAPWidget extends StatelessWidget { children: [ Texts(headerTitle, variant: isExpanded ? "bodyText" : '', - bold: isExpanded ? true : false, + // bold: isExpanded ? true : false, fontSize: 15, color: Colors.black), Icon( diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index afd14809..c00daa6b 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -1,5 +1,4 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -17,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dar import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../custom_validation_error.dart'; @@ -41,21 +41,21 @@ class _UpdateAllergiesWidgetState extends State { margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hintText: TranslationBase.of(context).addAllergies, + borderColor: HexColor('#707070'), + borderWidth: 0.30, fontSize: 13.5, + borderRadius: 12, onTapTextFields: () { openAllergiesList(context); }, readOnly: true, - // hintColor: Colors.black, suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, + suffixIconColor: Color(0xFF2B353E), fontWeight: FontWeight.w600, // controller: messageController, validator: (value) { if (value == null) - return TranslationBase - .of(context) - .emptyMessage; + return TranslationBase.of(context).emptyMessage; else return null; }), @@ -80,36 +80,59 @@ class _UpdateAllergiesWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - child: Texts( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy.nameAr + : selectedAllergy.selectedAllergy.nameEn .toUpperCase(), - variant: "bodyText", - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: Colors.black), - width: MediaQuery.of(context).size.width * 0.5, + // variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Color(0xFF2B353E)), + Texts( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergySeverity + .nameAr + : selectedAllergy.selectedAllergySeverity + .nameEn + .toUpperCase(), + // variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + // bold: true, + color: Color(0xFFCC9B14)), + ], + ), + width: MediaQuery + .of(context) + .size + .width * 0.5, ), - Texts( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergySeverity.nameAr - : selectedAllergy.selectedAllergySeverity.nameEn - .toUpperCase(), - variant: "bodyText", - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: AppGlobal.appPrimaryColor), + if (selectedAllergy.isChecked) InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, + child: Row( + children: [Container( + child: Texts( + TranslationBase + .of(context) + .remove, + fontSize: 15, + variant: "bodyText", + color: HexColor("#B8382C"),), + ), + Icon( + FontAwesomeIcons.times, + color: HexColor("#B8382C"), + size: 20, + ), + ], ), onTap: () => removeAllergy(selectedAllergy), ) @@ -119,14 +142,6 @@ class _UpdateAllergiesWidgetState extends State { padding: const EdgeInsets.symmetric(vertical: 8), child: Row( children: [ - AppText( - selectedAllergy.remark != null && - selectedAllergy.remark != '' - ? TranslationBase.of(context).remarks + " : " - : '', - fontWeight: FontWeight.bold, - fontSize: 13, - ), Container( width: MediaQuery.of(context).size.width * 0.55, child: AppText( diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index de5d2fb2..a8f92b72 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -51,20 +50,21 @@ class _UpdateHistoryWidgetState extends State margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hintText: TranslationBase.of(context).addHistory, + borderColor: HexColor('#707070'), + borderWidth: 0.30, fontSize: 13.5, + borderRadius: 12, onTapTextFields: () { openHistoryList(context); }, - readOnly: true, - // hintColor: Colors.black, suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, + suffixIconColor: Color(0xFF2B353E), + readOnly: true, fontWeight: FontWeight.w600, // controller: messageController, validator: (value) { if (value == null) - return TranslationBase.of(context) - .emptyMessage; + return TranslationBase.of(context).emptyMessage; else return null; }), @@ -87,20 +87,44 @@ class _UpdateHistoryWidgetState extends State projectViewModel.isArabic ? myHistory.selectedHistory.nameAr : myHistory.selectedHistory.nameEn, - variant: "bodyText", + fontSize: 15, textDecoration: myHistory.isChecked ? null : TextDecoration.lineThrough, - bold: true, + // bold: true, color: Colors.black), - width: MediaQuery.of(context).size.width * 0.7, + width: MediaQuery + .of(context) + .size + .width * 0.5, ), if (myHistory.isChecked) InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, + child: Row( + children: [ + Container( + child: Texts( + TranslationBase + .of(context) + .remove, + fontSize: 15, + variant: "bodyText", + textDecoration: myHistory.isChecked + ? null + : TextDecoration.lineThrough, + + + + // bold: true, + color: HexColor("#B8382C"),), + // width: MediaQuery.of(context).size.width * 0.3, + ), + Icon( + FontAwesomeIcons.times, + color: HexColor("#B8382C"), + size: 17, + ), + ], ), onTap: () => removeHistory(myHistory.selectedHistory), )