diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b0e694a8..80e9d656 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': "أضف الحساسية"}, @@ -829,6 +829,8 @@ const Map> localizedValues = { "typeHereToReply": { "en": "Type here to reply", "ar": "اكتب هنا للرد" + },"remove": { + "en": "Remove", + "ar": "حذف" }, - "remove": {"en": "Remove", "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 57eb065b..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 @@ -37,9 +38,10 @@ class ExpandableSOAPWidget extends StatelessWidget { children: [ Texts(headerTitle, variant: isExpanded ? "bodyText" : '', - bold: isExpanded ? true : false, + // 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/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_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..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 @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/config/config.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/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -17,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; @@ -51,20 +53,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 +90,41 @@ 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), ) @@ -142,111 +166,29 @@ 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), + ), ); }); } } -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; @@ -267,7 +209,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) { @@ -288,20 +230,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, @@ -381,9 +369,9 @@ class _AddHistoryDialogState extends State { ], ), ), + ), ], - ), - )), + )), ), ), )); 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/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; 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 dd9e2f3d..abe383e3 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,80 +51,103 @@ class _MasterKeyCheckboxSearchWidgetState extends State