From d2bd3b68e1c53e004b27313c57b8cd3954adc819 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 15:32:42 +0300 Subject: [PATCH 01/15] 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), ) From c8b44936f845e9ab86d1d0655eb046ee80f3c1a2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 7 Apr 2021 09:49:21 +0300 Subject: [PATCH 02/15] fix on history design --- .../soap_update/subjective/PriorityBar.dart | 93 ++++++++++ .../subjective/update_history_widget.dart | 167 +++++++----------- .../master_key_checkbox_search_widget.dart | 18 +- 3 files changed, 168 insertions(+), 110 deletions(-) create mode 100644 lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart diff --git a/lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart b/lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart new file mode 100644 index 00000000..5858c08d --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart @@ -0,0 +1,93 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class PriorityBar extends StatefulWidget { + final Function onTap; + + const PriorityBar({Key key, this.onTap}) : super(key: key); + + @override + _PriorityBarState createState() => _PriorityBarState(); +} + +class _PriorityBarState extends State { + int _activePriority = 0; + int index = -1; + List _priorities = [ + "Family", + "Surgical/Sports", + "Medical", + ]; + List _prioritiesAr = [ + "أسرة", + "جراحي / رياضي", + "طبي", + ]; + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration(); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); + + return Container( + height: screenSize.height * 0.080, + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _priorities.map(( + item, + ) { + bool _isActive = _priorities[_activePriority] == item ? true : false; + if (index < 2) { + index++; + } + return Expanded( + child: InkWell( + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: screenSize.height * 0.070, + decoration: containerBorderDecoration( + _isActive ? HexColor("#B8382B") : Colors.white, + _isActive ? HexColor("#B8382B") : Colors.white), + child: Center( + child: Text( + (projectViewModel.isArabic) + ? _prioritiesAr[index] + : item, + style: TextStyle( + fontSize: 15, + color: Colors.black, //Colors.black, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + if(_isActive) + Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) + ], + ), + ), + onTap: () { + widget.onTap(_priorities.indexOf(item)); + + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }), + ); + }).toList(), + ), + ); + } +} 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 a8f92b72..92a41d8a 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,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_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'; @@ -16,6 +17,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'PriorityBar.dart'; + class UpdateHistoryWidget extends StatefulWidget { final List myHistoryList; @@ -184,93 +187,7 @@ class _UpdateHistoryWidgetState extends State } } -class PriorityBar extends StatefulWidget { - final Function onTap; - - const PriorityBar({Key key, this.onTap}) : super(key: key); - - @override - _PriorityBarState createState() => _PriorityBarState(); -} - -class _PriorityBarState extends State { - int _activePriority = 0; - int index =-1; - List _priorities = [ - "Family", - "Surgical/Sports", - "Medical", - ]; - List _prioritiesAr = [ - "أسرة", - "جراحي / رياضي" , - "طبي", - ]; - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: 2.0, - )), - ); - } - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); - - return Container( - height: screenSize.height * 0.070, - decoration: - containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _priorities.map((item,) { - bool _isActive = _priorities[_activePriority] == item ? true : false; - if(index <2){ - index++; - } - return Expanded( - child: InkWell( - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, - _isActive ? HexColor("#B8382B") : Colors.white), - child: Center( - child: Text( - (projectViewModel.isArabic)?_prioritiesAr[index]: item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - fontWeight: FontWeight.bold, - ), - ), - )), - ), - onTap: () { - widget.onTap(_priorities.indexOf(item)); - - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }), - ); - }).toList(), - ), - ); - } -} class AddHistoryDialog extends StatefulWidget { final Function changePageViewIndex; @@ -291,7 +208,7 @@ class _AddHistoryDialogState extends State { @override Widget build(BuildContext context) { return FractionallySizedBox( - heightFactor: 0.7, + heightFactor: 1, child: BaseView( onModelReady: (model) async { if (model.historyFamilyList.length == 0) { @@ -312,20 +229,66 @@ class _AddHistoryDialogState extends State { isShowAppBar: false, body: Center( child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 10, + child: Column( + children: [ + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, ), - PriorityBar(onTap: (activePriority) async { - widget.changePageViewIndex(activePriority); - }), - SizedBox( - height: 20, - ), - Expanded( + height: 115, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: 40), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).addHistory, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(FontAwesomeIcons.times, + size: 30, + color: Color(0xFF2B353E))) + ], + ), + ], + ), + ), + ), + SizedBox( + height: 10, + ), + PriorityBar(onTap: (activePriority) async { + widget.changePageViewIndex(activePriority); + }), + SizedBox( + height: 20, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, child: PageView( physics: NeverScrollableScrollPhysics(), controller: widget.controller, @@ -405,9 +368,9 @@ class _AddHistoryDialogState extends State { ], ), ), + ), ], - ), - )), + )), ), ), )); diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index dd9e2f3d..64853f0a 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -13,6 +13,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'app_texts_widget.dart'; + class MasterKeyCheckboxSearchWidget extends StatefulWidget { final SOAPViewModel model; final Function addSelectedHistories; @@ -49,15 +51,14 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Wed, 7 Apr 2021 11:12:54 +0300 Subject: [PATCH 03/15] finish on history design --- lib/config/localized_values.dart | 2 +- .../soap_update/expandable_SOAP_widget.dart | 4 +- .../subjective/update_history_widget.dart | 27 ++-- .../subjective/update_subjective_page.dart | 3 + lib/widgets/shared/app_buttons_widget.dart | 2 +- .../master_key_checkbox_search_widget.dart | 129 ++++++++++-------- 6 files changed, 91 insertions(+), 76 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 31487256..c886c499 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -517,7 +517,7 @@ const Map> localizedValues = { 'addHistory': {'en': "Add History", 'ar': "اضافه تاريخ مرضي"}, 'searchHistory': {'en': "Search History", 'ar': " البحث"}, 'addSelectedHistories': { - 'en': "add selected histories", + 'en': "Add Selected Histories", 'ar': " اضافه تاريخ مرضي" }, 'addAllergies': {'en': "Add Allergies", 'ar': "أضف الحساسية"}, 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 5a0bcd8e..32876539 100644 --- a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart +++ b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart @@ -11,9 +11,10 @@ class ExpandableSOAPWidget extends StatelessWidget { final Widget child; final Function onTap; final headerTitle; + final bool isRequired; const ExpandableSOAPWidget( - {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle}) + {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) : super(key: key); @override @@ -40,6 +41,7 @@ class ExpandableSOAPWidget extends StatelessWidget { // bold: isExpanded ? true : false, fontSize: 15, color: Colors.black), + if(isRequired) Icon( FontAwesomeIcons.asterisk, color: AppGlobal.appPrimaryColor, 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 92a41d8a..eb69e7a5 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 @@ -115,9 +115,6 @@ class _UpdateHistoryWidgetState extends State textDecoration: myHistory.isChecked ? null : TextDecoration.lineThrough, - - - // bold: true, color: HexColor("#B8382C"),), // width: MediaQuery.of(context).size.width * 0.3, @@ -169,19 +166,23 @@ class _UpdateHistoryWidgetState extends State openHistoryList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, + isDismissible: false, isScrollControlled: true, context: context, builder: (context) { - return AddHistoryDialog( - changePageViewIndex: changePageViewIndex, - controller: _controller, - myHistoryList: widget.myHistoryList, - addSelectedHistories: () { - setState(() { - Navigator.of(context).pop(); - }); - }, - removeHistory: (masterKey) => removeHistory(masterKey), + return FractionallySizedBox( + heightFactor: 1, + child: AddHistoryDialog( + changePageViewIndex: changePageViewIndex, + controller: _controller, + myHistoryList: widget.myHistoryList, + addSelectedHistories: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + removeHistory: (masterKey) => removeHistory(masterKey), + ), ); }); } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index c3a43648..45202baf 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -263,6 +263,7 @@ class _UpdateSubjectivePageState extends State { headerTitle: TranslationBase .of(context) .histories, + isRequired: false, onTap: () { setState(() { isHistoryExpand = !isHistoryExpand; @@ -285,6 +286,7 @@ class _UpdateSubjectivePageState extends State { .of(context) .allergiesSoap , + isRequired: false, onTap: () { setState(() { isAllergiesExpand = !isAllergiesExpand; @@ -337,6 +339,7 @@ class _UpdateSubjectivePageState extends State { title: TranslationBase .of(context) .next, + fontWeight: FontWeight.bold, loading: model.state == ViewState.BusyLocal, onPressed: () async { addSubjectiveInfo( diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index 165e1680..024f3db7 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -75,7 +75,7 @@ class _AppButtonState extends State { ), ) : AppText( - widget.title.toUpperCase(), + widget.title, color: widget.fontColor, fontSize: SizeConfig.textMultiplier * widget.fontSize, fontWeight: widget.fontWeight, diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 64853f0a..b5376246 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -54,77 +54,86 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Wed, 7 Apr 2021 12:15:06 +0300 Subject: [PATCH 04/15] fix master key word --- .../master_key_checkbox_search_widget.dart | 70 +++++++++++-------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index b5376246..a5b03a33 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -84,36 +84,50 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Wed, 7 Apr 2021 14:41:52 +0300 Subject: [PATCH 05/15] finish soap objective new design --- lib/config/localized_values.dart | 5 +- lib/util/translations_delegate_base.dart | 2 + .../objective/examination-item-card.dart | 93 +++ .../objective-add-examination-page.dart | 506 ++++++++++++ .../objective/update_objective_page.dart | 473 ++++++++++++ .../soap_update/update_objective_page.dart | 730 ------------------ .../soap_update/update_soap_index.dart | 2 +- lib/widgets/shared/app-textfield-custom.dart | 21 +- 8 files changed, 1097 insertions(+), 735 deletions(-) create mode 100644 lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart create mode 100644 lib/widgets/patients/profile/soap_update/objective/objective-add-examination-page.dart create mode 100644 lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart delete mode 100644 lib/widgets/patients/profile/soap_update/update_objective_page.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 980a2e9b..b0e694a8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -824,8 +824,11 @@ const Map> localizedValues = { "accepted": {"en": "Accepted", "ar": "وافقت"}, "cancelled": {"en": "Cancelled", "ar": "ألغيت"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, - "replied": {"en": "Replied", "ar": " تم الرد"},"typeHereToReply": { + "searchHere": {"en": "Search here", "ar": "إبحث هنا"}, + "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..6eba28fc 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 searchHere => localizedValues['searchHere'][locale.languageCode]; + String get remove => localizedValues['remove'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart b/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart new file mode 100644 index 00000000..ff5d0a6c --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart @@ -0,0 +1,93 @@ +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/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ExaminationIitemCard extends StatelessWidget { + final MySelectedExamination examination; + final Function removeExamination; + + ExaminationIitemCard(this.examination, this.removeExamination); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return Container( + color: Colors.white, + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Container( + child: AppText( + projectViewModel.isArabic + ? examination.selectedExamination.nameAr != null && + examination.selectedExamination.nameAr != "" + ? examination.selectedExamination.nameAr + : examination.selectedExamination.nameEn + : examination.selectedExamination.nameEn, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.8, + ), + )), + Row( + children: [ + AppText( + TranslationBase.of(context).remove, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + color: Colors.red.shade800, + fontSize: SizeConfig.textMultiplier * 1.8, + ), + InkWell( + onTap: removeExamination, + child: Icon( + Icons.clear, + size: 20, + color: Colors.red.shade800, + ), + ) + ], + ), + ], + ), + AppText( + !examination.isNormal + ? examination.isAbnormal + ? TranslationBase.of(context).abnormal + : TranslationBase.of(context).notExamined + : TranslationBase.of(context).normal, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + color: !examination.isNormal + ? examination.isAbnormal + ? Colors.red.shade800 + : Colors.grey.shade800 + : Colors.green.shade800, + fontSize: SizeConfig.textMultiplier * 1.8, + ), + SizedBox( + height: 4, + ), + Expanded( + child: AppText( + examination.remark, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + color: Colors.grey.shade500, + fontSize: SizeConfig.textMultiplier * 1.8, + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/soap_update/objective/objective-add-examination-page.dart b/lib/widgets/patients/profile/soap_update/objective/objective-add-examination-page.dart new file mode 100644 index 00000000..225b6f61 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/objective/objective-add-examination-page.dart @@ -0,0 +1,506 @@ +import 'package:doctor_app_flutter/config/size_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'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +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/app-textfield-custom.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/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +// Author Mosa Abuzaid + +class AddExaminationPage extends StatefulWidget { + final List mySelectedExamination; + final Function addSelectedExamination; + final Function(MasterKeyModel) removeExamination; + + AddExaminationPage( + {this.mySelectedExamination, + this.addSelectedExamination, + this.removeExamination}); + + @override + _AddExaminationPageState createState() => _AddExaminationPageState(); +} + +class _AddExaminationPageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup(MasterKeysService.PhysicalExamination); + } + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + backgroundColor: Color.fromRGBO(248, 248, 248, 1), + body: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + padding: + EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16), + color: Colors.white, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).addExamination}", + fontSize: SizeConfig.textMultiplier * 3.3, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Icon( + Icons.clear, + size: 40, + ), + ) + ], + ), + ), + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + Container( + margin: EdgeInsets.all(16.0), + padding: EdgeInsets.all(0.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + children: [ + ExaminationsListSearchWidget( + masterList: model.physicalExaminationList, + isServiceSelected: (master) => + isServiceSelected(master), + removeHistory: (history) { + setState(() { + widget.removeExamination(history); + }); + }, + addHistory: (selectedExamination) { + setState(() { + widget.mySelectedExamination + .add(selectedExamination); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + Container( + padding: EdgeInsets.all(16), + color: Colors.white, + child: BorderedButton( + "${TranslationBase.of(context).addExamination}", + backgroundColor: HexColor("#359846"), + textColor: Colors.white, + vPadding: 12, + radius: 12, + fontWeight: FontWeight.w600, + fontSize: SizeConfig.textMultiplier * 2.5, + fontFamily: 'Poppins', + handler: () { + widget.addSelectedExamination(); + }, + ), + ) + ], + ), + ), + ); + } + + isServiceSelected(MasterKeyModel masterKey) { + Iterable exam = widget.mySelectedExamination.where( + (element) => + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); + if (exam.length > 0) { + return true; + } + return false; + } +} + +class ExaminationsListSearchWidget extends StatefulWidget { + final Function(MasterKeyModel) removeHistory; + final Function(MySelectedExamination) addHistory; + final bool Function(MasterKeyModel) isServiceSelected; + final List masterList; + + ExaminationsListSearchWidget( + {this.removeHistory, + this.addHistory, + this.isServiceSelected, + this.masterList}); + + @override + _ExaminationsListSearchWidgetState createState() => + _ExaminationsListSearchWidgetState(); +} + +class _ExaminationsListSearchWidgetState + extends State { + int expandedIndex = -1; + List items = List(); + TextEditingController filteredSearchController = TextEditingController(); + + @override + void initState() { + items.addAll(widget.masterList); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + AppTextFieldCustom( + height: MediaQuery.of(context).size.height * 0.080, + hintText: TranslationBase.of(context).searchExamination, + isDropDown: true, + hasBorder: false, + controller: filteredSearchController, + onChanged: (value) { + filterSearchResults(value); + }, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + ), + ), + DividerWithSpacesAround( + height: 2, + ), + ...items.mapIndexed((index, item) { + return AddExaminationWidget( + item: item, + addHistory: widget.addHistory, + removeHistory: widget.removeHistory, + isServiceSelected: widget.isServiceSelected, + isExpand: index == expandedIndex, + expandClick: () { + setState(() { + if (expandedIndex == index) { + expandedIndex = -1; + } else { + expandedIndex = index; + } + }); + }, + ); + }).toList(), + ], + ); + } + + void filterSearchResults(String query) { + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); + if (query.isNotEmpty) { + List dummyListData = List(); + dummySearchList.forEach((item) { + if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || + item.nameEn.toLowerCase().contains(query.toLowerCase())) { + dummyListData.add(item); + } + }); + setState(() { + items.clear(); + items.addAll(dummyListData); + }); + return; + } else { + setState(() { + items.clear(); + items.addAll(widget.masterList); + }); + } + } +} + +class AddExaminationWidget extends StatefulWidget { + MasterKeyModel item; + final Function(MasterKeyModel) removeHistory; + final Function(MySelectedExamination) addHistory; + final bool Function(MasterKeyModel) isServiceSelected; + bool isExpand; + final Function expandClick; + + AddExaminationWidget({ + this.item, + this.removeHistory, + this.addHistory, + this.isServiceSelected, + this.isExpand, + this.expandClick, + }); + + @override + _AddExaminationWidgetState createState() => _AddExaminationWidgetState(); +} + +class _AddExaminationWidgetState extends State { + int status = 3; + TextEditingController remarksController = TextEditingController(); + MySelectedExamination examination = MySelectedExamination(); + + @override + void initState() { + + examination.selectedExamination = widget.item; + super.initState(); + } + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return Container( + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: CheckboxListTile( + title: AppText( + projectViewModel.isArabic + ? widget.item.nameAr != null && widget.item.nameAr != "" + ? widget.item.nameAr + : widget.item.nameEn + : widget.item.nameEn, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.0, + ), + value: widget.isServiceSelected(widget.item), + activeColor: HexColor("#D02127"), + onChanged: (newValue) { + setState(() { + if (widget.isServiceSelected(widget.item)) { + widget.removeHistory(widget.item); + widget.expandClick(); + } else { + examination.isNormal = status == 1; + examination.isAbnormal = status == 2; + examination.notExamined = status == 3; + examination.remark = remarksController.text; + widget.addHistory(examination); + widget.expandClick(); + } + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + child: InkWell( + onTap: widget.expandClick, + child: Icon(widget.isExpand + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)), + ), + ], + ), + bodyWidget: Container( + padding: EdgeInsets.symmetric(horizontal: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(bottom: 8), + child: AppText( + TranslationBase.of(context).status, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ), + Row( + children: [ + Expanded( + child: Row( + children: [ + InkWell( + onTap: () { + setState(() { + status = 1; + }); + examination.isNormal = true; + examination.isAbnormal = false; + examination.notExamined = false; + }, + child: Container( + padding: EdgeInsets.all(2.0), + margin: EdgeInsets.symmetric(horizontal: 6), + width: 20, + height: 20, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + border: Border.all(color: Colors.grey, width: 1), + ), + child: Container( + decoration: BoxDecoration( + color: status == 1 + ? HexColor("#D02127") + : Colors.white, + shape: BoxShape.circle, + ), + ), + ), + ), + AppText( + TranslationBase.of(context).normal, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ], + )), + Expanded( + child: Row( + children: [ + InkWell( + onTap: () { + setState(() { + status = 2; + }); + examination.isNormal = false; + examination.isAbnormal = true; + examination.notExamined = false; + }, + child: Container( + padding: EdgeInsets.all(2.0), + margin: EdgeInsets.symmetric(horizontal: 6), + width: 20, + height: 20, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + border: Border.all(color: Colors.grey, width: 1), + ), + child: Container( + decoration: BoxDecoration( + color: status == 2 + ? HexColor("#D02127") + : Colors.white, + shape: BoxShape.circle, + ), + ), + ), + ), + AppText( + TranslationBase.of(context).abnormal, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ], + )), + Expanded( + child: Row( + children: [ + InkWell( + onTap: () { + setState(() { + status = 3; + }); + examination.isNormal = false; + examination.isAbnormal = false; + examination.notExamined = true; + }, + child: Container( + padding: EdgeInsets.all(2.0), + margin: EdgeInsets.symmetric(horizontal: 6), + width: 20, + height: 20, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + border: Border.all(color: Colors.grey, width: 1), + ), + child: Container( + decoration: BoxDecoration( + color: status == 3 + ? HexColor("#D02127") + : Colors.white, + shape: BoxShape.circle, + ), + ), + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context).notExamined, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ), + ], + )), + ], + ), + Container( + margin: EdgeInsets.only(top: 8), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + controller: remarksController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value){ + examination.remark = value; + }, + ), + ), + ], + ), + ), + isExpand: widget.isExpand, + ), + ); + } +} + +extension FicListExtension on List { + /// Maps each element of the list. + /// The [map] function gets both the original [item] and its [index]. + Iterable mapIndexed(E Function(int index, T item) map) sync* { + for (var index = 0; index < length; index++) { + yield map(index, this[index]); + } + } +} diff --git a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart new file mode 100644 index 00000000..ba9368bb --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart @@ -0,0 +1,473 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +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_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/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.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 'examination-item-card.dart'; +import 'objective-add-examination-page.dart'; + +class UpdateObjectivePage extends StatefulWidget { + final Function changePageViewIndex; + final Function changeLoadingState; + + final List mySelectedExamination; + final PatiantInformtion patientInfo; + + UpdateObjectivePage( + {Key key, + this.changePageViewIndex, + this.mySelectedExamination, + this.patientInfo, + this.changeLoadingState}); + + @override + _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); +} + +class _UpdateObjectivePageState extends State { + bool isSysExaminationExpand = false; + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 0.5, + )), + ); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + onModelReady: (model) async { + widget.mySelectedExamination.clear(); + GetPhysicalExamReqModel getPhysicalExamReqModel = + GetPhysicalExamReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: widget.patientInfo.appointmentNo); + + await model.getPatientPhysicalExam(getPhysicalExamReqModel); + if (model.patientPhysicalExamList.isNotEmpty) { + if (model.physicalExaminationList.length == 0) { + await model + .getMasterLookup(MasterKeysService.PhysicalExamination); + } + model.patientPhysicalExamList.forEach((element) { + MasterKeyModel examMaster = model.getOneMasterKey( + masterKeys: MasterKeysService.PhysicalExamination, + id: element.examId, + ); + MySelectedExamination tempEam = MySelectedExamination( + selectedExamination: examMaster, + remark: element.remarks, + isNormal: element.isNormal, + createdBy: element.createdBy, + notExamined: element.notExamined, + isNew: element.isNew, + isAbnormal: element.isAbnormal); + widget.mySelectedExamination.add(tempEam); + }); + } + + widget.changeLoadingState(false); + }, + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + // baseViewModel: model, + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + color: Color.fromRGBO(248, 248, 248, 1), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.95, + child: Container( + margin: EdgeInsets.all(8.0), + padding: EdgeInsets.all(12.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).physicalSystemExamination}", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 2.0, + fontWeight: isSysExaminationExpand + ? FontWeight.w700 + : FontWeight.normal, + ), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isSysExaminationExpand = + !isSysExaminationExpand; + }); + }, + child: Icon(isSysExaminationExpand + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)) + ], + ), + bodyWidget: Column( + children: [ + InkWell( + onTap: () { + openExaminationList(context); + }, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 8, horizontal: 8.0), + margin: + EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade400, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(8), + ), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).addExamination}", + fontSize: SizeConfig + .textMultiplier * + 1.8, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize: SizeConfig + .textMultiplier * + 1.8, + color: Colors.grey.shade700, + fontWeight: FontWeight.bold, + ), + ], + )), + Icon( + Icons.add_box_rounded, + size: 25, + ) + ], + ), + ), + ), + Column( + children: widget.mySelectedExamination + .map((examination) { + return ExaminationIitemCard( + examination, () { + removeExamination(examination + .selectedExamination); + }); + }).toList(), + ) + ], + ), + isExpand: isSysExaminationExpand, + ), + ], + ), + ), + ), + ), + ), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: HexColor("#EAEAEA"), + fontColor: Colors.black, + onPressed: () { + widget.changePageViewIndex(0); + }, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + loading: model.state == ViewState.BusyLocal, + color: HexColor("#A5A5A5"), + fontColor: HexColor("#5A5A5A"), + fontWeight: FontWeight.bold, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), + ), + ], + ), + ), + ], + ))); + } + + submitUpdateObjectivePage(SOAPViewModel model) async { + if (widget.mySelectedExamination.isNotEmpty) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + PostPhysicalExamRequestModel postPhysicalExamRequestModel = + new PostPhysicalExamRequestModel(); + widget.mySelectedExamination.forEach((exam) { + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = + []; + + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM + .add(ListHisProgNotePhysicalExaminationVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: exam.remark ?? '', + createdBy: exam.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + // masterDescription: exam.selectedExamination, + notExamined: exam.notExamined, + examinationType: exam.isNormal + ? 1 + : exam.isAbnormal + ? 2 + : 3, + examinationTypeName: exam.isNormal + ? "Normal" + : exam.isAbnormal + ? 'AbNormal' + : "Not Examined", + isNew: exam.isNew)); + }); + + if (model.patientPhysicalExamList.isEmpty) { + await model.postPhysicalExam(postPhysicalExamRequestModel); + } else { + await model.patchPhysicalExam(postPhysicalExamRequestModel); + } + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changeLoadingState(true); + + widget.changePageViewIndex(2); + } + } else { + // widget.changeLoadingState(true); + // + // widget.changePageViewIndex(2); + + helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); + } + } + + removeExamination(MasterKeyModel masterKey) { + Iterable history = widget.mySelectedExamination + .where((element) => + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); + + if (history.length > 0) + setState(() { + widget.mySelectedExamination.remove(history.first); + }); + } + + openExaminationList(BuildContext context) { + Navigator.push( + context, + FadePage( + page: AddExaminationPage( + mySelectedExamination: widget.mySelectedExamination, + addSelectedExamination: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + removeExamination: (masterKey) => removeExamination(masterKey)), + ), + ); + /*showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return AddExaminationDailog( + mySelectedExamination: widget.mySelectedExamination, + addSelectedExamination: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + removeExamination: (masterKey) => removeExamination(masterKey), + ); + });*/ + } +} + +class AddExaminationDailog extends StatefulWidget { + final List mySelectedExamination; + final Function addSelectedExamination; + final Function(MasterKeyModel) removeExamination; + + const AddExaminationDailog( + {Key key, + this.mySelectedExamination, + this.addSelectedExamination, + this.removeExamination}) + : super(key: key); + + @override + _AddExaminationDailogState createState() => _AddExaminationDailogState(); +} + +class _AddExaminationDailogState extends State { + @override + Widget build(BuildContext context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + if (model.physicalExaminationList.length == 0) { + await model + .getMasterLookup(MasterKeysService.PhysicalExamination); + } + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).physicalSystemExamination, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + /*MasterKeyCheckboxSearchWidget( + model: model, + hintSearchText: + TranslationBase.of(context).searchExamination, + buttonName: + TranslationBase.of(context).addExamination, + masterList: model.physicalExaminationList, + removeHistory: (history) { + setState(() { + widget.removeExamination(history); + }); + }, + addHistory: (history) { + setState(() { + MySelectedExamination mySelectedExamination = + new MySelectedExamination( + selectedExamination: history); + widget.mySelectedExamination + .add(mySelectedExamination); + }); + }, + addSelectedHistories: () { + widget.addSelectedExamination(); + }, + isServiceSelected: (master) => + isServiceSelected(master), + ),*/ + ]), + ))), + )), + ); + } +} diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart deleted file mode 100644 index 1ce5fbea..00000000 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ /dev/null @@ -1,730 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -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/patients/profile/soap_update/expandable_SOAP_widget.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_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/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.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'; - -class UpdateObjectivePage extends StatefulWidget { - final Function changePageViewIndex; - final Function changeLoadingState; - - final List mySelectedExamination; - final PatiantInformtion patientInfo; - - UpdateObjectivePage( - {Key key, - this.changePageViewIndex, - this.mySelectedExamination, - this.patientInfo, - this.changeLoadingState}); - - @override - _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); -} - -class _UpdateObjectivePageState extends State { - bool isSysExaminationExpand = false; - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: 0.5, - )), - ); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); - - return BaseView( - onModelReady: (model) async { - widget.mySelectedExamination.clear(); - GetPhysicalExamReqModel getPhysicalExamReqModel = - GetPhysicalExamReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); - - await model.getPatientPhysicalExam(getPhysicalExamReqModel); - if (model.patientPhysicalExamList.isNotEmpty) { - if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); - } - model.patientPhysicalExamList.forEach((element) { - MasterKeyModel examMaster = model.getOneMasterKey( - masterKeys: MasterKeysService.PhysicalExamination, - id: element.examId, - ); - MySelectedExamination tempEam = MySelectedExamination( - selectedExamination: examMaster, - remark: element.remarks, - isNormal: element.isNormal, - createdBy: element.createdBy, - notExamined: element.notExamined, - isNew: element.isNew, - isAbnormal: element.isAbnormal); - widget.mySelectedExamination.add(tempEam); - }); - } - - widget.changeLoadingState(false); - }, - builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - // baseViewModel: model, - body: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - color: Color.fromRGBO(248, 248, 248, 1), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.95, - child: Container( - margin: EdgeInsets.all(8.0), - padding: EdgeInsets.all(12.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(12), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey.shade400, - width: 0.4, - )), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).physicalSystemExamination}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.0, - fontWeight: isSysExaminationExpand ? FontWeight.w700 : FontWeight.normal, - ), - /*Texts( - TranslationBase.of(context) - .physicalSystemExamination, - variant: isSysExaminationExpand - ? "bodyText" - : '', - bold: isSysExaminationExpand - ? true - : false, - color: Colors.black),*/ - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isSysExaminationExpand = - !isSysExaminationExpand; - }); - }, - child: Icon(isSysExaminationExpand - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)) - ], - ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - Container( - margin: EdgeInsets.only( - left: 10, right: 10, top: 15), - child: TextFields( - hintText: TranslationBase.of(context) - .physicalSystemExamination, - fontSize: 13.5, - onTapTextFields: () { - openExaminationList(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: - EvaIcons.plusCircleOutline, - suffixIconColor: - AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Column( - children: widget.mySelectedExamination - .map((examination) { - TextEditingController - remarksController = - TextEditingController( - text: examination.remark); - - return Container( - margin: EdgeInsets.only( - left: 15, right: 15, top: 15), - child: Column(children: [ - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Texts( - (examination - .selectedExamination - .nameEn) - .toUpperCase(), - variant: "bodyText", - bold: true, - color: Colors.black) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Row( - children: [ - InkWell( - child: Center( - child: Container( - height: screenSize - .height * - 0.070, - decoration: containerBorderDecoration( - examination - .isNormal - ? Color( - 0xFF515A5D) - : Colors - .white, - Colors - .grey), - child: Center( - child: - Padding( - padding: - const EdgeInsets.all( - 8.0), - child: Text( - TranslationBase.of( - context) - .normal, - style: - TextStyle( - fontSize: - 12, - color: examination.isNormal - ? Colors.white - : Colors.black, - //Colors.black, - fontWeight: - FontWeight.bold, - ), - ), - ), - )), - ), - onTap: () { - setState(() { - examination - .isAbnormal = - false; - examination - .isNormal = - true; - examination - .notExamined = - false; - }); - }), - SizedBox( - width: 12, - ), - InkWell( - child: Center( - child: Container( - height: screenSize - .height * - 0.070, - decoration: containerBorderDecoration( - examination - .isAbnormal - ? Color( - 0xFF515A5D) - : Colors - .white, - Colors - .black), - child: Center( - child: - Padding( - padding: - const EdgeInsets.all( - 8.0), - child: Text( - TranslationBase.of( - context) - .abnormal, - style: - TextStyle( - fontSize: - 12, - color: examination.isAbnormal - ? Colors.white - : Colors.black, - //Colors.black, - fontWeight: - FontWeight.bold, - ), - ), - ), - )), - ), - onTap: () { - setState(() { - examination - .isNormal = - false; - examination - .isAbnormal = - true; - examination - .notExamined = - false; - }); - }), - SizedBox( - width: 12, - ), - InkWell( - child: Center( - child: Container( - height: screenSize - .height * - 0.070, - decoration: containerBorderDecoration( - examination - .notExamined - ? Color( - 0xFF515A5D) - : Colors - .white, - Colors - .black), - child: Center( - child: - Padding( - padding: - const EdgeInsets.all( - 8.0), - child: Text( - "Not Examined", - style: - TextStyle( - fontSize: - 12, - color: examination.notExamined - ? Colors.white - : Colors.black, - //Colors.black, - fontWeight: - FontWeight.bold, - ), - ), - ), - )), - ), - onTap: () { - setState(() { - examination - .isAbnormal = - false; - examination - .isNormal = - false; - examination - .notExamined = - true; - }); - }), - ], - ), - InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ), - onTap: () => removeExamination( - examination - .selectedExamination), - ) - ], - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hasLabelText: - remarksController - .text != - '' - ? true - : false, - showLabelText: true, - hintText: - TranslationBase.of( - context) - .remarks, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 4, - controller: - remarksController, - onChanged: (val) { - examination.remark = val; - }, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - ])); - }).toList(), - ) - ], - ) - ]), - isExpand: isSysExaminationExpand, - ), - ], - ), - ), - ), - ), - ), - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: HexColor("#EAEAEA"), - fontColor: Colors.black, - onPressed: () { - widget.changePageViewIndex(0); - }, - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - loading: model.state == ViewState.BusyLocal, - color: HexColor("#A5A5A5"), - fontColor: HexColor("#5A5A5A"), - fontWeight: FontWeight.bold, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, - ), - ), - ], - ), - ), - ], - ))); - } - - submitUpdateObjectivePage(SOAPViewModel model) async { - if (widget.mySelectedExamination.isNotEmpty) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); - widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; - - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: exam.remark ?? '', - createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - // masterDescription: exam.selectedExamination, - notExamined: exam.notExamined, - examinationType: exam.isNormal - ? 1 - : exam.isAbnormal - ? 2 - : 3, - examinationTypeName: exam.isNormal - ? "Normal" - : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew)); - }); - - if (model.patientPhysicalExamList.isEmpty) { - await model.postPhysicalExam(postPhysicalExamRequestModel); - } else { - await model.patchPhysicalExam(postPhysicalExamRequestModel); - } - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changeLoadingState(true); - - widget.changePageViewIndex(2); - } - } else { - // widget.changeLoadingState(true); - // - // widget.changePageViewIndex(2); - - helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); - } - } - - removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.mySelectedExamination - .where((element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); - - if (history.length > 0) - setState(() { - widget.mySelectedExamination.remove(history.first); - }); - } - - openExaminationList(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return AddExaminationDailog( - mySelectedExamination: widget.mySelectedExamination, - addSelectedExamination: () { - setState(() { - Navigator.of(context).pop(); - }); - }, - removeExamination: (masterKey) => removeExamination(masterKey), - ); - }); - } -} - -class AddExaminationDailog extends StatefulWidget { - final List mySelectedExamination; - final Function addSelectedExamination; - final Function(MasterKeyModel) removeExamination; - - const AddExaminationDailog( - {Key key, - this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}) - : super(key: key); - - @override - _AddExaminationDailogState createState() => _AddExaminationDailogState(); -} - -class _AddExaminationDailogState extends State { - @override - Widget build(BuildContext context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: BaseView( - onModelReady: (model) async { - if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).physicalSystemExamination, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - MasterKeyCheckboxSearchWidget( - model: model, - hintSearchText: - TranslationBase.of(context).searchExamination, - buttonName: - TranslationBase.of(context).addExamination, - masterList: model.physicalExaminationList, - removeHistory: (history) { - setState(() { - widget.removeExamination(history); - }); - }, - addHistory: (history) { - setState(() { - MySelectedExamination mySelectedExamination = - new MySelectedExamination( - selectedExamination: history); - widget.mySelectedExamination - .add(mySelectedExamination); - }); - }, - addSelectedHistories: () { - widget.addSelectedExamination(); - }, - isServiceSelected: (master) => - isServiceSelected(master), - ), - ]), - ))), - )), - ); - } - - isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = widget.mySelectedExamination.where( - (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); - if (exam.length > 0) { - return true; - } - return false; - } -} diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 95d03cec..d6f75ad5 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_objective_page.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/widgets/shared/app-textfield-custom.dart b/lib/widgets/shared/app-textfield-custom.dart index 5cc6c417..caeb7ea2 100644 --- a/lib/widgets/shared/app-textfield-custom.dart +++ b/lib/widgets/shared/app-textfield-custom.dart @@ -9,6 +9,7 @@ class AppTextFieldCustom extends StatefulWidget { final String hintText; final TextEditingController controller; final bool isDropDown; + final bool hasBorder; final String dropDownText; final Icon suffixIcon; final Color dropDownColor; @@ -17,12 +18,14 @@ class AppTextFieldCustom extends StatefulWidget { final int minLines; final int maxLines; final List inputFormatters; + final Function(String) onChanged; AppTextFieldCustom({ this.height = 0, this.onClick, this.hintText, this.controller, + this.hasBorder = true, this.isDropDown = false, this.dropDownText, this.suffixIcon, @@ -32,6 +35,7 @@ class AppTextFieldCustom extends StatefulWidget { this.minLines = 1, this.maxLines = 1, this.inputFormatters, + this.onChanged, }); @override @@ -43,8 +47,9 @@ class _AppTextFieldCustomState extends State { Widget build(BuildContext context) { return Container( height: widget.height != 0 ? widget.height : null, - decoration: - containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF)), + decoration: widget.hasBorder + ? containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF)) + : null, padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), child: InkWell( onTap: widget.onClick ?? null, @@ -80,7 +85,17 @@ class _AppTextFieldCustomState extends State { enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [], + inputFormatters: widget.inputFormatters != null + ? widget.inputFormatters + : [], + onChanged: (value) { + if (widget.onChanged != null){ + widget.onChanged(value); + setState(() { + + }); + } + }, ) : AppText( widget.dropDownText, From 1fb594617a85679eaa16905fcdbb34f9681a0bff Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 7 Apr 2021 14:54:36 +0300 Subject: [PATCH 06/15] bug fixes --- lib/config/config.dart | 1 - lib/core/service/sickleave_service.dart | 6 +++-- lib/screens/dashboard_screen.dart | 20 +++++++------- lib/screens/patients/patients_screen.dart | 26 +++++++++---------- .../reschedule-leaves/reschedule_leave.dart | 10 +++++-- 5 files changed, 35 insertions(+), 28 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 59929f45..654f704a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -247,7 +247,6 @@ const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; - var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 8a5babd5..1ea8669a 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -136,8 +136,10 @@ class SickLeaveService extends BaseService { onSuccess: (dynamic response, int statusCode) { offTime = []; response['MasterLookUpList']['entityList'].forEach((item) => { - if (item['code'] == '1' || item['code'] == '2') - {offTime.add(item)} + //if (item['code'] == '1' || item['code'] == '2') + // { + offTime.add(item) + //}// }); }, onFailure: (String error, int statusCode) { diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 8714aaf8..b0c3bcde 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -801,7 +801,7 @@ class _DashboardScreenState extends State { MainAxisAlignment.start, children: [ AppText( - model.dashboardItemsList[4] + model.dashboardItemsList[6] .kPIName, fontSize: SizeConfig.textMultiplier * @@ -827,11 +827,11 @@ class _DashboardScreenState extends State { Axis.horizontal, children: new List.generate( model - .dashboardItemsList[4] + .dashboardItemsList[6] .summaryoptions .length, (int index) { return getActivityButton(model - .dashboardItemsList[4] + .dashboardItemsList[6] .summaryoptions[index]); }))) ], @@ -843,7 +843,7 @@ class _DashboardScreenState extends State { MainAxisAlignment.start, children: [ AppText( - model.dashboardItemsList[6] + model.dashboardItemsList[4] .kPIName, fontSize: SizeConfig.textMultiplier * @@ -869,11 +869,11 @@ class _DashboardScreenState extends State { Axis.horizontal, children: new List.generate( model - .dashboardItemsList[6] + .dashboardItemsList[4] .summaryoptions .length, (int index) { return getActivityButton(model - .dashboardItemsList[6] + .dashboardItemsList[4] .summaryoptions[index]); }))) ], @@ -1221,7 +1221,7 @@ class _DashboardScreenState extends State { Container( height: 150, margin: EdgeInsets.all(5), - width: ((SizeConfig.screenWidth * .55) / 5.3), + width: 40, child: SizedBox(), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.red[50]), @@ -1233,14 +1233,14 @@ class _DashboardScreenState extends State { margin: EdgeInsets.all(5), padding: EdgeInsets.all(10), height: max != 0 ? (150 * value.value) / max : 0, - width: ((SizeConfig.screenWidth * .55) / 5), + width: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.red[300]))), Container( height: 150, - margin: EdgeInsets.only(left: 10, top: 5), - padding: EdgeInsets.all(8), + margin: EdgeInsets.only(left: 5, top: 5), + padding: EdgeInsets.all(10), child: RotatedBox( quarterTurns: 1, child: Center( diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 28e4434f..62485f0d 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -226,11 +226,11 @@ class _PatientsScreenState extends State { Widget build(BuildContext context) { authProvider = Provider.of(context); _locations = [ - TranslationBase.of(context).all, TranslationBase.of(context).today, TranslationBase.of(context).tomorrow, TranslationBase.of(context).nextWeek, ]; + //TranslationBase.of(context).all, projectsProvider = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -449,18 +449,18 @@ class _PatientsScreenState extends State { }, )), Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context) - .size - .height * - 0.03), - child: _locationBar(context) - // child: SERVICES_PATIANT2[ - // int.parse(patientType)] == - // "List_MyOutPatient" - // ? _locationBar(context) - // : Container(), - ), + padding: EdgeInsets.only( + top: MediaQuery.of(context) + .size + .height * + 0.03), + // child: _locationBar(context) + child: SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? _locationBar(context) + : Container(), + ), // Row( // mainAxisAlignment: // MainAxisAlignment.spaceEvenly, diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 7af6b72c..e2959c75 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -104,13 +104,19 @@ class _RescheduleLeaveScreen extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); - + offTime = widget.updateData != null + ? widget.updateData.requisitionType.toString() + : offTime; return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( onModelReady: (model2) => { model2.getOffTime(), - model2.getReasons(18), + model2.getReasons(offTime == '1' + ? 18 + : offTime == '2' + ? 19 + : 102), model2.getCoveringDoctors() }, builder: (_, model2, w) => GestureDetector( From 518b09454b8d3d40271af6ea6b5f54c14cb4ee88 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 7 Apr 2021 15:15:35 +0300 Subject: [PATCH 07/15] fix small bug --- .../master_key_checkbox_search_widget.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index a5b03a33..abe383e3 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -104,14 +104,14 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Wed, 7 Apr 2021 15:18:35 +0300 Subject: [PATCH 08/15] fix small issue in file path --- lib/widgets/patients/profile/soap_update/update_soap_index.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index d6f75ad5..66487a6e 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -9,13 +9,13 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../patient-profile-header-new-design.dart'; +import 'objective/update_objective_page.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; From aeecc12cbe8ab11cc0c54ccd7311a6038bd607dc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 15:39:23 +0300 Subject: [PATCH 09/15] fix bug --- .../objective/examination-item-card.dart | 15 +++-- .../objective/update_objective_page.dart | 60 +++++++++++-------- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart b/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart index ff5d0a6c..903dc69c 100644 --- a/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart +++ b/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart @@ -19,6 +19,7 @@ class ExaminationIitemCard extends StatelessWidget { return Container( color: Colors.white, padding: EdgeInsets.all(8), + margin: EdgeInsets.only(bottom: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -77,14 +78,12 @@ class ExaminationIitemCard extends StatelessWidget { SizedBox( height: 4, ), - Expanded( - child: AppText( - examination.remark, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - color: Colors.grey.shade500, - fontSize: SizeConfig.textMultiplier * 1.8, - ), + AppText( + examination.remark, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + color: Colors.grey.shade500, + fontSize: SizeConfig.textMultiplier * 1.8, ), ], ), diff --git a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart index ba9368bb..9a8146f5 100644 --- a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart @@ -134,7 +134,7 @@ class _UpdateObjectivePageState extends State { HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Row( children: [ @@ -142,7 +142,7 @@ class _UpdateObjectivePageState extends State { "${TranslationBase.of(context).physicalSystemExamination}", fontFamily: 'Poppins', fontSize: - SizeConfig.textMultiplier * 2.0, + SizeConfig.textMultiplier * 2.0, fontWeight: isSysExaminationExpand ? FontWeight.w700 : FontWeight.normal, @@ -158,7 +158,7 @@ class _UpdateObjectivePageState extends State { onTap: () { setState(() { isSysExaminationExpand = - !isSysExaminationExpand; + !isSysExaminationExpand; }); }, child: Icon(isSysExaminationExpand @@ -176,7 +176,7 @@ class _UpdateObjectivePageState extends State { padding: EdgeInsets.symmetric( vertical: 8, horizontal: 8.0), margin: - EdgeInsets.symmetric(vertical: 8), + EdgeInsets.symmetric(vertical: 8), decoration: BoxDecoration( border: Border.all( color: Colors.grey.shade400, @@ -188,33 +188,33 @@ class _UpdateObjectivePageState extends State { ), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Expanded( child: Column( - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).addExamination}", - fontSize: SizeConfig + children: [ + AppText( + "${TranslationBase.of(context).addExamination}", + fontSize: SizeConfig .textMultiplier * - 1.8, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize: SizeConfig + 1.8, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize: SizeConfig .textMultiplier * - 1.8, - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - ), - ], - )), + 1.8, + color: Colors.grey.shade700, + fontWeight: FontWeight.bold, + ), + ], + )), Icon( Icons.add_box_rounded, size: 25, @@ -223,6 +223,18 @@ class _UpdateObjectivePageState extends State { ), ), ), + /* ...List.generate( + widget.mySelectedExamination.length, + (index) => Container( + child: ExaminationIitemCard( + widget.mySelectedExamination[ + index], () { + removeExamination(widget + .mySelectedExamination[ + index] + .selectedExamination); + }), + )),*/ Column( children: widget.mySelectedExamination .map((examination) { From ef64c39a5f0182ce132cbdc0b2cfbb395f02e684 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 15:47:36 +0300 Subject: [PATCH 10/15] hot fix --- lib/widgets/patients/profile/profile_medical_info_widget.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 712648cc..6b9c5015 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -121,6 +121,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: PATIENT_ADMISSION_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), @@ -169,6 +170,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, + isDisable: patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), @@ -189,6 +191,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: PATIENT_UCAF_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, icon: 'patient/ucaf.png'), From 3ca9f33df4a9ebe6df18f85c8922492115614318 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 7 Apr 2021 16:12:13 +0300 Subject: [PATCH 11/15] bug fix --- lib/screens/sick-leave/add-sickleave.dart | 125 +++++++++++----------- 1 file changed, 64 insertions(+), 61 deletions(-) diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 5c0ad3f4..1c7199fa 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -35,69 +35,72 @@ class AddSickLeavScreen extends StatelessWidget { child: Column(children: [ PatientProfileHeaderNewDesign( patient, routeArgs['patientType'], routeArgs['arrivalType']), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).patient, - fontWeight: FontWeight.bold, - ), - AppText( - TranslationBase.of(context).sickLeave, - fontSize: 24, - fontWeight: FontWeight.bold, - ), - ], - )), - Container( - width: SizeConfig.screenWidth, - margin: EdgeInsets.only( - left: 20, right: 20, top: 10, bottom: 10), - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: HexColor('#EAEAEA')), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: Container( + patient.patientStatusType == 43 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patient, + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).sickLeave, + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ], + )), + Container( + width: SizeConfig.screenWidth, + margin: EdgeInsets.only( + left: 20, right: 20, top: 10, bottom: 10), + padding: EdgeInsets.all(20), decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(10)), - padding: EdgeInsets.all(3), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - color: Colors.white, + borderRadius: BorderRadius.circular(10), + color: HexColor('#EAEAEA')), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(10)), + padding: EdgeInsets.all(3), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + color: Colors.white, + ), + onPressed: () { + openSickLeave( + context, + false, + ); + }), + )), + Padding( + child: AppText( + TranslationBase.of(context) + .noSickLeaveApplied, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 16, + textAlign: TextAlign.center, + color: HexColor('#7E7E7E')), + padding: EdgeInsets.all(10), ), - onPressed: () { - openSickLeave( - context, - false, - ); - }), - )), - Padding( - child: AppText( - TranslationBase.of(context).noSickLeaveApplied, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 16, - textAlign: TextAlign.center, - color: HexColor('#7E7E7E')), - padding: EdgeInsets.all(10), - ), - ], - )), - ], - ), + ], + )), + ], + ) + : SizedBox(), model.getAllSIckLeave.length > 0 ? Column( children: model.getAllSIckLeave From b735a69a4f0e7c699e2326713017a557abdee9f4 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 16:53:01 +0300 Subject: [PATCH 12/15] bug fixes --- .../referral/my-referral-detail-screen.dart | 1 + .../referral/my-referral-patient-screen.dart | 8 ++---- .../patient-referral-item-widget.dart | 28 +++++++++++-------- ...ent-profile-header-new-design-app-bar.dart | 2 +- .../patient-profile-header-new-design.dart | 2 +- ..._profile_header_with_appointment_card.dart | 2 +- ..._header_with_appointment_card_app_bar.dart | 2 +- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index a4510907..d1800285 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -17,6 +17,7 @@ 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/borderedButton.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'; diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index e6cccf48..986cf54f 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widg import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; import '../../../../routes.dart'; @@ -74,11 +75,8 @@ class MyReferralPatientScreen extends StatelessWidget { 'referral': model.pendingReferral[index] }); }, - child: Icon( - Icons.info_outline, - color: Colors.black, - size: 30, - ), + child: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), ), ), ), diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 1404f9af..1ce84387 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -463,36 +463,41 @@ class PatientReferralItemWidget extends StatelessWidget { width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 10 /*10:85*/, - right: projectViewModel.isArabic ? 10 : 10 /*85:10*/, + left: + projectViewModel.isArabic ? 10 : 10 /*10:85*/, + right: + projectViewModel.isArabic ? 10 : 10 /*85:10*/, top: 5), decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( - bottom: - BorderSide(color: Colors.grey[400], width: 2.5), - left: - BorderSide(color: Colors.grey[400], width: 2.5), + bottom: BorderSide( + color: Colors.grey[400], width: 2.5), + left: BorderSide( + color: Colors.grey[400], width: 2.5), )), ), Expanded( flex: 4, child: Container( - margin: EdgeInsets.only(left: 10, top: 25, right : 10, bottom: 0), + margin: EdgeInsets.only( + left: 10, top: 25, right: 10, bottom: 0), child: Column( children: [ RichText( text: TextSpan( style: TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: + 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ TextSpan( text: TranslationBase.of(context) - .referralDoctor + + .referralDoctor + " : ", style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), + fontSize: 14, + fontFamily: 'Poppins')), TextSpan( text: referralDoctorName, style: TextStyle( @@ -511,8 +516,7 @@ class PatientReferralItemWidget extends StatelessWidget { Container( width: double.infinity, alignment: Alignment.centerRight, - child: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black)) + child: infoIcon ?? Container()) ], ), // onTap: onTap, diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index d49798f4..3ac6888e 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -116,7 +116,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1' + arrivalType == '1'|| patient.arrivedOn == null ? AppText( patient.startTime != null ? patient.startTime diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 4f96ac67..1716c7ee 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -116,7 +116,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1' + arrivalType == '1' || patient.arrivedOn == null ? AppText( patient.startTime != null ? patient.startTime diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart index 61cb7b52..beb247a9 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -150,7 +150,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { 'Poppins', fontSize: 12, ), - arrivalType == '1' + arrivalType == '1' || patient.arrivedOn == null ? AppText( patient.startTime != null diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index d63754df..a00ae6ef 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -150,7 +150,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre 'Poppins', fontSize: 12, ), - arrivalType == '1' + arrivalType == '1' || patient.arrivedOn == null ? AppText( patient.startTime != null From 583e06c5f21c4ccdf5330c6a02560c4abbb7133c Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 18:00:00 +0300 Subject: [PATCH 13/15] re-design --- .../profile/profile_medical_info_widget.dart | 141 ++++++------------ .../profile_medical_info_widget_search.dart | 68 ++++----- .../objective/update_objective_page.dart | 62 ++++---- 3 files changed, 116 insertions(+), 155 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 6b9c5015..3dc153e4 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -43,34 +43,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget { childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ - /*if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - isDisable: patient.episodeNo != 0 ? true : false, - nameLine1: TranslationBase.of(context).createNew, - nameLine2: TranslationBase.of(context).episode, - route: CREATE_EPISODE, - onTap: () async { - PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( - appointmentNo: patient.appointmentNo, - patientMRN: patient.patientMRN); - await model.postEpisode(postEpisodeReqModel); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed(CREATE_EPISODE, - arguments: {'patient': patient}); - }, - isLoading: model.state == ViewState.BusyLocal, - icon: 'create-episod.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - isDisable: patient.episodeNo == 0 ? true : false, - nameLine1: TranslationBase.of(context).update, - nameLine2: TranslationBase.of(context).episode, - route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'),*/ if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -89,61 +61,38 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + route: MEDICAL_FILE, + nameLine1: TranslationBase.of(context).previewHealth, + nameLine2: TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: TranslationBase.of(context).previewHealth, - nameLine2: TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - if (selectedPatientType != 0 && - selectedPatientType != 5 && - selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - // (int.parse(patientType) == 7 || int.parse(patientType) == 6) - // ? PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: ORDER_PRESCRIPTION, - // nameLine1: TranslationBase.of(context).orders, - // nameLine2: TranslationBase.of(context).prescription, - // icon: 'patient/order_prescription.png') - // : PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: ORDER_PRESCRIPTION_HISTORY, - // nameLine1: TranslationBase.of(context).orders, - // nameLine2: TranslationBase.of(context).prescription, - // icon: 'patient/order_prescription.png'), + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), PatientProfileButton( key: key, patient: patient, @@ -169,11 +118,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).myReferral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -201,29 +149,34 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + route: REFER_PATIENT_TO_DOCTOR, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).myReferral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + route: PATIENT_ADMISSION_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + if (selectedPatientType != 0 && + selectedPatientType != 5 && + selectedPatientType != 7) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), ], ), ); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index c49c4576..41ec8f77 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -39,19 +39,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + route: MEDICAL_FILE, + nameLine1: TranslationBase.of(context).previewHealth, + nameLine2: TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), PatientProfileButton( key: key, patient: patient, @@ -66,19 +68,19 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // route: PATIENT_ADMISSION_REQUEST, - // nameLine1: TranslationBase.of(context).admission, - // nameLine2: TranslationBase.of(context).request, - // icon: 'heartbeat.png'), + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), (int.parse(patientType) == 7 || int.parse(patientType) == 6) ? PatientProfileButton( key: key, @@ -103,19 +105,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: TranslationBase.of(context).previewHealth, - nameLine2: TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), PatientProfileButton( key: key, patient: patient, @@ -125,6 +118,13 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'patient/patient_sick_leave.png'), + // 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, diff --git a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart index 9a8146f5..e8c3b831 100644 --- a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart @@ -134,7 +134,7 @@ class _UpdateObjectivePageState extends State { HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Row( children: [ @@ -142,7 +142,7 @@ class _UpdateObjectivePageState extends State { "${TranslationBase.of(context).physicalSystemExamination}", fontFamily: 'Poppins', fontSize: - SizeConfig.textMultiplier * 2.0, + SizeConfig.textMultiplier * 2.0, fontWeight: isSysExaminationExpand ? FontWeight.w700 : FontWeight.normal, @@ -158,7 +158,7 @@ class _UpdateObjectivePageState extends State { onTap: () { setState(() { isSysExaminationExpand = - !isSysExaminationExpand; + !isSysExaminationExpand; }); }, child: Icon(isSysExaminationExpand @@ -176,7 +176,7 @@ class _UpdateObjectivePageState extends State { padding: EdgeInsets.symmetric( vertical: 8, horizontal: 8.0), margin: - EdgeInsets.symmetric(vertical: 8), + EdgeInsets.symmetric(vertical: 8), decoration: BoxDecoration( border: Border.all( color: Colors.grey.shade400, @@ -188,33 +188,33 @@ class _UpdateObjectivePageState extends State { ), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Expanded( child: Column( - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).addExamination}", - fontSize: SizeConfig + children: [ + AppText( + "${TranslationBase.of(context).addExamination}", + fontSize: SizeConfig .textMultiplier * - 1.8, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize: SizeConfig + 1.8, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize: SizeConfig .textMultiplier * - 1.8, - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - ), - ], - )), + 1.8, + color: Colors.grey.shade700, + fontWeight: FontWeight.bold, + ), + ], + )), Icon( Icons.add_box_rounded, size: 25, @@ -223,7 +223,7 @@ class _UpdateObjectivePageState extends State { ), ), ), - /* ...List.generate( + /* ...List.generate( widget.mySelectedExamination.length, (index) => Container( child: ExaminationIitemCard( @@ -278,8 +278,16 @@ class _UpdateObjectivePageState extends State { child: AppButton( title: TranslationBase.of(context).next, loading: model.state == ViewState.BusyLocal, - color: HexColor("#A5A5A5"), - fontColor: HexColor("#5A5A5A"), + color: widget.mySelectedExamination != null && + widget.mySelectedExamination.length > 0 + ? HexColor("#D02127") + : HexColor("#A5A5A5"), + fontColor: widget.mySelectedExamination != null && + widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"), + disabled: widget.mySelectedExamination != null && + widget.mySelectedExamination.length > 0 + ? false + : true, fontWeight: FontWeight.bold, onPressed: () async { await submitUpdateObjectivePage(model); From e7fdf984f50ea4d66032be91c77018bffd26dd78 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 18:14:13 +0300 Subject: [PATCH 14/15] hot fix --- .../profile/profile_medical_info_widget.dart | 4 +--- .../profile_medical_info_widget_search.dart | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 3dc153e4..512e6d49 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -165,9 +165,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), - if (selectedPatientType != 0 && - selectedPatientType != 5 && - selectedPatientType != 7) + if (patientType == "1") PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 41ec8f77..3b5896f8 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -125,15 +125,16 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { // nameLine1: TranslationBase.of(context).admission, // nameLine2: TranslationBase.of(context).request, // icon: 'heartbeat.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + if (patientType == "1") + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), ], ), ); From 7f440a2d8acba4b4f7d6471817267b8888f8257c Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 18:56:00 +0300 Subject: [PATCH 15/15] fix soap screen height --- .../patient-profile-header-new-design.dart | 5 +- .../profile/soap_update/steps_widget.dart | 7 +- .../soap_update/update_soap_index.dart | 160 ++++++++---------- 3 files changed, 78 insertions(+), 94 deletions(-) diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 1716c7ee..922b1fe1 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -14,9 +14,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; + final double height; PatientProfileHeaderNewDesign( - this.patient, this.patientType, this.arrivalType); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); @override Widget build(BuildContext context) { @@ -36,7 +37,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, ), - height: 200, + height: height == 0 ? 200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 88c47706..2e2c77c0 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -9,8 +9,9 @@ import 'package:provider/provider.dart'; class StepsWidget extends StatelessWidget { final int index; final Function changeCurrentTab; + final double height; - StepsWidget({Key key, this.index, this.changeCurrentTab}); + StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0}); // TODO : Add translation to name @override @@ -20,7 +21,7 @@ class StepsWidget extends StatelessWidget { ? Stack( children: [ Container( - height: 150, + height: height == 0 ? 150 : height, width: MediaQuery.of(context).size.width, color: Colors.transparent, child: Center( @@ -243,7 +244,7 @@ class StepsWidget extends StatelessWidget { : Stack( children: [ Container( - height: 150, + height: height == 0 ? 150 : height, width: MediaQuery .of(context) .size diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 66487a6e..b14a0479 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -35,7 +35,9 @@ class _UpdateSoapIndexState extends State List mySelectedExamination = List(); List mySelectedAssessment = List(); - GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); + GetPatientProgressNoteResModel patientProgressNote = + GetPatientProgressNoteResModel(); + changePageViewIndex(pageIndex) { if (pageIndex != _currentIndex) changeLoadingState(true); _controller.jumpToPage(pageIndex); @@ -67,96 +69,76 @@ class _UpdateSoapIndexState extends State isLoading: _isLoading, isShowAppBar: false, // appBarTitle: TranslationBase.of(context).healthRecordInformation, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - boxShadow: [], - color: Theme.of(context).scaffoldBackgroundColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - // PatientPageHeaderWidget(patient), - PatientProfileHeaderNewDesign(patient, '7', '7'), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + // TODO mousa removed the singleChildScrollView + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + margin: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.05, + right: MediaQuery.of(context).size.width * 0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + height: MediaQuery.of(context).size.height * 0.21, ), - FractionallySizedBox( - child: SingleChildScrollView( - child: Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.75, - child: Column( - children: [ - Container( - margin: EdgeInsets.only( - left: MediaQuery.of(context).size.width * - 0.05, - right: MediaQuery.of(context).size.width * - 0.05), - child: StepsWidget( - index: _currentIndex, - changeCurrentTab: changePageViewIndex, - ), - ), - Expanded( - child: PageView( - - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - changeLoadingState: changeLoadingState - ), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - mySelectedExamination: - mySelectedExamination, - patientInfo: patient, - changeLoadingState: changeLoadingState - ), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - mySelectedAssessmentList: - mySelectedAssessment, - patientInfo: patient, - changeLoadingState: changeLoadingState - - ), - UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - patientInfo: patient, - patientProgressNote: patientProgressNote, - changeLoadingState: changeLoadingState - - ) - ], - ), - ), - ], - ), - ), - ), - ) - ], - ), + ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + height: MediaQuery.of(context).size.height * 0.50, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + mySelectedExamination: mySelectedExamination, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + mySelectedAssessmentList: mySelectedAssessment, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + patientInfo: patient, + patientProgressNote: patientProgressNote, + changeLoadingState: changeLoadingState) + ], + ), + ) + ], ), - ], - ), + ), + ], ), ), );