From e47e7c0a00e24079e9a3ef72283a4b6810585140 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 12 Apr 2021 18:19:38 +0300 Subject: [PATCH] add medication almost done --- assets/images/qr_code.png | Bin 10396 -> 1553 bytes .../subjective/update_medication_widget.dart | 767 +++++++++--------- .../soap_update/update_assessment_page.dart | 4 +- 3 files changed, 395 insertions(+), 376 deletions(-) diff --git a/assets/images/qr_code.png b/assets/images/qr_code.png index 775a30bda26e5c2eb407238f143fae0fa2082c70..71a9e8958d65061b396fe06ea074d438aee34a6f 100644 GIT binary patch literal 1553 zcmV+s2JZQZP)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91SD*s` z1ONa40RR91R{#J20Dzj#E&u=pheV|D>XCkdHg(f z>V&saw3+Ako}a&&vEO*?wYNuKICH+A{U`Islh7)C@qr&3;s<6hh1+J5Ormg;p=>)+xNRoMBnmef%C@6HTeOzAr;tX>*GJNCYwWJn=56Rh8xM_f z$1!z7svU`*d_O+P?RmFADV7aK0{>A)c20&2eS~}rcPIir`W|3%~*0Dr)sNSxf#!t!d18#31oB~+~;PDA=)+9H7Ro zc;nsWa`uucD?wHaTn^GZm~|t3fS@-1+R@+7ID9A4Y%)Bw)#=p zNO$t;#$xfSK14{tT?YO0y;m*+F+m#?t^k%))!XO#9)G!6EDXSB#|4Osg}E|Lj*qTX znJ+d<7OXmU{S8!f{#wm zGKJd{pwC?4`snm5Q@A|=`pk{9VvaW4)BzO;!;X~1T}* z*-=5DY-_Z=$N7U|(Y`gVj$=%DI^_hfr8ia(^vYGc2p(!1C;fxmm!)bCMsNoCk3K1q{$%cQ@W zdGgF+#k_mV6l%+@b_*>e=>!Tl9m|#{oGhP!lzpOUS@aY@pZuugTe)ZR&Y0ul@A!-) z^8pM{`%uL!b2UY{kD6O3B60`@ zS1teR%2Zsw)jeE2l%FnHm#<>rat+xq)z>iFESeULUEKrY${3a?-Qi+s%AIpR93398 zdzOob+iXzIV*tA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l&5=>3`@l5C)O zWKbKjtE4T!J4gAh7&l^q%sDQy{=&ufU0&RCEyPkf6>a-Yp4JxlD>Wh1_ehG!nui1)-%sJ-B#Tj;6S&XDMM6$^5x_h-aML?=oA z!>8R%!w8+Kw_VzCcX<&oRLgd=6xk-a=v7kpir|%Xev?=1)ibuhpnx|pVGbq!Lbg*q z0g08LZ45rYF_`(L<{O6VUy3dIayK{y-#)aT6EAdjUU9Ub;vA27uAkd_;7F0TGD_(B(+Eh zMLAG8dMMeL#4g^+S8@v%pB@)gLYF_U_yGXHs^1CyeJ5{(G$ZQ)z@P?BDsWE$L+Q8s zQmV5tHaz`1d?xh(z*!}xZJWKRXsCj0~XuNZXTeg$i zo1x=<0So<4p~gfG^n%sa0fT-Tq+D1f zqg}QEYw!~TN)mOeGpLR<_Nc}D7m^J_O2$v(*-wyUFCJB1=;1^95rL1GrqkoY+i40= zU9FD19sZ&xz}Y{pR-L-px*fMM<=S485g?PCKI_sl2uHAm%Cag@Z}aoYq*y+g9q9B~OfLbzOrS7+jB3#FJD04M;uSmuhB- z8f<#|YbgKAnI03vl?d%%!_~l^S_4NneUH%z-#1t8ug$J75Vt1$l<>J-bqkW{06x1h z&owzMTiSqqG#XJVws>yrs`W=Wf@spc!f#S;#^{pUw5$R1Xrfidu@xtvwrn$!wIW4)*gfED>!}co1}quV+-c2Th46p&Ur)9D=MHP~1Mv%8U344)?2o8HJT@<7125}$ zUN%xz9yX{GAS56pz$+liD=4fZC?q8)EF~(=Eg&EzAkgzSY43kgaCWtRZ|nD8D>Q`j zXrmOU|9N=pYU}0m&cg=q@$un%@8alb_0G+P&(*^&eP4zKB?PD`Ybuq$un75YOPz;x diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart index 68844765..2d9f5cd5 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_medication_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/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -10,12 +9,14 @@ 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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; 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'; @@ -120,17 +121,20 @@ class _AddMedicationState extends State { String hintText, String selectedText, bool isDropDown, {IconData icon}) { return InputDecoration( + filled: true, + fillColor: Colors.white, + contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Colors.grey, width: 0.00), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Colors.grey, width: 0.00), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Colors.grey, width: 0.00), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -152,7 +156,6 @@ class _AddMedicationState extends State { .of(context) .size; return FractionallySizedBox( - heightFactor: 0.7, child: BaseView( onModelReady: (model) async { if (model.medicationStrengthList.length == 0) { @@ -172,388 +175,402 @@ class _AddMedicationState extends State { }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: + EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 115, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10), + margin: EdgeInsets.only(top: 40), + child: Column( children: [ - - SizedBox( - height: 16, - ), - AppText( - TranslationBase - .of(context) - .addMedication, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.genericName - : null, - true, - icon: EvaIcons.search), - itemSubmitted: (item) => - setState( - () => _selectedMedication = item), - key: key, - suggestions: model.allMedicationList, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts( - suggestion.description + '/' + - suggestion.genericName), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName - .toLowerCase() - .startsWith(input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input.toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith(input.toLowerCase()), - ) - : TextField( - minLines: 2, - maxLines: 2, - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.description + - (' (${_selectedMedication - .genericName} )') - : null, - true, - icon: EvaIcons.search), - enabled: false, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 20, color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context) + .addMedication, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), ), - ), - ), - if(isFormSubmitted && _selectedMedication == null) - CustomValidationError(), - SizedBox( - height: 5, - ), - TextFields( - onTapTextFields: model.medicationDoseTimeList != - null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationDoseTimeList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = - selectedValue; - - doseController.text = - projectViewModel.isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: doseController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .doseTime, - //TODO add translation - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: doseController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - SizedBox( - height: 5, - ), - if(isFormSubmitted && - _selectedMedicationDose == null) - CustomValidationError(), SizedBox( - height: 5, - ), - TextFields( - onTapTextFields: model - .medicationStrengthList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationStrengthList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; - - strengthController.text = - projectViewModel.isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; + InkWell( + onTap: () { + Navigator.pop(context); }, - ); - } - : null, - hasLabelText: strengthController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .strength, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: strengthController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), SizedBox( - height: 5, + child: Icon(FontAwesomeIcons.times, + size: 30, color: Color(0xFF2B353E))) + ], ), - if(isFormSubmitted && - _selectedMedicationStrength == null) - CustomValidationError(), + ], + ), + ), + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: + textFieldSelectorDecoration( - SizedBox( - height: 5, - ), + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .genericName + : null, + true, + icon: EvaIcons.search), + itemSubmitted: (item) => setState( + () => + _selectedMedication = item), + key: key, + suggestions: + model.allMedicationList, + itemBuilder: (context, + suggestion) => + new Padding( + child: Texts(suggestion + .description + + '/' + + suggestion.genericName), + padding: + EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.genericName + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith( + input.toLowerCase()), + ) + : AppTextFieldCustom( + hintText: _selectedMedication != null + ? _selectedMedication + .description + + (' (${_selectedMedication.genericName} )') + : TranslationBase.of(context) + .searchMedicineNameHere, + minLines: 2, + maxLines: 2, + enabled: false, + ), + ), + ), + if (isFormSubmitted && + _selectedMedication == null) + CustomValidationError(), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + onClick: model.medicationDoseTimeList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationDoseTimeList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = + selectedValue; - TextFields( - onTapTextFields: model - .medicationRouteList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationRouteList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + doseController + .text = projectViewModel + .isArabic + ? _selectedMedicationDose + .nameAr + : _selectedMedicationDose + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).doseTime, + //TODO add translation + maxLines: 2, + minLines: 2, + isDropDown: true, + controller: doseController, + ), + SizedBox( + height: 5, + ), + if (isFormSubmitted && + _selectedMedicationDose == null) + CustomValidationError(), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isDropDown: true, + onClick: model.medicationStrengthList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationStrengthList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = + selectedValue; - routeController.text = - projectViewModel.isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: routeController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .route, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: routeController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - SizedBox( - height: 5, - ), - if(isFormSubmitted && - _selectedMedicationRoute == null) - CustomValidationError(), - SizedBox( - height: 5, - ), - TextFields( - onTapTextFields: model - .medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationFrequencyList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + strengthController + .text = projectViewModel + .isArabic + ? _selectedMedicationStrength + .nameAr + : _selectedMedicationStrength + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).strength, + // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 2, + controller: strengthController, + ), + SizedBox( + height: 5, + ), + if (isFormSubmitted && + _selectedMedicationStrength == null) + CustomValidationError(), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isDropDown: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationRouteList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; - frequencyController.text = - projectViewModel.isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: frequencyController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .frequency, - //TODO add translation - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: frequencyController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - SizedBox( - height: 5, - ), - if(isFormSubmitted && - _selectedMedicationFrequency == null) - CustomValidationError(), - SizedBox( - height: 30, - ), - AppButton( - title: TranslationBase - .of(context) - .add - .toUpperCase(), - onPressed: () { - setState(() { - isFormSubmitted = true; - }); - if (_selectedMedication != null && - _selectedMedicationDose != - null && - _selectedMedicationStrength != null && - _selectedMedicationRoute != null && - _selectedMedicationFrequency != null) { - widget.medicationController.text = - widget.medicationController.text + - '${_selectedMedication - .description } (${TranslationBase - .of(context) - .doseTime} ) ${doseController - .text} (${TranslationBase - .of(context) - .strength}) ${strengthController - .text} (${TranslationBase - .of(context) - .route }) ${routeController - .text} (${TranslationBase - .of(context) - .frequency }) ${frequencyController - .text} \n \n'; - Navigator.of(context).pop(); - } - }, - ), - ] + routeController + .text = projectViewModel + .isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).route, + maxLines: 2, + minLines: 2, + controller: routeController, + ), + SizedBox( + height: 5, + ), + if (isFormSubmitted && + _selectedMedicationRoute == null) + CustomValidationError(), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + onClick: model.medicationFrequencyList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationFrequencyList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = + selectedValue; + frequencyController + .text = projectViewModel + .isArabic + ? _selectedMedicationFrequency + .nameAr + : _selectedMedicationFrequency + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).frequency, + //TODO add translation + enabled: false, + // hintColor: Colors.black, + maxLines: 2, + minLines: 2, + isDropDown: true, + controller: frequencyController, + ), + SizedBox( + height: 5, + ), + if (isFormSubmitted && + _selectedMedicationFrequency == null) + CustomValidationError(), + SizedBox( + height: 30, + ), + ], + )), + ), + ), + ]), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0.30), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).addMedication.toUpperCase(), + color: Color(0xFF359846), + onPressed: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedMedication != null && + _selectedMedicationDose != null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = widget + .medicationController.text + + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + Navigator.of(context).pop(); + } + }, ), ), ), - ),), + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ), ), ); } diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index f5b3def9..0cf6303d 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -640,7 +640,8 @@ class _AddAssessmentDetailsState extends State { {IconData icon}) { return InputDecoration( fillColor: Colors.white, - contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), + + contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderRadius: BorderRadius.circular(8), @@ -763,6 +764,7 @@ class _AddAssessmentDetailsState extends State { .mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( + decoration: textFieldSelectorDecoration( TranslationBase.of(context) .nameOrICD,