From 1330d680ab17942e1d4fb3f8a47299e43808f406 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 7 Apr 2021 15:12:05 +0300 Subject: [PATCH 01/19] fix allergies --- .../subjective/update_allergies_widget.dart | 576 ++++++++++-------- ..._key_checkbox_search_allergies_widget.dart | 499 +++++++++++++++ 2 files changed, 833 insertions(+), 242 deletions(-) create mode 100644 lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart 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 c00daa6b..b7f5187e 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 @@ -13,6 +13,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_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'; @@ -193,42 +195,9 @@ class _UpdateAllergiesWidgetState extends State { context: context, builder: (context) { return AddAllergies( - addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { - if (mySelectedAllergy.selectedAllergySeverity == null || - mySelectedAllergy.selectedAllergy == null) { - helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); - - } else { - setState(() { - List allergy = - // ignore: missing_return - widget.myAllergiesList - .where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id) - .toList(); - - if (allergy.isEmpty) { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); - } else { - allergy.first.selectedAllergy = - mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; - allergy.first.remark = mySelectedAllergy.remark; - allergy.first.isChecked = mySelectedAllergy.isChecked; - Navigator.of(context).pop(); - - // helpers.showErrorToast(TranslationBase - // .of(context) - // .itemExist); - } - }); - } - },); + myAllergiesList: widget.myAllergiesList, + addAllergiesFun: (){} + ); }); } @@ -236,8 +205,9 @@ class _UpdateAllergiesWidgetState extends State { class AddAllergies extends StatefulWidget { final Function addAllergiesFun; + final List myAllergiesList; - const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); + const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key); @override _AddAllergiesState createState() => _AddAllergiesState(); @@ -251,7 +221,13 @@ class _AddAllergiesState extends State { TextEditingController remarkController = TextEditingController(); TextEditingController severityController = TextEditingController(); TextEditingController allergyController = TextEditingController(); + List myAllergiesListLocal; + @override + initState(){ + super.initState(); + myAllergiesListLocal = [...widget.myAllergiesList]; + } GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @@ -291,7 +267,7 @@ class _AddAllergiesState extends State { .of(context) .size; return FractionallySizedBox( - heightFactor: 0.7, + heightFactor: 1, child: BaseView( onModelReady: (model) async { if (model.allergiesList.length == 0) { @@ -305,220 +281,336 @@ class _AddAllergiesState extends State { AppScaffold( baseViewModel: model, isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - SizedBox( - height: 16, - ), - AppText( - TranslationBase - .of(context) - .addAllergies, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allergiesList != null - ? () { - setState(() { - _selectedAllergy = null; - allergyController.text = null; - }); - } - : null, - child: _selectedAllergy==null? AutoCompleteTextField( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .selectAllergy, - _selectedAllergy != null - ? _selectedAllergy.nameEn - : null, true, icon: EvaIcons.search), - itemSubmitted: (item) => - setState(() { - _selectedAllergy = item; - allergyController.text = - projectViewModel.isArabic - ? _selectedAllergy - .nameAr - : _selectedAllergy - .nameEn; - }), - key: key, - suggestions: model.allergiesList, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts( - projectViewModel.isArabic ? suggestion - .nameAr : suggestion.nameEn), - padding: EdgeInsets.all(2.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.nameAr.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.nameEn.toLowerCase() - .startsWith(input.toLowerCase()), - ) : - TextFields( - onTapTextFields: model.allergiesList != null - ? () { - setState(() { - _selectedAllergy = null; - allergyController.text = null; - }); - } - : null, - hasLabelText: allergyController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .selectAllergy, - fontSize: 13.5, - readOnly: true, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: allergyController, - suffixIcon: EvaIcons.search, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }) - ), - ), - if(isFormSubmitted && _selectedAllergy == null) - CustomValidationError(), - SizedBox( - height: 10, - ), - TextFields( - onTapTextFields: model - .allergySeverityList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.allergySeverityList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedAllergySeverity = - selectedValue; - - severityController.text = - projectViewModel.isArabic - ? _selectedAllergySeverity - .nameAr - : _selectedAllergySeverity - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: severityController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .selectSeverity, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: severityController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), SizedBox( - height: 5, - ), - if(isFormSubmitted && - _selectedAllergySeverity == null) - CustomValidationError(), + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ - SizedBox( - height: 10, + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hasLabelText: remarkController.text != ''?true:false, - showLabelText: true, - hintText: TranslationBase.of(context).remarks, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 10, - controller: remarkController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), SizedBox( - height: 10, + 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). + addAllergies, + 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))) + ], + ), + ], + ), ), - AppButton( - title: TranslationBase.of(context).add.toUpperCase(), - onPressed: () { - setState(() { - isFormSubmitted = true; - }); - if(_selectedAllergy !=null && _selectedAllergySeverity !=null) { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - remark: remarkController.text, - selectedAllergy: _selectedAllergy, - isChecked: true, - selectedAllergySeverity: _selectedAllergySeverity,); - widget.addAllergiesFun(mySelectedAllergy); - } - - }, + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchAllergiesWidget( + model: model, + masterList: model.allergiesList, + removeAllergy: (history){ + setState(() { + // widget.allergie(history); + }); + }, + addAllergy: (MySelectedAllergy mySelectedAllergy){ + AddAllergyLocally(mySelectedAllergy); + }, + addSelectedAllergy: (){ + // widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), + ), + ), + ), + ), ), - ] + ), + // Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: model.allergiesList != null + // ? () { + // setState(() { + // _selectedAllergy = null; + // allergyController.text = null; + // }); + // } + // : null, + // child: _selectedAllergy==null? AutoCompleteTextField( + // decoration: textFieldSelectorDecoration( + // TranslationBase + // .of(context) + // .selectAllergy, + // _selectedAllergy != null + // ? _selectedAllergy.nameEn + // : null, true, icon: EvaIcons.search), + // itemSubmitted: (item) => + // setState(() { + // _selectedAllergy = item; + // allergyController.text = + // projectViewModel.isArabic + // ? _selectedAllergy + // .nameAr + // : _selectedAllergy + // .nameEn; + // }), + // key: key, + // suggestions: model.allergiesList, + // itemBuilder: (context, suggestion) => + // new Padding( + // child: Texts( + // projectViewModel.isArabic ? suggestion + // .nameAr : suggestion.nameEn), + // padding: EdgeInsets.all(2.0)), + // itemSorter: (a, b) => 1, + // itemFilter: (suggestion, input) => + // suggestion.nameAr.toLowerCase().startsWith( + // input.toLowerCase()) || + // suggestion.nameEn.toLowerCase() + // .startsWith(input.toLowerCase()), + // ) : + // TextFields( + // onTapTextFields: model.allergiesList != null + // ? () { + // setState(() { + // _selectedAllergy = null; + // allergyController.text = null; + // }); + // } + // : null, + // hasLabelText: allergyController.text != + // '' ? true : false, + // showLabelText: true, + // hintText: TranslationBase + // .of(context) + // .selectAllergy, + // fontSize: 13.5, + // readOnly: true, + // fontWeight: FontWeight.w600, + // maxLines: 2, + // minLines: 1, + // controller: allergyController, + // suffixIcon: EvaIcons.search, + // validator: (value) { + // if (value == null) + // return TranslationBase + // .of(context) + // .emptyMessage; + // else + // return null; + // }) + // ), + // ), + // if(isFormSubmitted && _selectedAllergy == null) + // CustomValidationError(), + // SizedBox( + // height: 10, + // ), + // TextFields( + // onTapTextFields: model + // .allergySeverityList != null + // ? () { + // MasterKeyDailog dialog = MasterKeyDailog( + // list: model.allergySeverityList, + // okText: TranslationBase + // .of(context) + // .ok, + // okFunction: (selectedValue) { + // setState(() { + // _selectedAllergySeverity = + // selectedValue; + // + // severityController.text = + // projectViewModel.isArabic + // ? _selectedAllergySeverity + // .nameAr + // : _selectedAllergySeverity + // .nameEn; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: (BuildContext context) { + // return dialog; + // }, + // ); + // } + // : null, + // hasLabelText: severityController.text != + // '' ? true : false, + // showLabelText: true, + // hintText: TranslationBase + // .of(context) + // .selectSeverity, + // fontSize: 13.5, + // readOnly: true, + // // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + // maxLines: 2, + // minLines: 1, + // controller: severityController, + // validator: (value) { + // if (value == null) + // return TranslationBase + // .of(context) + // .emptyMessage; + // else + // return null; + // }), SizedBox( + // height: 5, + // ), + // if(isFormSubmitted && + // _selectedAllergySeverity == null) + // CustomValidationError(), + // + // SizedBox( + // height: 10, + // ), + // Container( + // margin: EdgeInsets.only( + // left: 0, right: 0, top: 15), + // child: TextFields( + // hasLabelText: remarkController.text != ''?true:false, + // showLabelText: true, + // hintText: TranslationBase.of(context).remarks, + // fontSize: 13.5, + // // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + // maxLines: 25, + // minLines: 10, + // controller: remarkController, + // validator: (value) { + // if (value == null) + // return TranslationBase + // .of(context) + // .emptyMessage; + // else + // return null; + // }), + // ), SizedBox( + // height: 10, + // ), + // AppButton( + // title: TranslationBase.of(context).add.toUpperCase(), + // onPressed: () { + // setState(() { + // isFormSubmitted = true; + // }); + // if(_selectedAllergy !=null && _selectedAllergySeverity !=null) { + // MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + // remark: remarkController.text, + // selectedAllergy: _selectedAllergy, + // isChecked: true, + // selectedAllergySeverity: _selectedAllergySeverity,); + // widget.addAllergiesFun(mySelectedAllergy); + // } + // + // }, + // ), + ] - ), ), ), - )), + ) + + ), ), ); } + + isServiceSelected(MasterKeyModel masterKey) { + Iterable history = + myAllergiesListLocal.where((element) => + masterKey.id == element.selectedAllergy.id && + masterKey.typeId == element.selectedAllergy.typeId && + element.isChecked); + if (history.length > 0) { + return true; + } + return false; + } + + AddAllergyLocally(MySelectedAllergy mySelectedAllergy) { + if ( + mySelectedAllergy.selectedAllergy == null) { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); + + } else { + setState(() { + List allergy = + // ignore: missing_return + myAllergiesListLocal + .where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) + .toList(); + + if (allergy.isEmpty) { + myAllergiesListLocal.add(mySelectedAllergy); + // Navigator.of(context).pop(); + } else { + allergy.first.selectedAllergy = + mySelectedAllergy.selectedAllergy; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; + allergy.first.remark = mySelectedAllergy.remark; + allergy.first.isChecked = mySelectedAllergy.isChecked; + // Navigator.of(context).pop(); + + // helpers.showErrorToast(TranslationBase + // .of(context) + // .itemExist); + } + }); + }} + } diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart new file mode 100644 index 00000000..99a012c9 --- /dev/null +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -0,0 +1,499 @@ +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/project_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'app_texts_widget.dart'; +import 'dialogs/master_key_dailog.dart'; + +class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { + final SOAPViewModel model; + final Function addSelectedAllergy; + final Function(MasterKeyModel) removeAllergy; + final Function(MySelectedAllergy mySelectedAllergy) addAllergy; + final bool Function(MasterKeyModel) isServiceSelected; + final List masterList; + final String buttonName; + final String hintSearchText; + + MasterKeyCheckboxSearchAllergiesWidget( + {Key key, + this.model, + this.addSelectedAllergy, + this.removeAllergy, + this.masterList, + this.addAllergy, + this.isServiceSelected, + this.buttonName, + this.hintSearchText}) + : super(key: key); + + @override + _MasterKeyCheckboxSearchAllergiesWidgetState createState() => + _MasterKeyCheckboxSearchAllergiesWidgetState(); +} + +class _MasterKeyCheckboxSearchAllergiesWidgetState + extends State { + List items = List(); + MasterKeyModel _selectedAllergySeverity; + + @override + void initState() { + items.addAll(widget.masterList); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + child: Column( + children: [ + Expanded( + child: Container( + height: MediaQuery.of(context).size.height * 0.62, + child: Center( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + TextFields( + hintText: widget.hintSearchText ?? + TranslationBase.of(context).selectAllergy, + borderWidth: 0.0, + padding: EdgeInsets.all(20), + borderRadius: 0, + suffixIcon: EvaIcons.search, + onChanged: (value) { + filterSearchResults(value); + }, + ), + SizedBox( + height: 10, + ), + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + height: MediaQuery.of(context).size.height * 0.60, + child: ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) { + TextEditingController remarkController = TextEditingController(text: items[index].remarks); + TextEditingController severityController = TextEditingController(text: _selectedAllergySeverity!= null ?projectViewModel + .isArabic + ? _selectedAllergySeverity + .nameAr + : _selectedAllergySeverity + .nameEn: null); + return Column( + children: [ + InkWell( + onTap: () { + setState(() { + if (widget.isServiceSelected( + items[index])) { + widget + .removeAllergy(items[index]); + } else { + // TODO add Allergy + + MySelectedAllergy + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, remark: "fdfdf", isChecked: true); + widget.addAllergy(mySelectedAllergy); + } + }); + }, + child: Column( + children: [ + Row( + children: [ + Checkbox( + value: widget + .isServiceSelected( + items[index]), + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + // setState(() { + // if (widget + // .isServiceSelected(items[index])) { + // widget.removeHistory(items[index]); + // } else { + // widget.addHistory(items[index]); + // } + // }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: AppText( + projectViewModel.isArabic + ? items[index] + .nameAr != + "" + ? items[index] + .nameAr + : items[index] + .nameEn + : items[index].nameEn, + color: Color(0xFF575757), + fontSize: 16, + fontWeight: + FontWeight.w600, + ), + ), + ), + ], + ), + if(widget + .isServiceSelected( + items[index])) + Column(children: [ + TextFields( + onTapTextFields: widget.model + .allergySeverityList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: widget.model + .allergySeverityList, + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + _selectedAllergySeverity = + selectedValue; + + severityController + .text = projectViewModel + .isArabic + ? _selectedAllergySeverity + .nameAr + : _selectedAllergySeverity + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, + hasLabelText: + severityController.text != + '' + ? true + : false, + showLabelText: true, + hintText: + TranslationBase.of(context) + .selectSeverity, + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: severityController, + validator: (value) { + if (value == null) + return TranslationBase.of( + context) + .emptyMessage; + else + return null; + }), + SizedBox( + height: 5, + ), + // if(isFormSubmitted && + // _selectedAllergySeverity == null) + // CustomValidationError(), + + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hasLabelText: + remarkController.text != + '' + ? true + : false, + showLabelText: true, + hintText: TranslationBase.of( + context) + .remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 10, + controller: remarkController, + validator: (value) { + if (value == null) + return TranslationBase.of( + context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ],) + ], + ), + ), + // DividerWithSpacesAround(), + ], + ); + }, + ), + ), + ), + ], + ) + // ListView( + // children: [ + // TextFields( + // hintText: widget.hintSearchText ?? + // TranslationBase.of(context).searchHistory, + // borderWidth: 0.0, + // padding: EdgeInsets.all(20), + // borderRadius: 0, + // suffixIcon: EvaIcons.search, + // onChanged: (value) { + // filterSearchResults(value); + // }, + // ), + // // SizedBox(height: 15,), + // DividerWithSpacesAround(), + // + // + // // Container( + // // // padding:EdgeInsets.all(20), + // // child: Column( + // // children: items.map((historyInfo) { + // // return Column( + // // children: [ + // // InkWell( + // // onTap:(){ + // // + // // setState(() { + // // if (widget + // // .isServiceSelected(historyInfo)) { + // // widget.removeHistory(historyInfo); + // // } else { + // // widget.addHistory(historyInfo); + // // } + // // }); + // // }, + // // + // // child: Column( + // // children: [ + // // Row( + // // children: [ + // // Checkbox( + // // value:true, + // // // widget.isServiceSelected(historyInfo), + // // activeColor: Colors.red[800], + // // onChanged: (bool newValue) { + // // // setState(() { + // // // if (widget + // // // .isServiceSelected(historyInfo)) { + // // // widget.removeHistory(historyInfo); + // // // } else { + // // // widget.addHistory(historyInfo); + // // // } + // // // }); + // // }), + // // Expanded( + // // child: Padding( + // // padding: const EdgeInsets.symmetric( + // // horizontal: 10, vertical: 0), + // // child: AppText(projectViewModel.isArabic + // // ? historyInfo.nameAr!=""?historyInfo.nameAr:historyInfo.nameEn + // // : historyInfo.nameEn, + // // color: Color(0xFF575757), + // // fontSize: 16, + // // fontWeight:FontWeight.w600, + // // ), + // // ), + // // ), + // // ], + // // ), + // // TextFields( + // // onTapTextFields: widget.model + // // .allergySeverityList != null + // // ? () { + // // MasterKeyDailog dialog = MasterKeyDailog( + // // list: widget.model.allergySeverityList, + // // okText: TranslationBase + // // .of(context) + // // .ok, + // // okFunction: (selectedValue) { + // // // setState(() { + // // // _selectedAllergySeverity = + // // // selectedValue; + // // // + // // // severityController.text = + // // // projectViewModel.isArabic + // // // ? _selectedAllergySeverity + // // // .nameAr + // // // : _selectedAllergySeverity + // // // .nameEn; + // // // }); + // // }, + // // ); + // // showDialog( + // // barrierDismissible: false, + // // context: context, + // // builder: (BuildContext context) { + // // return dialog; + // // }, + // // ); + // // } + // // : null, + // // hasLabelText: severityController.text != + // // '' ? true : false, + // // showLabelText: true, + // // hintText: TranslationBase + // // .of(context) + // // .selectSeverity, + // // fontSize: 13.5, + // // readOnly: true, + // // // hintColor: Colors.black, + // // fontWeight: FontWeight.w600, + // // maxLines: 2, + // // minLines: 1, + // // controller: severityController, + // // validator: (value) { + // // if (value == null) + // // return TranslationBase + // // .of(context) + // // .emptyMessage; + // // else + // // return null; + // // }), SizedBox( + // // height: 5, + // // ), + // // // if(isFormSubmitted && + // // // _selectedAllergySeverity == null) + // // // CustomValidationError(), + // // + // // SizedBox( + // // height: 10, + // // ), + // // Container( + // // margin: EdgeInsets.only( + // // left: 0, right: 0, top: 15), + // // child: TextFields( + // // hasLabelText: remarkController.text != ''?true:false, + // // showLabelText: true, + // // hintText: TranslationBase.of(context).remarks, + // // fontSize: 13.5, + // // // hintColor: Colors.black, + // // fontWeight: FontWeight.w600, + // // maxLines: 25, + // // minLines: 10, + // // controller: remarkController, + // // validator: (value) { + // // if (value == null) + // // return TranslationBase + // // .of(context) + // // .emptyMessage; + // // else + // // return null; + // // }), + // // ), SizedBox( + // // height: 10, + // // ), + // // ], + // // ), + // // ), + // // // DividerWithSpacesAround(), + // // ], + // // ); + // // }).toList(), + // // ), + // // ), + // ], + // ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (widget.model.state == ViewState.Idle) + AppButton( + title: widget.buttonName ?? + TranslationBase.of(context).addSelectedHistories, + padding: 10, + color: Color(0xFF359846), + onPressed: () { + widget.addSelectedAllergy(); + }, + ), + ], + ), + ); + } + + void filterSearchResults(String query) { + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); + if (query.isNotEmpty) { + List dummyListData = List(); + dummySearchList.forEach((items) { + if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || + items.nameEn.toLowerCase().contains(query.toLowerCase())) { + dummyListData.add(items); + } + }); + setState(() { + items.clear(); + items.addAll(dummyListData); + }); + return; + } else { + setState(() { + items.clear(); + items.addAll(widget.masterList); + }); + } + } +} From aeecc12cbe8ab11cc0c54ccd7311a6038bd607dc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 15:39:23 +0300 Subject: [PATCH 02/19] 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 03/19] 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 b735a69a4f0e7c699e2326713017a557abdee9f4 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 16:53:01 +0300 Subject: [PATCH 04/19] 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 f89eb0f76b46939a0b9ffade9738fe66bf5d6bcb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Apr 2021 17:49:29 +0300 Subject: [PATCH 05/19] Procedure screen changes --- .../medical-file/medical_file_page.dart | 2 +- .../prescription/prescriptions_page.dart | 2 +- lib/screens/procedures/ProcedureCard.dart | 54 +++++++++++++--- lib/screens/procedures/procedure_screen.dart | 61 ++++++++++--------- 4 files changed, 81 insertions(+), 38 deletions(-) diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 68ac3973..46ec0ac3 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -40,7 +40,7 @@ class _MedicalFilePageState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType), + patient, patientType.toString() ?? "0", arrivalType), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 62939fc5..ba707769 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -33,7 +33,7 @@ class PrescriptionsPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType), + patient, patientType ?? '0', arrivalType), body: FractionallySizedBox( widthFactor: 1.0, child: ListView( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 4fd632cf..31595fa6 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -10,8 +10,16 @@ import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { final Function onTap; final EntityList entityList; + final String categoryName; + final int categoryID; - const ProcedureCard({Key key, this.onTap, this.entityList}) : super(key: key); + const ProcedureCard( + {Key key, + this.onTap, + this.entityList, + this.categoryID, + this.categoryName}) + : super(key: key); @override Widget build(BuildContext context) { @@ -37,9 +45,8 @@ class ProcedureCard extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: entityList.orderType == 1 - ? Colors.red[500] - : Colors.black, + color: + entityList.orderType == 1 ? Colors.red[500] : Colors.black, ), ), Expanded( @@ -105,12 +112,43 @@ class ProcedureCard extends StatelessWidget { children: [ Texts( TranslationBase.of(context).orderNo, - color: Colors.grey, + //color: Colors.grey, fontSize: 12, + color: Colors.grey, ), Texts( entityList.orderNo.toString(), + fontSize: 12, + bold: true, + ), + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).doctorName + ": ", + //color: Colors.grey, + fontSize: 12, color: Colors.grey, + ), + Texts( + entityList.doctorName.toString(), + fontSize: 12, + bold: true, + ), + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).clinic + ": ", + //color: Colors.grey, + fontSize: 12, + color: Colors.grey, + ), + Texts( + entityList.clinicDescription.toString(), + bold: true, fontSize: 12, ), ], @@ -119,10 +157,12 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts( - entityList.remarks ?? '', + entityList.remarks.toString() ?? '', fontSize: 12, ), - Icon(Icons.edit) + if (entityList.categoryID == 2 || + entityList.categoryID == 4) + Icon(Icons.edit) ], ) ], diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 3c46cd3f..7d95fd35 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -29,7 +29,8 @@ class ProcedureScreen extends StatelessWidget { builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType), + appBar: PatientProfileHeaderNewDesignAppBar( + patient, arrivalType ?? '0', patientType), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -110,36 +111,38 @@ class ProcedureScreen extends StatelessWidget { ...List.generate( model.procedureList[0].rowcount, (index) => ProcedureCard( + categoryID: + model.procedureList[0].entityList[index].categoryID, entityList: model.procedureList[0].entityList[index], onTap: () { - if (model.procedureList[0].entityList[index] - .categoryID == - 2 || - model.procedureList[0].entityList[index] - .categoryID == - 4) { - updateProcedureForm(context, - model: model, - patient: patient, - remarks: model - .procedureList[0].entityList[index].remarks, - orderType: model.procedureList[0] - .entityList[index].orderType - .toString(), - orderNo: model - .procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0] - .entityList[index].procedureName, - categoreId: model.procedureList[0] - .entityList[index].categoryID - .toString(), - procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0] - .entityList[index].lineItemNo); - } else - helpers.showErrorToast( - 'You Cant Update This Procedure'); + // if (model.procedureList[0].entityList[index] + // .categoryID == + // 2 || + // model.procedureList[0].entityList[index] + // .categoryID == + // 4) { + updateProcedureForm(context, + model: model, + patient: patient, + remarks: model + .procedureList[0].entityList[index].remarks, + orderType: model + .procedureList[0].entityList[index].orderType + .toString(), + orderNo: model + .procedureList[0].entityList[index].orderNo, + procedureName: model.procedureList[0] + .entityList[index].procedureName, + categoreId: model + .procedureList[0].entityList[index].categoryID + .toString(), + procedureId: model.procedureList[0] + .entityList[index].procedureId, + limetNo: model.procedureList[0].entityList[index] + .lineItemNo); + // } else + // helpers.showErrorToast( + // 'You Cant Update This Procedure'); }, ), ), From 583e06c5f21c4ccdf5330c6a02560c4abbb7133c Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 18:00:00 +0300 Subject: [PATCH 06/19] 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 07/19] 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 df3b51b9577ef7949ce5e2ed82b8045e23522ca7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 7 Apr 2021 18:34:16 +0300 Subject: [PATCH 08/19] update allergies --- .../subjective/update_allergies_widget.dart | 44 ++++++-- ..._key_checkbox_search_allergies_widget.dart | 101 ++++++++++++------ 2 files changed, 101 insertions(+), 44 deletions(-) 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 b7f5187e..a1fadef0 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 @@ -24,7 +24,7 @@ import 'package:provider/provider.dart'; import '../custom_validation_error.dart'; class UpdateAllergiesWidget extends StatefulWidget { - final List myAllergiesList; + List myAllergiesList; UpdateAllergiesWidget({Key key, this.myAllergiesList}); @@ -36,6 +36,11 @@ class _UpdateAllergiesWidgetState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + changeAllState() { + setState(() { + + }); + } return Column( children: [ @@ -48,7 +53,7 @@ class _UpdateAllergiesWidgetState extends State { fontSize: 13.5, borderRadius: 12, onTapTextFields: () { - openAllergiesList(context); + openAllergiesList(context, changeAllState); }, readOnly: true, suffixIcon: EvaIcons.plusCircleOutline, @@ -188,15 +193,23 @@ class _UpdateAllergiesWidgetState extends State { print(allergy); } - openAllergiesList(BuildContext context) { + openAllergiesList(BuildContext context, Function changeParentState) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, + isDismissible: false, context: context, builder: (context) { return AddAllergies( myAllergiesList: widget.myAllergiesList, - addAllergiesFun: (){} + addAllergiesFun: (List mySelectedAllergy){ + setState(() { + widget.myAllergiesList = [...mySelectedAllergy]; + }); + changeParentState(); + Navigator.of(context).pop(); + + } ); }); } @@ -358,10 +371,11 @@ class _AddAllergiesState extends State { addAllergy: (MySelectedAllergy mySelectedAllergy){ AddAllergyLocally(mySelectedAllergy); }, - addSelectedAllergy: (){ - // widget.addSelectedHistories(); - }, + addSelectedAllergy: ()=> + widget.addAllergiesFun(myAllergiesListLocal) + , isServiceSelected: (master) =>isServiceSelected(master), + getServiceSelectedAllergy: (master)=>getSelectedAllergy(master), ), ), ), @@ -564,17 +578,29 @@ class _AddAllergiesState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable history = + Iterable allergy = myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); - if (history.length > 0) { + if (allergy.length > 0) { return true; } return false; } + MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { + Iterable allergy = + myAllergiesListLocal.where((element) => + masterKey.id == element.selectedAllergy.id && + masterKey.typeId == element.selectedAllergy.typeId && + element.isChecked); + if (allergy.length > 0) { + return allergy.first; + } + return null; + } + AddAllergyLocally(MySelectedAllergy mySelectedAllergy) { if ( mySelectedAllergy.selectedAllergy == null) { diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 99a012c9..dbc01d42 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -16,10 +16,12 @@ import 'dialogs/master_key_dailog.dart'; class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final SOAPViewModel model; - final Function addSelectedAllergy; + final Function () addSelectedAllergy; final Function(MasterKeyModel) removeAllergy; final Function(MySelectedAllergy mySelectedAllergy) addAllergy; final bool Function(MasterKeyModel) isServiceSelected; + final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; + final List masterList; final String buttonName; final String hintSearchText; @@ -33,7 +35,8 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { this.addAllergy, this.isServiceSelected, this.buttonName, - this.hintSearchText}) + this.hintSearchText, + this.getServiceSelectedAllergy}) : super(key: key); @override @@ -89,13 +92,29 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: ListView.builder( itemCount: items.length, itemBuilder: (context, index) { - TextEditingController remarkController = TextEditingController(text: items[index].remarks); - TextEditingController severityController = TextEditingController(text: _selectedAllergySeverity!= null ?projectViewModel - .isArabic - ? _selectedAllergySeverity - .nameAr - : _selectedAllergySeverity - .nameEn: null); + bool isSelected = widget.isServiceSelected( + items[index]); + MySelectedAllergy mySelectedAllergy; + if (isSelected) { + mySelectedAllergy = widget + .getServiceSelectedAllergy( + items[index]); + } + TextEditingController remarkController = TextEditingController( + text: isSelected ? mySelectedAllergy + .remark : null); + TextEditingController severityController = TextEditingController( + text: isSelected ? mySelectedAllergy + .selectedAllergySeverity != null + ? projectViewModel + .isArabic + ? mySelectedAllergy + .selectedAllergySeverity + .nameAr + : mySelectedAllergy + .selectedAllergySeverity + .nameEn + : null : null); return Column( children: [ InkWell( @@ -104,18 +123,22 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState if (widget.isServiceSelected( items[index])) { widget - .removeAllergy(items[index]); + .removeAllergy( + items[index]); } else { // TODO add Allergy MySelectedAllergy - mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[index], - selectedAllergySeverity: - _selectedAllergySeverity, remark: "fdfdf", isChecked: true); - widget.addAllergy(mySelectedAllergy); + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true); + widget.addAllergy( + mySelectedAllergy); } }); }, @@ -184,16 +207,9 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState okFunction: (selectedValue) { setState(() { - _selectedAllergySeverity = + mySelectedAllergy + .selectedAllergySeverity = selectedValue; - - severityController - .text = projectViewModel - .isArabic - ? _selectedAllergySeverity - .nameAr - : _selectedAllergySeverity - .nameEn; }); }, ); @@ -209,13 +225,15 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } : null, hasLabelText: - severityController.text != - '' + mySelectedAllergy + .selectedAllergySeverity != + null ? true : false, showLabelText: true, hintText: - TranslationBase.of(context) + TranslationBase + .of(context) .selectSeverity, fontSize: 13.5, readOnly: true, @@ -226,7 +244,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState controller: severityController, validator: (value) { if (value == null) - return TranslationBase.of( + return TranslationBase + .of( context) .emptyMessage; else @@ -252,7 +271,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState ? true : false, showLabelText: true, - hintText: TranslationBase.of( + hintText: TranslationBase + .of( context) .remarks, fontSize: 13.5, @@ -260,10 +280,22 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState fontWeight: FontWeight.w600, maxLines: 25, minLines: 10, - controller: remarkController, + initialValue: isSelected + ? mySelectedAllergy + .remark : '', + // controller: remarkControlle + + onChanged: (value) { + if (isSelected) { + mySelectedAllergy + .remark = value; + }; + }, + validator: (value) { if (value == null) - return TranslationBase.of( + return TranslationBase + .of( context) .emptyMessage; else @@ -460,8 +492,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState ), if (widget.model.state == ViewState.Idle) AppButton( - title: widget.buttonName ?? - TranslationBase.of(context).addSelectedHistories, + title: "Add Selected Allergy", padding: 10, color: Color(0xFF359846), onPressed: () { From 7f440a2d8acba4b4f7d6471817267b8888f8257c Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 18:56:00 +0300 Subject: [PATCH 09/19] 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) + ], + ), + ) + ], ), - ], - ), + ), + ], ), ), ); From 26672dbb6e222bb71daa09e030acd7998a0a6c81 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Apr 2021 19:00:25 +0300 Subject: [PATCH 10/19] Radiology details & assessment fix --- .../radiology/radiology_details_page.dart | 31 +- .../profile/soap_update/steps_widget.dart | 298 +++--- .../soap_update/update_assessment_page.dart | 903 +++++++++--------- 3 files changed, 629 insertions(+), 603 deletions(-) diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 308f8536..c5921438 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_head import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -80,27 +81,27 @@ class RadiologyDetailsPage extends StatelessWidget { SizedBox( height: 100, ), - ], ), ), ], ), ), - bottomSheet: model.radImageURL.isNotEmpty ?Container( - width: double.maxFinite, - height: 100, - child: Container( - margin: EdgeInsets.only(left: 35,right: 35,top: 12,bottom: 12), - child: Button( - color: Colors.red, - onTap: () { - launch(model.radImageURL); - }, - title: TranslationBase.of(context).openRad, - ), - ), - ):null, + bottomSheet: model.radImageURL.isNotEmpty + ? Container( + width: double.maxFinite, + child: Container( + margin: + EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), + child: AppButton( + onPressed: () { + launch(model.radImageURL); + }, + title: TranslationBase.of(context).openRad, + ), + ), + ) + : null, ), ); } diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 88c47706..9c31636e 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -46,24 +46,24 @@ class StepsWidget extends StatelessWidget { border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 - ? null - : Border.all( - color: Colors.black, width: 0.75), + ? null + : Border.all( + color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), - ), - SizedBox( - height:5 + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), + SizedBox(height: 5), Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -72,8 +72,10 @@ class StepsWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, ), - StatusLabel(selectedStepId: index, stepId: 0,), - + StatusLabel( + selectedStepId: index, + stepId: 0, + ), ], ), ], @@ -82,10 +84,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 50, - left: MediaQuery - .of(context) - .size - .width * 0.28, + left: MediaQuery.of(context).size.width * 0.28, child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( @@ -98,23 +97,25 @@ class StepsWidget extends StatelessWidget { border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, ), Column( mainAxisAlignment: MainAxisAlignment.start, @@ -124,9 +125,10 @@ class StepsWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, ), - - StatusLabel(selectedStepId: index, stepId: 1,), - + StatusLabel( + selectedStepId: index, + stepId: 1, + ), ], ), ], @@ -135,14 +137,10 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 50, - left: MediaQuery - .of(context) - .size - .width * 0.52, + left: MediaQuery.of(context).size.width * 0.52, child: InkWell( onTap: () { - if (index >= 3) - changeCurrentTab(2); + if (index >= 3) changeCurrentTab(2); }, child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -154,23 +152,25 @@ class StepsWidget extends StatelessWidget { border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) : index > 2 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, ), Column( mainAxisAlignment: MainAxisAlignment.start, @@ -180,7 +180,10 @@ class StepsWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, ), - StatusLabel(selectedStepId: index, stepId: 2,), + StatusLabel( + selectedStepId: index, + stepId: 2, + ), ], ), ], @@ -202,38 +205,43 @@ class StepsWidget extends StatelessWidget { border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) : index > 3 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, + ), + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + "Plan", + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontSize: 12, + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], + ), ), - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - "Plan", - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - fontSize: 12, - ), - StatusLabel(selectedStepId: index, stepId: 3,), - ], - ), - ), ], ), ), @@ -244,10 +252,7 @@ class StepsWidget extends StatelessWidget { children: [ Container( height: 150, - width: MediaQuery - .of(context) - .size - .width, + width: MediaQuery.of(context).size.width, color: Colors.transparent, child: Center( child: Divider( @@ -272,24 +277,24 @@ class StepsWidget extends StatelessWidget { border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 - ? null - : Border.all( - color: Colors.black, width: 0.75), + ? null + : Border.all( + color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), - ), - SizedBox( - height:5 + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), + SizedBox(height: 5), AppText( "شخصي", fontWeight: FontWeight.bold, @@ -301,10 +306,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 50, - right: MediaQuery - .of(context) - .size - .width * 0.28, + right: MediaQuery.of(context).size.width * 0.28, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -317,28 +319,28 @@ class StepsWidget extends StatelessWidget { border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), - ), - SizedBox( - height:5 + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), + SizedBox(height: 5), AppText( "هدف", fontWeight: FontWeight.bold, - fontSize:14, + fontSize: 14, ), ], ), @@ -346,10 +348,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 50, - right: MediaQuery - .of(context) - .size - .width * 0.52, + right: MediaQuery.of(context).size.width * 0.52, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( @@ -362,32 +361,33 @@ class StepsWidget extends StatelessWidget { border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) : index > 2 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, ), Padding( - padding: const EdgeInsets.only(right: 2), child: AppText( - "تقدير", - fontWeight: FontWeight.bold, - fontSize:14, - ), + "تقدير", + fontWeight: FontWeight.bold, + fontSize: 14, + ), ), ], ), @@ -408,44 +408,48 @@ class StepsWidget extends StatelessWidget { border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) : index > 3 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, ), - Container( - margin: EdgeInsets.only(right:index == 3? 15:0), - child: AppText( + Container( + margin: EdgeInsets.only(right: index == 3 ? 15 : 0), + child: AppText( "خطة", fontWeight: FontWeight.bold, - fontSize:14, - ), - ), + fontSize: 14, + ), + ), ], ), ), ), ], - ); + ); } } class StatusLabel extends StatelessWidget { const StatusLabel({ - Key key, this.stepId, this.selectedStepId, + Key key, + this.stepId, + this.selectedStepId, }) : super(key: key); final int stepId; @@ -457,24 +461,30 @@ class StatusLabel extends StatelessWidget { width: 65, padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), decoration: BoxDecoration( - color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId < - selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC), + color: stepId == selectedStepId + ? Color(0xFFF1E9D3) + : stepId < selectedStepId + ? Color(0xFFD8E8DB) + : Color(0xFFCCCCCC), borderRadius: BorderRadius.all( Radius.circular(5.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), ), child: AppText( - stepId == selectedStepId ? "inProgress" : stepId < selectedStepId - ? "Completed" - : " Locked ", + stepId == selectedStepId + ? "inProgress" + : stepId < selectedStepId + ? "Completed" + : " Locked ", fontWeight: FontWeight.bold, textAlign: TextAlign.center, fontSize: 10, - color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < - selectedStepId ? Color(0xFF359846) : Color(0xFF969696), + color: stepId == selectedStepId + ? Color(0xFFCC9B14) + : stepId < selectedStepId + ? Color(0xFF359846) + : Color(0xFF969696), ), ); } diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 86016be9..f13dd897 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -54,495 +54,510 @@ class _UpdateAssessmentPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) async { - widget.mySelectedAssessmentList.clear(); - GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: '', - appointmentNo: widget.patientInfo.appointmentNo); - await model.getPatientAssessment(getAssessmentReqModel); - if (model.patientAssessmentList.isNotEmpty) { - if (model.listOfDiagnosisCondition.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisCondition); - } - if (model.listOfDiagnosisType.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisType); - } - if (model.listOfICD10.length == 0) { - await model.getMasterLookup(MasterKeysService.ICD10); - } - model.patientAssessmentList.forEach((element) { - MasterKeyModel diagnosisType = model.getOneMasterKey( - masterKeys: MasterKeysService.DiagnosisType, - id: element.diagnosisTypeID, - ); - MasterKeyModel selectedICD = model.getOneMasterKey( - masterKeys: MasterKeysService.ICD10, - id: element.icdCode10ID, - ); - MasterKeyModel diagnosisCondition = model.getOneMasterKey( - masterKeys: MasterKeysService.DiagnosisCondition, - id: element.conditionID, - ); - if (diagnosisCondition != null && - diagnosisType != null && - diagnosisCondition != null) { - MySelectedAssessment temMySelectedAssessment = - MySelectedAssessment( - appointmentId: element.appointmentNo, - remark: element.remarks, - selectedDiagnosisType: diagnosisType, - selectedDiagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - createdOn: element.createdOn, - icdCode10ID: element.icdCode10ID); - - widget.mySelectedAssessmentList.add(temMySelectedAssessment); - } - }); + onModelReady: (model) async { + widget.mySelectedAssessmentList.clear(); + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: '', + appointmentNo: widget.patientInfo.appointmentNo); + await model.getPatientAssessment(getAssessmentReqModel); + if (model.patientAssessmentList.isNotEmpty) { + if (model.listOfDiagnosisCondition.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisCondition); + } + if (model.listOfDiagnosisType.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisType); } + if (model.listOfICD10.length == 0) { + await model.getMasterLookup(MasterKeysService.ICD10); + } + model.patientAssessmentList.forEach((element) { + MasterKeyModel diagnosisType = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisType, + id: element.diagnosisTypeID, + ); + MasterKeyModel selectedICD = model.getOneMasterKey( + masterKeys: MasterKeysService.ICD10, + id: element.icdCode10ID, + ); + MasterKeyModel diagnosisCondition = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisCondition, + id: element.conditionID, + ); + if (diagnosisCondition != null && + diagnosisType != null && + diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = + MySelectedAssessment( + appointmentId: element.appointmentNo, + remark: element.remarks, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); - widget.changeLoadingState(false); - }, - builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - // baseViewModel: model, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - color: Color(0xffF8F8F8), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, + widget.mySelectedAssessmentList.add(temMySelectedAssessment); + } + }); + } + + widget.changeLoadingState(false); + }, + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + // baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + color: Color(0xffF8F8F8), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.all(12.0), + child: Row( + children: [ + Texts(TranslationBase.of(context).assessment, + variant: + isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: Colors.black, + size: 10, + ) + ], + ), ), - border: - Border.all(color: Colors.grey[200], width: 0.5), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, ), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.all(12.0), - child: Row( - children: [ - Texts( - TranslationBase.of(context) - .assessment, - variant: isAssessmentExpand - ? "bodyText" - : '', - bold: - isAssessmentExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: Colors.black, - size: 10, - ) - ], - ), - ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = - !isAssessmentExpand; - }); + Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 5, right: 5, top: 15), + child: TextFields( + hintText: TranslationBase.of(context) + .addAssessment, + fontSize: 13.5, + onTapTextFields: () { + openAssessmentDialog(context, + isUpdate: false, model: model); }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: Column(children: [ + readOnly: true, + suffixIcon: EvaIcons.plusSquare, + suffixIconColor: Colors.black, + fontWeight: FontWeight.w600, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), SizedBox( height: 20, ), Column( - children: [ - Container( + children: widget.mySelectedAssessmentList + .map((assessment) { + return Container( margin: EdgeInsets.only( left: 5, right: 5, top: 15), - child: TextFields( - hintText: TranslationBase.of(context) - .addAssessment, - fontSize: 13.5, - onTapTextFields: () { - openAssessmentDialog(context, - isUpdate: false, model: model); - }, - readOnly: true, - suffixIcon: EvaIcons.plusSquare, - suffixIconColor: Colors.black, - fontWeight: FontWeight.w600, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Column( - children: widget.mySelectedAssessmentList - .map((assessment) { - return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( + Row( + children: [ + AppText( + "ICD : ".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + Container( + child: AppText( + assessment.selectedICD.code + .trim() + .toUpperCase() ?? + "", + fontWeight: FontWeight.w700, + fontSize: 11, + ), + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - AppText( - "ICD : ".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - Container( - child: AppText( - assessment.selectedICD - .code - .trim() - .toUpperCase() ?? - "", - fontWeight: - FontWeight.w700, - fontSize: 11, - ), - ), - ], + AppText( + TranslationBase.of(context) + .ICDName + + " : ", + fontSize: 13, + color: Colors.grey, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( - context) - .ICDName + - " : ", - fontSize: 13, - color: Colors.grey, - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, - child: AppText( - assessment.selectedICD - .description - .toString(), - fontWeight: - FontWeight.w700, - fontSize: 10, - ), - ), - ], + Container( + width: MediaQuery.of(context) + .size + .width * + 0.29, + child: AppText( + assessment + .selectedICD.description + .toString(), + fontWeight: FontWeight.w700, + fontSize: 10, + ), ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( - context) - .appointmentNo, - fontSize: 10, - color: Colors.grey, - ), - AppText( - assessment.appointmentId - .toString(), - fontSize: 11, - fontWeight: - FontWeight.w700, - ), - ], + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentNo, + fontSize: 10, + color: Colors.grey, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( - context) - .condition + - " : ", - fontSize: 10, - color: Colors.grey, - ), - AppText( - projectViewModel.isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, - fontSize: 11, - fontWeight: - FontWeight.w700, - ), - ], + AppText( + assessment.appointmentId + .toString(), + fontSize: 11, + fontWeight: FontWeight.w700, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( - context) - .dType + - ' : ', - fontSize: 10, - color: Colors.grey, - ), - AppText( - projectViewModel.isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, - fontSize: 11, - fontWeight: - FontWeight.w700, - ), - ], + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .condition + + " : ", + fontSize: 10, + color: Colors.grey, ), - if (assessment.doctorName != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( - context) - .doc, - fontSize: 10, - color: Colors.grey, - ), - AppText( - assessment.doctorName ?? - '', - fontSize: 11, - fontWeight: - FontWeight.w700, - ), - ], + AppText( + projectViewModel.isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + fontSize: 11, + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .dType + + ' : ', + fontSize: 10, + color: Colors.grey, + ), + AppText( + projectViewModel.isArabic + ? assessment + .selectedDiagnosisType + .nameAr + : assessment + .selectedDiagnosisType + .nameEn, + fontSize: 11, + fontWeight: FontWeight.w700, + ), + ], + ), + if (assessment.doctorName != null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .doc, + fontSize: 10, + color: Colors.grey, + ), + AppText( + assessment.doctorName ?? '', + fontSize: 11, + fontWeight: FontWeight.w700, ), + ], + ), + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ SizedBox( height: 6, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - assessment.remark != - null || - assessment - .remark == - '' - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - fontSize: 10, - color: Colors.grey, - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.38, - child: AppText( - assessment.remark ?? "", - fontSize: 11, - fontWeight: - FontWeight.w700, - ), - ), - ], + AppText( + assessment.remark != null || + assessment.remark == + '' + ? TranslationBase.of( + context) + .remarks + + " : " + : '', + fontSize: 10, + color: Colors.grey, + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.38, + child: AppText( + assessment.remark ?? "", + fontSize: 11, + fontWeight: FontWeight.w700, + ), ), ], ), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( children: [ - Row( - children: [ - AppText( - assessment.createdOn != + AppText( + assessment.createdOn != null + ? DateTime.parse( + assessment + .createdOn) + .day + .toString() + : DateTime.now() + .day + .toString(), + fontWeight: FontWeight.bold, + fontSize: 15, + ), + AppText(" "), + AppText( + Helpers.getMonth(assessment + .createdOn != null ? DateTime.parse( assessment .createdOn) - .day - .toString() + .month : DateTime.now() - .day - .toString(), - fontWeight: - FontWeight.bold, - fontSize: 15, - ), - AppText(" "), - AppText( - Helpers.getMonth(assessment - .createdOn != - null - ? DateTime.parse( - assessment - .createdOn) - .month - : DateTime.now() - .month) - .toUpperCase(), - fontSize: 13, - color: Colors.grey, - ), - ], - ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, + .month) + .toUpperCase(), + fontSize: 13, + color: Colors.grey, ), - InkWell( - onTap: () { - openAssessmentDialog( - context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon(EvaIcons.edit2), - ) ], ), - // Column( - // children: [ - // // SizedBox( - // // height: 60, - // // ), - // InkWell( - // onTap: () { - // openAssessmentDialog( - // context, - // isUpdate: true, - // assessment: assessment, - // model: model); - // }, - // child: Icon(EvaIcons.edit2), - // ) - // ], - // ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon(EvaIcons.edit2), + ) ], ), - ); - }).toList(), - ) - ], + // Column( + // children: [ + // // SizedBox( + // // height: 60, + // // ), + // InkWell( + // onTap: () { + // openAssessmentDialog( + // context, + // isUpdate: true, + // assessment: assessment, + // model: model); + // }, + // child: Icon(EvaIcons.edit2), + // ) + // ], + // ), + ], + ), + ); + }).toList(), ) - ]), - isExpand: isAssessmentExpand, - ), - ), - DividerWithSpacesAround( - height: 30, - ), - Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: 'Previous', - color: Colors.white38, - fontColor: Colors.black, - fontWeight: FontWeight.w700, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - Navigator.pop(context); - }, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.05, - ), - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w700, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - helpers.showErrorToast( - TranslationBase.of(context) - .assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, - ), - ), - ], - ), - SizedBox( - height: 30, - ), - ], + ], + ) + ]), + isExpand: isAssessmentExpand, + ), ), - ), + DividerWithSpacesAround( + height: 30, + ), + // Row( + // children: [ + // Container( + // width: MediaQuery.of(context).size.width * 0.4, + // child: AppButton( + // title: 'Previous', + // color: Colors.white38, + // fontColor: Colors.black, + // fontWeight: FontWeight.w700, + // loading: model.state == ViewState.BusyLocal, + // onPressed: () async { + // Navigator.pop(context); + // }, + // ), + // ), + // SizedBox( + // width: MediaQuery.of(context).size.width * 0.05, + // ), + // Container( + // width: MediaQuery.of(context).size.width * 0.4, + // child: AppButton( + // title: TranslationBase.of(context).next, + // fontWeight: FontWeight.w700, + // loading: model.state == ViewState.BusyLocal, + // onPressed: () async { + // if (widget.mySelectedAssessmentList.isEmpty) { + // helpers.showErrorToast( + // TranslationBase.of(context) + // .assessmentErrorMsg); + // } else { + // widget.changePageViewIndex(3); + // widget.changeLoadingState(true); + // } + // }, + // ), + // ), + // ], + // ), + SizedBox( + height: 130, + ), + ], + ), + ), + ), + ), + ), + bottomSheet: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: 'Previous', + color: Colors.white38, + fontColor: Colors.black, + fontWeight: FontWeight.w700, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + Navigator.pop(context); + }, ), ), - ))); + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, + ), + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w700, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + if (widget.mySelectedAssessmentList.isEmpty) { + helpers.showErrorToast( + TranslationBase.of(context).assessmentErrorMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } + }, + ), + ), + ], + ), + ), + ), + ); } openAssessmentDialog(BuildContext context, From 3795381e3b636f2b31d18bd00f2e68118893f479 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Apr 2021 19:27:46 +0300 Subject: [PATCH 11/19] assessment fix --- .../profile/soap_update/steps_widget.dart | 298 +++++++++--------- .../soap_update/update_assessment_page.dart | 2 +- 2 files changed, 155 insertions(+), 145 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 2e2c77c0..3ad583d0 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -47,24 +47,24 @@ class StepsWidget extends StatelessWidget { border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 - ? null - : Border.all( - color: Colors.black, width: 0.75), + ? null + : Border.all( + color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), - ), - SizedBox( - height:5 + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), + SizedBox(height: 5), Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -73,8 +73,10 @@ class StepsWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, ), - StatusLabel(selectedStepId: index, stepId: 0,), - + StatusLabel( + selectedStepId: index, + stepId: 0, + ), ], ), ], @@ -83,10 +85,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 50, - left: MediaQuery - .of(context) - .size - .width * 0.28, + left: MediaQuery.of(context).size.width * 0.28, child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( @@ -99,23 +98,25 @@ class StepsWidget extends StatelessWidget { border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, ), Column( mainAxisAlignment: MainAxisAlignment.start, @@ -125,9 +126,10 @@ class StepsWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, ), - - StatusLabel(selectedStepId: index, stepId: 1,), - + StatusLabel( + selectedStepId: index, + stepId: 1, + ), ], ), ], @@ -136,14 +138,10 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 50, - left: MediaQuery - .of(context) - .size - .width * 0.52, + left: MediaQuery.of(context).size.width * 0.52, child: InkWell( onTap: () { - if (index >= 3) - changeCurrentTab(2); + if (index >= 3) changeCurrentTab(2); }, child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -155,23 +153,25 @@ class StepsWidget extends StatelessWidget { border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) : index > 2 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, ), Column( mainAxisAlignment: MainAxisAlignment.start, @@ -181,7 +181,10 @@ class StepsWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, ), - StatusLabel(selectedStepId: index, stepId: 2,), + StatusLabel( + selectedStepId: index, + stepId: 2, + ), ], ), ], @@ -203,38 +206,43 @@ class StepsWidget extends StatelessWidget { border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) : index > 3 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, + ), + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + "Plan", + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontSize: 12, + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], + ), ), - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - "Plan", - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - fontSize: 12, - ), - StatusLabel(selectedStepId: index, stepId: 3,), - ], - ), - ), ], ), ), @@ -245,10 +253,7 @@ class StepsWidget extends StatelessWidget { children: [ Container( height: height == 0 ? 150 : height, - width: MediaQuery - .of(context) - .size - .width, + width: MediaQuery.of(context).size.width, color: Colors.transparent, child: Center( child: Divider( @@ -273,24 +278,24 @@ class StepsWidget extends StatelessWidget { border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 - ? null - : Border.all( - color: Colors.black, width: 0.75), + ? null + : Border.all( + color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), - ), - SizedBox( - height:5 + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), + SizedBox(height: 5), AppText( "شخصي", fontWeight: FontWeight.bold, @@ -302,10 +307,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 50, - right: MediaQuery - .of(context) - .size - .width * 0.28, + right: MediaQuery.of(context).size.width * 0.28, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -318,28 +320,28 @@ class StepsWidget extends StatelessWidget { border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), - ), - SizedBox( - height:5 + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), + SizedBox(height: 5), AppText( "هدف", fontWeight: FontWeight.bold, - fontSize:14, + fontSize: 14, ), ], ), @@ -347,10 +349,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 50, - right: MediaQuery - .of(context) - .size - .width * 0.52, + right: MediaQuery.of(context).size.width * 0.52, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( @@ -363,32 +362,33 @@ class StepsWidget extends StatelessWidget { border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) : index > 2 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, ), Padding( - padding: const EdgeInsets.only(right: 2), child: AppText( - "تقدير", - fontWeight: FontWeight.bold, - fontSize:14, - ), + "تقدير", + fontWeight: FontWeight.bold, + fontSize: 14, + ), ), ], ), @@ -409,44 +409,48 @@ class StepsWidget extends StatelessWidget { border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) : index > 3 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 20, - color: Colors.white,) - ), + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( - height:5, + height: 5, ), - Container( - margin: EdgeInsets.only(right:index == 3? 15:0), - child: AppText( + Container( + margin: EdgeInsets.only(right: index == 3 ? 15 : 0), + child: AppText( "خطة", fontWeight: FontWeight.bold, - fontSize:14, - ), - ), + fontSize: 14, + ), + ), ], ), ), ), ], - ); + ); } } class StatusLabel extends StatelessWidget { const StatusLabel({ - Key key, this.stepId, this.selectedStepId, + Key key, + this.stepId, + this.selectedStepId, }) : super(key: key); final int stepId; @@ -458,24 +462,30 @@ class StatusLabel extends StatelessWidget { width: 65, padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), decoration: BoxDecoration( - color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId < - selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC), + color: stepId == selectedStepId + ? Color(0xFFF1E9D3) + : stepId < selectedStepId + ? Color(0xFFD8E8DB) + : Color(0xFFCCCCCC), borderRadius: BorderRadius.all( Radius.circular(5.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), ), child: AppText( - stepId == selectedStepId ? "inProgress" : stepId < selectedStepId - ? "Completed" - : " Locked ", + stepId == selectedStepId + ? "inProgress" + : stepId < selectedStepId + ? "Completed" + : " Locked ", fontWeight: FontWeight.bold, textAlign: TextAlign.center, fontSize: 10, - color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < - selectedStepId ? Color(0xFF359846) : Color(0xFF969696), + color: stepId == selectedStepId + ? Color(0xFFCC9B14) + : stepId < selectedStepId + ? Color(0xFF359846) + : Color(0xFF969696), ), ); } diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index f13dd897..18f4f19d 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -529,7 +529,7 @@ class _UpdateAssessmentPageState extends State { fontWeight: FontWeight.w700, loading: model.state == ViewState.BusyLocal, onPressed: () async { - Navigator.pop(context); + widget.changePageViewIndex(1); }, ), ), From 19d8b9170d3f71c5a840ff81ef39826d0166043e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 7 Apr 2021 22:11:44 +0300 Subject: [PATCH 12/19] update allergies fixes --- lib/models/SOAP/GetGetProgressNoteResModel.dart | 2 +- .../profile/soap_update/subjective/update_allergies_widget.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index ce6c0a12..4ae7ed8c 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,4 +1,4 @@ -class GetPatientProgressNoteResModel { +class GetPatientProgressNoteResModel { int appointmentNo; int createdBy; String createdByName; 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 a1fadef0..b62bae0b 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 @@ -204,7 +204,7 @@ class _UpdateAllergiesWidgetState extends State { myAllergiesList: widget.myAllergiesList, addAllergiesFun: (List mySelectedAllergy){ setState(() { - widget.myAllergiesList = [...mySelectedAllergy]; + widget.myAllergiesList.addAll(mySelectedAllergy); }); changeParentState(); Navigator.of(context).pop(); From ff2c31ee3559813d4df63d73fc837d5e009ef1e9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 8 Apr 2021 09:48:08 +0300 Subject: [PATCH 13/19] allergies fixes --- .../subjective/update_allergies_widget.dart | 225 +++--------------- ..._key_checkbox_search_allergies_widget.dart | 184 ++------------ 2 files changed, 42 insertions(+), 367 deletions(-) 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 b62bae0b..c31e8e59 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 @@ -8,10 +8,8 @@ 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/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -21,8 +19,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import '../custom_validation_error.dart'; - class UpdateAllergiesWidget extends StatefulWidget { List myAllergiesList; @@ -202,15 +198,27 @@ class _UpdateAllergiesWidgetState extends State { builder: (context) { return AddAllergies( myAllergiesList: widget.myAllergiesList, - addAllergiesFun: (List mySelectedAllergy){ - setState(() { - widget.myAllergiesList.addAll(mySelectedAllergy); + addAllergiesFun: (List mySelectedAllergy) { + bool isAllDataFilled = true; + mySelectedAllergy.forEach((element) { + if (element.selectedAllergySeverity == null) { + isAllDataFilled = false; + } + }); + if (isAllDataFilled) { + mySelectedAllergy.forEach((element) { + if (!widget.myAllergiesList.contains(element)) { + widget.myAllergiesList.add(element); + } + }); + changeParentState(); + Navigator.of(context).pop(); + } else { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); + } }); - changeParentState(); - Navigator.of(context).pop(); - - } - ); }); } @@ -363,9 +371,9 @@ class _AddAllergiesState extends State { child: MasterKeyCheckboxSearchAllergiesWidget( model: model, masterList: model.allergiesList, - removeAllergy: (history){ + removeAllergy: (master) { setState(() { - // widget.allergie(history); + removeAllergyFromLocalList(master); }); }, addAllergy: (MySelectedAllergy mySelectedAllergy){ @@ -382,190 +390,6 @@ class _AddAllergiesState extends State { ), ), ), - // Container( - // height: screenSize.height * 0.070, - // child: InkWell( - // onTap: model.allergiesList != null - // ? () { - // setState(() { - // _selectedAllergy = null; - // allergyController.text = null; - // }); - // } - // : null, - // child: _selectedAllergy==null? AutoCompleteTextField( - // decoration: textFieldSelectorDecoration( - // TranslationBase - // .of(context) - // .selectAllergy, - // _selectedAllergy != null - // ? _selectedAllergy.nameEn - // : null, true, icon: EvaIcons.search), - // itemSubmitted: (item) => - // setState(() { - // _selectedAllergy = item; - // allergyController.text = - // projectViewModel.isArabic - // ? _selectedAllergy - // .nameAr - // : _selectedAllergy - // .nameEn; - // }), - // key: key, - // suggestions: model.allergiesList, - // itemBuilder: (context, suggestion) => - // new Padding( - // child: Texts( - // projectViewModel.isArabic ? suggestion - // .nameAr : suggestion.nameEn), - // padding: EdgeInsets.all(2.0)), - // itemSorter: (a, b) => 1, - // itemFilter: (suggestion, input) => - // suggestion.nameAr.toLowerCase().startsWith( - // input.toLowerCase()) || - // suggestion.nameEn.toLowerCase() - // .startsWith(input.toLowerCase()), - // ) : - // TextFields( - // onTapTextFields: model.allergiesList != null - // ? () { - // setState(() { - // _selectedAllergy = null; - // allergyController.text = null; - // }); - // } - // : null, - // hasLabelText: allergyController.text != - // '' ? true : false, - // showLabelText: true, - // hintText: TranslationBase - // .of(context) - // .selectAllergy, - // fontSize: 13.5, - // readOnly: true, - // fontWeight: FontWeight.w600, - // maxLines: 2, - // minLines: 1, - // controller: allergyController, - // suffixIcon: EvaIcons.search, - // validator: (value) { - // if (value == null) - // return TranslationBase - // .of(context) - // .emptyMessage; - // else - // return null; - // }) - // ), - // ), - // if(isFormSubmitted && _selectedAllergy == null) - // CustomValidationError(), - // SizedBox( - // height: 10, - // ), - // TextFields( - // onTapTextFields: model - // .allergySeverityList != null - // ? () { - // MasterKeyDailog dialog = MasterKeyDailog( - // list: model.allergySeverityList, - // okText: TranslationBase - // .of(context) - // .ok, - // okFunction: (selectedValue) { - // setState(() { - // _selectedAllergySeverity = - // selectedValue; - // - // severityController.text = - // projectViewModel.isArabic - // ? _selectedAllergySeverity - // .nameAr - // : _selectedAllergySeverity - // .nameEn; - // }); - // }, - // ); - // showDialog( - // barrierDismissible: false, - // context: context, - // builder: (BuildContext context) { - // return dialog; - // }, - // ); - // } - // : null, - // hasLabelText: severityController.text != - // '' ? true : false, - // showLabelText: true, - // hintText: TranslationBase - // .of(context) - // .selectSeverity, - // fontSize: 13.5, - // readOnly: true, - // // hintColor: Colors.black, - // fontWeight: FontWeight.w600, - // maxLines: 2, - // minLines: 1, - // controller: severityController, - // validator: (value) { - // if (value == null) - // return TranslationBase - // .of(context) - // .emptyMessage; - // else - // return null; - // }), SizedBox( - // height: 5, - // ), - // if(isFormSubmitted && - // _selectedAllergySeverity == null) - // CustomValidationError(), - // - // SizedBox( - // height: 10, - // ), - // Container( - // margin: EdgeInsets.only( - // left: 0, right: 0, top: 15), - // child: TextFields( - // hasLabelText: remarkController.text != ''?true:false, - // showLabelText: true, - // hintText: TranslationBase.of(context).remarks, - // fontSize: 13.5, - // // hintColor: Colors.black, - // fontWeight: FontWeight.w600, - // maxLines: 25, - // minLines: 10, - // controller: remarkController, - // validator: (value) { - // if (value == null) - // return TranslationBase - // .of(context) - // .emptyMessage; - // else - // return null; - // }), - // ), SizedBox( - // height: 10, - // ), - // AppButton( - // title: TranslationBase.of(context).add.toUpperCase(), - // onPressed: () { - // setState(() { - // isFormSubmitted = true; - // }); - // if(_selectedAllergy !=null && _selectedAllergySeverity !=null) { - // MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - // remark: remarkController.text, - // selectedAllergy: _selectedAllergy, - // isChecked: true, - // selectedAllergySeverity: _selectedAllergySeverity,); - // widget.addAllergiesFun(mySelectedAllergy); - // } - // - // }, - // ), ] ), @@ -589,6 +413,11 @@ class _AddAllergiesState extends State { return false; } + removeAllergyFromLocalList(MasterKeyModel masterKey) { + myAllergiesListLocal.removeWhere((element) => + element.selectedAllergy.id == masterKey.id); + } + MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { Iterable allergy = myAllergiesListLocal.where((element) => diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index dbc01d42..68c01d62 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -4,6 +4,7 @@ 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_allergy.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; @@ -48,6 +49,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { List items = List(); MasterKeyModel _selectedAllergySeverity; + bool isSubmitted = false; @override void initState() { @@ -254,9 +256,16 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState SizedBox( height: 5, ), - // if(isFormSubmitted && - // _selectedAllergySeverity == null) - // CustomValidationError(), + if(isSubmitted && + mySelectedAllergy + .selectedAllergySeverity == null) + Row( + + children: [ + CustomValidationError(), + ], + mainAxisAlignment: MainAxisAlignment.start, + ), SizedBox( height: 10, @@ -318,172 +327,6 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState ), ], ) - // ListView( - // children: [ - // TextFields( - // hintText: widget.hintSearchText ?? - // TranslationBase.of(context).searchHistory, - // borderWidth: 0.0, - // padding: EdgeInsets.all(20), - // borderRadius: 0, - // suffixIcon: EvaIcons.search, - // onChanged: (value) { - // filterSearchResults(value); - // }, - // ), - // // SizedBox(height: 15,), - // DividerWithSpacesAround(), - // - // - // // Container( - // // // padding:EdgeInsets.all(20), - // // child: Column( - // // children: items.map((historyInfo) { - // // return Column( - // // children: [ - // // InkWell( - // // onTap:(){ - // // - // // setState(() { - // // if (widget - // // .isServiceSelected(historyInfo)) { - // // widget.removeHistory(historyInfo); - // // } else { - // // widget.addHistory(historyInfo); - // // } - // // }); - // // }, - // // - // // child: Column( - // // children: [ - // // Row( - // // children: [ - // // Checkbox( - // // value:true, - // // // widget.isServiceSelected(historyInfo), - // // activeColor: Colors.red[800], - // // onChanged: (bool newValue) { - // // // setState(() { - // // // if (widget - // // // .isServiceSelected(historyInfo)) { - // // // widget.removeHistory(historyInfo); - // // // } else { - // // // widget.addHistory(historyInfo); - // // // } - // // // }); - // // }), - // // Expanded( - // // child: Padding( - // // padding: const EdgeInsets.symmetric( - // // horizontal: 10, vertical: 0), - // // child: AppText(projectViewModel.isArabic - // // ? historyInfo.nameAr!=""?historyInfo.nameAr:historyInfo.nameEn - // // : historyInfo.nameEn, - // // color: Color(0xFF575757), - // // fontSize: 16, - // // fontWeight:FontWeight.w600, - // // ), - // // ), - // // ), - // // ], - // // ), - // // TextFields( - // // onTapTextFields: widget.model - // // .allergySeverityList != null - // // ? () { - // // MasterKeyDailog dialog = MasterKeyDailog( - // // list: widget.model.allergySeverityList, - // // okText: TranslationBase - // // .of(context) - // // .ok, - // // okFunction: (selectedValue) { - // // // setState(() { - // // // _selectedAllergySeverity = - // // // selectedValue; - // // // - // // // severityController.text = - // // // projectViewModel.isArabic - // // // ? _selectedAllergySeverity - // // // .nameAr - // // // : _selectedAllergySeverity - // // // .nameEn; - // // // }); - // // }, - // // ); - // // showDialog( - // // barrierDismissible: false, - // // context: context, - // // builder: (BuildContext context) { - // // return dialog; - // // }, - // // ); - // // } - // // : null, - // // hasLabelText: severityController.text != - // // '' ? true : false, - // // showLabelText: true, - // // hintText: TranslationBase - // // .of(context) - // // .selectSeverity, - // // fontSize: 13.5, - // // readOnly: true, - // // // hintColor: Colors.black, - // // fontWeight: FontWeight.w600, - // // maxLines: 2, - // // minLines: 1, - // // controller: severityController, - // // validator: (value) { - // // if (value == null) - // // return TranslationBase - // // .of(context) - // // .emptyMessage; - // // else - // // return null; - // // }), SizedBox( - // // height: 5, - // // ), - // // // if(isFormSubmitted && - // // // _selectedAllergySeverity == null) - // // // CustomValidationError(), - // // - // // SizedBox( - // // height: 10, - // // ), - // // Container( - // // margin: EdgeInsets.only( - // // left: 0, right: 0, top: 15), - // // child: TextFields( - // // hasLabelText: remarkController.text != ''?true:false, - // // showLabelText: true, - // // hintText: TranslationBase.of(context).remarks, - // // fontSize: 13.5, - // // // hintColor: Colors.black, - // // fontWeight: FontWeight.w600, - // // maxLines: 25, - // // minLines: 10, - // // controller: remarkController, - // // validator: (value) { - // // if (value == null) - // // return TranslationBase - // // .of(context) - // // .emptyMessage; - // // else - // // return null; - // // }), - // // ), SizedBox( - // // height: 10, - // // ), - // // ], - // // ), - // // ), - // // // DividerWithSpacesAround(), - // // ], - // // ); - // // }).toList(), - // // ), - // // ), - // ], - // ), )), ), ), @@ -496,6 +339,9 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState padding: 10, color: Color(0xFF359846), onPressed: () { + setState(() { + isSubmitted = true; + }); widget.addSelectedAllergy(); }, ), From c1adb9eeff06d733ef31429fbb19c05de9231b1c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 8 Apr 2021 10:17:49 +0300 Subject: [PATCH 14/19] fix issues --- .../subjective/update_subjective_page.dart | 8 +- .../soap_update/update_soap_index.dart | 2 - ..._key_checkbox_search_allergies_widget.dart | 428 +++++++++--------- 3 files changed, 219 insertions(+), 219 deletions(-) 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 45202baf..a5f8bfad 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 @@ -304,7 +304,7 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height:MediaQuery.of(context).size.height * 0.2, + height:MediaQuery.of(context).size.height * 0.16, ), ], ), @@ -324,13 +324,13 @@ class _UpdateSubjectivePageState extends State { height: MediaQuery .of(context) .size - .height * 0.15, + .height * 0.1, width: double.infinity, child: Column( children: [ SizedBox( - height: 15, + height: 10, ), Container(child: FractionallySizedBox( widthFactor: .80, @@ -351,7 +351,7 @@ class _UpdateSubjectivePageState extends State { ), ),), SizedBox( - height: 15, + height: 5, ), ], ),), 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 b14a0479..e774d913 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -68,8 +68,6 @@ class _UpdateSoapIndexState extends State // baseViewModel: model, isLoading: _isLoading, isShowAppBar: false, - // appBarTitle: TranslationBase.of(context).healthRecordInformation, - // TODO mousa removed the singleChildScrollView body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 68c01d62..e7e15076 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -87,220 +87,164 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState SizedBox( height: 10, ), - FractionallySizedBox( - widthFactor: 0.9, - child: Container( - height: MediaQuery.of(context).size.height * 0.60, - child: ListView.builder( - itemCount: items.length, - itemBuilder: (context, index) { - bool isSelected = widget.isServiceSelected( - items[index]); - MySelectedAllergy mySelectedAllergy; - if (isSelected) { - mySelectedAllergy = widget - .getServiceSelectedAllergy( + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Container( + height: MediaQuery.of(context).size.height * 0.60, + child: ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) { + bool isSelected = widget.isServiceSelected( items[index]); - } - TextEditingController remarkController = TextEditingController( - text: isSelected ? mySelectedAllergy - .remark : null); - TextEditingController severityController = TextEditingController( - text: isSelected ? mySelectedAllergy - .selectedAllergySeverity != null - ? projectViewModel - .isArabic - ? mySelectedAllergy - .selectedAllergySeverity - .nameAr - : mySelectedAllergy - .selectedAllergySeverity - .nameEn - : null : null); - return Column( - children: [ - InkWell( - onTap: () { - setState(() { - if (widget.isServiceSelected( - items[index])) { - widget - .removeAllergy( - items[index]); - } else { - // TODO add Allergy + MySelectedAllergy mySelectedAllergy; + if (isSelected) { + mySelectedAllergy = widget + .getServiceSelectedAllergy( + items[index]); + } + TextEditingController remarkController = TextEditingController( + text: isSelected ? mySelectedAllergy + .remark : null); + TextEditingController severityController = TextEditingController( + text: isSelected ? mySelectedAllergy + .selectedAllergySeverity != null + ? projectViewModel + .isArabic + ? mySelectedAllergy + .selectedAllergySeverity + .nameAr + : mySelectedAllergy + .selectedAllergySeverity + .nameEn + : null : null); + return Column( + children: [ + InkWell( + onTap: () { + setState(() { + if (widget.isServiceSelected( + items[index])) { + widget + .removeAllergy( + items[index]); + } else { + // TODO add Allergy - MySelectedAllergy - mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[index], - selectedAllergySeverity: - _selectedAllergySeverity, - remark: null, - isChecked: true); - widget.addAllergy( - mySelectedAllergy); - } - }); - }, - child: Column( - children: [ - Row( - children: [ - Checkbox( - value: widget - .isServiceSelected( - items[index]), - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - // setState(() { - // if (widget - // .isServiceSelected(items[index])) { - // widget.removeHistory(items[index]); - // } else { - // widget.addHistory(items[index]); - // } - // }); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: AppText( - projectViewModel.isArabic - ? items[index] - .nameAr != - "" - ? items[index] - .nameAr - : items[index] - .nameEn - : items[index].nameEn, - color: Color(0xFF575757), - fontSize: 16, - fontWeight: - FontWeight.w600, + MySelectedAllergy + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true); + widget.addAllergy( + mySelectedAllergy); + } + }); + }, + child: Column( + children: [ + Row( + children: [ + Checkbox( + value: widget + .isServiceSelected( + items[index]), + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + // setState(() { + // if (widget + // .isServiceSelected(items[index])) { + // widget.removeHistory(items[index]); + // } else { + // widget.addHistory(items[index]); + // } + // }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: AppText( + projectViewModel.isArabic + ? items[index] + .nameAr != + "" + ? items[index] + .nameAr + : items[index] + .nameEn + : items[index].nameEn, + color: Color(0xFF575757), + fontSize: 16, + fontWeight: + FontWeight.w600, + ), ), ), - ), - ], - ), - if(widget - .isServiceSelected( - items[index])) - Column(children: [ - TextFields( - onTapTextFields: widget.model - .allergySeverityList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: widget.model - .allergySeverityList, - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - mySelectedAllergy - .selectedAllergySeverity = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: (BuildContext - context) { - return dialog; - }, - ); - } - : null, - hasLabelText: - mySelectedAllergy - .selectedAllergySeverity != - null - ? true - : false, - showLabelText: true, - hintText: - TranslationBase - .of(context) - .selectSeverity, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: severityController, - validator: (value) { - if (value == null) - return TranslationBase - .of( - context) - .emptyMessage; - else - return null; - }), - SizedBox( - height: 5, + ], ), - if(isSubmitted && - mySelectedAllergy - .selectedAllergySeverity == null) - Row( - - children: [ - CustomValidationError(), - ], - mainAxisAlignment: MainAxisAlignment.start, - ), - - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( + if(widget + .isServiceSelected( + items[index])) + Column(children: [ + TextFields( + onTapTextFields: widget.model + .allergySeverityList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: widget.model + .allergySeverityList, + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + mySelectedAllergy + .selectedAllergySeverity = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, hasLabelText: - remarkController.text != - '' + mySelectedAllergy + .selectedAllergySeverity != + null ? true : false, showLabelText: true, - hintText: TranslationBase - .of( - context) - .remarks, + hintText: + TranslationBase + .of(context) + .selectSeverity, fontSize: 13.5, + readOnly: true, // hintColor: Colors.black, fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 10, - initialValue: isSelected - ? mySelectedAllergy - .remark : '', - // controller: remarkControlle - - onChanged: (value) { - if (isSelected) { - mySelectedAllergy - .remark = value; - }; - }, - + maxLines: 2, + minLines: 1, + controller: severityController, validator: (value) { if (value == null) return TranslationBase @@ -310,18 +254,76 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState else return null; }), - ), - SizedBox( - height: 10, - ), - ],) - ], + SizedBox( + height: 5, + ), + if(isSubmitted && + mySelectedAllergy + .selectedAllergySeverity == null) + Row( + + children: [ + CustomValidationError(), + ], + mainAxisAlignment: MainAxisAlignment.start, + ), + + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hasLabelText: + remarkController.text != + '' + ? true + : false, + showLabelText: true, + hintText: TranslationBase + .of( + context) + .remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 10, + initialValue: isSelected + ? mySelectedAllergy + .remark : '', + // controller: remarkControlle + + onChanged: (value) { + if (isSelected) { + mySelectedAllergy + .remark = value; + }; + }, + + validator: (value) { + if (value == null) + return TranslationBase + .of( + context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ],) + ], + ), ), - ), - // DividerWithSpacesAround(), - ], - ); - }, + // DividerWithSpacesAround(), + ], + ); + }, + ), ), ), ), From e6f2ed51971f89a90e481ad1bc9389fdb416ac1e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 8 Apr 2021 10:35:03 +0300 Subject: [PATCH 15/19] change the add item box --- .../subjective/update_Chief_complaints.dart | 37 +-------- .../subjective/update_allergies_widget.dart | 77 +++++++++++++----- .../subjective/update_history_widget.dart | 81 +++++++++++++------ 3 files changed, 113 insertions(+), 82 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart index fd424767..1b159ec0 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart @@ -46,40 +46,9 @@ class UpdateChiefComplaints extends StatelessWidget { child: CustomValidationError( error: complaintsControllerError, )), - - // Container( - // margin: - // EdgeInsets.only(left: 10, right: 10, top: 15), - // child: TextFields( - // hasLabelText: complaintsController.text != '' - // ? true - // : false, - // hintText: TranslationBase - // .of(context) - // .addChiefComplaints, - // fontSize: 13.5, - // // hintColor: Colors.black, - // showLabelText: true, - // fontWeight: FontWeight.w600, - // maxLines: 25, - // minLines: 13, - // controller: complaintsController, - // validator: (value) { - // if (value == null || value == "") - // return TranslationBase.of(context) - // .emptyMessage; - // else if (value.length < 25) - // return TranslationBase - // .of(context) - // .chiefComplaintLength; - // //""; - // else - // return null; - // }), - // ), - SizedBox( - height: 20, - ), + SizedBox( + height: 20, + ), NewTextFields( hintText: TranslationBase 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 c31e8e59..2a25861a 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,4 +1,5 @@ import 'package:autocomplete_textfield/autocomplete_textfield.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'; @@ -40,28 +41,60 @@ class _UpdateAllergiesWidgetState extends State { return Column( children: [ - Container( - 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, changeAllState); - }, - readOnly: true, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: Color(0xFF2B353E), - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), + InkWell( + onTap: () { + openAllergiesList(context, changeAllState); + }, + 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).addAllergies}", + 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, + ) + ], + ), + ), ), SizedBox( height: 20, 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 eb69e7a5..aba4af07 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 @@ -9,6 +9,7 @@ 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_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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'; @@ -49,28 +50,60 @@ class _UpdateHistoryWidgetState extends State ProjectViewModel projectViewModel = Provider.of(context); return Column( children: [ - Container( - 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); - }, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: Color(0xFF2B353E), - readOnly: true, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), + InkWell( + onTap: () { + openHistoryList(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).addHistory}", + 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, + ) + ], + ), + ), ), SizedBox( height: 20, @@ -143,10 +176,6 @@ class _UpdateHistoryWidgetState extends State } removeHistory(MasterKeyModel historyKey) { - // Iterable history = widget.myHistoryList.where((element) => - // masterKey.id == element.id && masterKey.typeId == element.typeId); - // - List history = // ignore: missing_return widget.myHistoryList.where((element) => From d9878598656793107f3190a8cc6a57856597723c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 8 Apr 2021 11:39:51 +0300 Subject: [PATCH 16/19] make allergies as expandable widget --- lib/icons_app/config.json | 3 +- .../subjective/update_subjective_page.dart | 3 +- lib/widgets/shared/app_drawer_widget.dart | 21 +- ..._key_checkbox_search_allergies_widget.dart | 206 +++++++++++++++++- 4 files changed, 219 insertions(+), 14 deletions(-) diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index dfd00326..d215cdc1 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -2301,5 +2301,4 @@ ] } ] - } -} \ No newline at end of file + } \ No newline at end of file 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 a5f8bfad..2d475624 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 @@ -205,10 +205,11 @@ class _UpdateSubjectivePageState extends State { doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { + isChiefExpand = true; complaintsController.text = helpers.parseHtmlString( model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text = model.patientChiefComplaintList[0].currentMedication + '\n \n'; + medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; } await getHistory(model); diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 43106db1..41d58931 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -98,7 +98,7 @@ class _AppDrawerState extends State { // " or " + // TranslationBase.of(context).leaves, - DoctorApp.leaves, + DoctorApp.reschedule__1, // subTitle: , ), onTap: () { @@ -121,15 +121,6 @@ class _AppDrawerState extends State { margin: EdgeInsets.symmetric(horizontal: 20), child: Column( children: [ - InkWell( - child: DrawerItem( - TranslationBase.of(context).logout, Icons.settings), - onTap: () async { - Navigator.pop(context); - await helpers.logout(); - projectsProvider.isLogin = false; - }, - ), InkWell( child: DrawerItem( projectsProvider.isArabic @@ -143,6 +134,16 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).logout, DoctorApp.logout_1), + onTap: () async { + Navigator.pop(context); + await helpers.logout(); + projectsProvider.isLogin = false; + }, + ), + ], ), ), diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index e7e15076..497f35c2 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -14,6 +14,7 @@ import 'package:provider/provider.dart'; import 'app_texts_widget.dart'; import 'dialogs/master_key_dailog.dart'; +import 'expandable-widget-header-body.dart'; class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final SOAPViewModel model; @@ -118,7 +119,210 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState .selectedAllergySeverity .nameEn : null : null); - return Column( + return HeaderBodyExpandableNotifier( + headerWidget: InkWell( + onTap: () { + setState(() { + if (widget.isServiceSelected( + items[index])) { + widget + .removeAllergy( + items[index]); + } else { + // TODO add Allergy + + MySelectedAllergy + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true); + widget.addAllergy( + mySelectedAllergy); + } + }); + }, + child: Row( + children: [ + Checkbox( + value: widget + .isServiceSelected( + items[index]), + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + // setState(() { + // if (widget + // .isServiceSelected(items[index])) { + // widget.removeHistory(items[index]); + // } else { + // widget.addHistory(items[index]); + // } + // }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: AppText( + projectViewModel.isArabic + ? items[index] + .nameAr != + "" + ? items[index] + .nameAr + : items[index] + .nameEn + : items[index].nameEn, + color: Color(0xFF575757), + fontSize: 16, + fontWeight: + FontWeight.w600, + ), + ), + ), + InkWell( + // onTap: onTap, + child: Icon( + isSelected ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline)) + ], + ), + ), + bodyWidget: isSelected?Column(children: [ + TextFields( + onTapTextFields: widget.model + .allergySeverityList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: widget.model + .allergySeverityList, + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + mySelectedAllergy + .selectedAllergySeverity = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, + hasLabelText: + mySelectedAllergy + .selectedAllergySeverity != + null + ? true + : false, + showLabelText: true, + hintText: + TranslationBase + .of(context) + .selectSeverity, + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: severityController, + validator: (value) { + if (value == null) + return TranslationBase + .of( + context) + .emptyMessage; + else + return null; + }), + SizedBox( + height: 5, + ), + if(isSubmitted && + mySelectedAllergy + .selectedAllergySeverity == null) + Row( + + children: [ + CustomValidationError(), + ], + mainAxisAlignment: MainAxisAlignment.start, + ), + + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hasLabelText: + remarkController.text != + '' + ? true + : false, + showLabelText: true, + hintText: TranslationBase + .of( + context) + .remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 10, + initialValue: isSelected + ? mySelectedAllergy + .remark : '', + // controller: remarkControlle + + onChanged: (value) { + if (isSelected) { + mySelectedAllergy + .remark = value; + }; + }, + + validator: (value) { + if (value == null) + return TranslationBase + .of( + context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ],):Column(), + isExpand: isSelected, + ); + + + + + Column( children: [ InkWell( onTap: () { From 136c839c930476ead72c087e08425e51bceb3580 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 8 Apr 2021 12:00:06 +0300 Subject: [PATCH 17/19] hot fixes --- lib/core/viewModel/procedure_View_model.dart | 2 +- .../medical-file/medical_file_details.dart | 159 ++++++++++-------- lib/screens/procedures/ProcedureCard.dart | 7 +- lib/screens/procedures/procedure_screen.dart | 47 +++--- lib/widgets/shared/bottom_nav_bar.dart | 10 +- 5 files changed, 125 insertions(+), 100 deletions(-) diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 9627353f..6632df4d 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -62,7 +62,7 @@ class ProcedureViewModel extends BaseViewModel { await _procedureService.getProcedure(mrn: mrn); if (_procedureService.hasError) { error = _procedureService.error; - setState(ViewState.ErrorLocal); + setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 25ea1f22..bc3323ad 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -468,10 +468,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'ICD', - fontWeight: - FontWeight - .w700, + 'ICD: ', + fontSize: 13.0, ), AppText( model @@ -488,14 +486,20 @@ class _MedicalFileDetailsState extends State { index] .iCD10 .trim(), + fontSize: 13.5, + fontWeight: + FontWeight + .w700, ), SizedBox( - width: 35.0), + width: 15.0), + ], + ), + Row( + children: [ AppText( 'Condition: ', - fontWeight: - FontWeight - .w700, + fontSize: 12.5, ), Expanded( child: AppText( @@ -514,6 +518,10 @@ class _MedicalFileDetailsState extends State { index] .condition .trim(), + fontSize: 13.0, + fontWeight: + FontWeight + .w700, ), ), ], @@ -539,6 +547,7 @@ class _MedicalFileDetailsState extends State { fontWeight: FontWeight .w700, + fontSize: 15.0, ), ) ], @@ -547,24 +556,29 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Type: ', - fontWeight: - FontWeight - .w700, + fontSize: 15.5, ), Expanded( - child: AppText(model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .type), + child: AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .type, + fontSize: 16.0, + fontWeight: + FontWeight + .w700, + ), ), ], ), @@ -700,9 +714,6 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Procedure ID: ', - fontWeight: - FontWeight - .w700, ), AppText( model @@ -720,6 +731,11 @@ class _MedicalFileDetailsState extends State { index] .procedureId .trim(), + fontSize: + 13.5, + fontWeight: + FontWeight + .w700, ), ], ), @@ -729,9 +745,6 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Order Date: ', - fontWeight: - FontWeight - .w700, ), AppText( Helpers.getDateFormatted( @@ -755,6 +768,9 @@ class _MedicalFileDetailsState extends State { )), fontSize: 13.5, + fontWeight: + FontWeight + .w700, ), ], ), @@ -792,23 +808,26 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'CPT Code : ', + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .patientID + .toString(), fontWeight: FontWeight .w700, ), - AppText(model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstProcedure[ - index] - .patientID - .toString()), ], ), SizedBox( @@ -924,22 +943,25 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Exam Type: ', + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] + .examDesc, fontWeight: FontWeight .w700, ), - AppText(model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstPhysicalExam[ - index] - .examDesc), ], ), Row( @@ -968,22 +990,25 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Abnormal: ', + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] + .abnormal, fontWeight: FontWeight .w700, ), - AppText(model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstPhysicalExam[ - index] - .abnormal), ], ), SizedBox( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 31595fa6..1b51ba30 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -162,12 +162,15 @@ class ProcedureCard extends StatelessWidget { ), if (entityList.categoryID == 2 || entityList.categoryID == 4) - Icon(Icons.edit) + InkWell( + child: Icon(Icons.edit), + onTap: onTap, + ) ], ) ], ), - onTap: onTap, + //onTap: onTap, ), ), ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 7d95fd35..b4299d2e 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -115,31 +115,28 @@ class ProcedureScreen extends StatelessWidget { model.procedureList[0].entityList[index].categoryID, entityList: model.procedureList[0].entityList[index], onTap: () { - // if (model.procedureList[0].entityList[index] - // .categoryID == - // 2 || - // model.procedureList[0].entityList[index] - // .categoryID == - // 4) { - updateProcedureForm(context, - model: model, - patient: patient, - remarks: model - .procedureList[0].entityList[index].remarks, - orderType: model - .procedureList[0].entityList[index].orderType - .toString(), - orderNo: model - .procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0] - .entityList[index].procedureName, - categoreId: model - .procedureList[0].entityList[index].categoryID - .toString(), - procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0].entityList[index] - .lineItemNo); + if (model.procedureList[0].entityList[index].categoryID == + 2 || + model.procedureList[0].entityList[index].categoryID == 4) + updateProcedureForm(context, + model: model, + patient: patient, + remarks: model + .procedureList[0].entityList[index].remarks, + orderType: model.procedureList[0] + .entityList[index].orderType + .toString(), + orderNo: model + .procedureList[0].entityList[index].orderNo, + procedureName: model.procedureList[0] + .entityList[index].procedureName, + categoreId: model.procedureList[0] + .entityList[index].categoryID + .toString(), + procedureId: model.procedureList[0] + .entityList[index].procedureId, + limetNo: model.procedureList[0] + .entityList[index].lineItemNo); // } else // helpers.showErrorToast( // 'You Cant Update This Procedure'); diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 026f46b2..0f5673ab 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -37,8 +37,8 @@ class _BottomNavBarState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ BottomNavigationItem( - icon: DoctorApp.home_icon, - activeIcon: DoctorApp.home_icon_active, + icon: DoctorApp.home_icon_active, + activeIcon: DoctorApp.home_active, changeIndex: _changeIndex, index: _index, currentIndex: 0, @@ -46,7 +46,7 @@ class _BottomNavBarState extends State { ), BottomNavigationItem( icon: DoctorApp.schedule_icon, - activeIcon: DoctorApp.scdedule_icon_active, + activeIcon: DoctorApp.scdedule_icon_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 1, @@ -54,7 +54,7 @@ class _BottomNavBarState extends State { ), BottomNavigationItem( icon: DoctorApp.qr_code, - activeIcon: DoctorApp.qr_code, + activeIcon: DoctorApp.qr_reader_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 2, @@ -62,7 +62,7 @@ class _BottomNavBarState extends State { ), BottomNavigationItem( icon: DoctorApp.message_icon, - activeIcon: DoctorApp.message_icon_active, + activeIcon: DoctorApp.dr_reply_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 3, From ed02bbc1f00a62d162858238600423e93f51aa4d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 8 Apr 2021 12:47:06 +0300 Subject: [PATCH 18/19] fix allergy --- lib/models/SOAP/my_selected_allergy.dart | 8 +- ..._key_checkbox_search_allergies_widget.dart | 249 ++++++++++-------- 2 files changed, 149 insertions(+), 108 deletions(-) diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index 5a6bd749..c4e52af7 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -5,6 +5,7 @@ class MySelectedAllergy { MasterKeyModel selectedAllergy; String remark; bool isChecked; + bool isExpanded; int createdBy; MySelectedAllergy( @@ -12,6 +13,7 @@ class MySelectedAllergy { this.selectedAllergy, this.remark, this.isChecked, + this.isExpanded = true, this.createdBy}); MySelectedAllergy.fromJson(Map json) { @@ -22,7 +24,8 @@ class MySelectedAllergy { ? new MasterKeyModel.fromJson(json['selectedAllergy']) : null; remark = json['remark']; - remark = json['isChecked']; + isChecked = json['isChecked']; + isExpanded = json['isExpanded']; createdBy = json['createdBy']; } @@ -35,7 +38,8 @@ class MySelectedAllergy { data['selectedAllergy'] = this.selectedAllergy.toJson(); } data['remark'] = this.remark; - data['isChecked'] = this.remark; + data['isChecked'] = this.isChecked; + data['isExpanded'] = this.isExpanded; data['createdBy'] = this.createdBy; return data; } diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 497f35c2..f84db092 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -96,115 +96,149 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: ListView.builder( itemCount: items.length, itemBuilder: (context, index) { - bool isSelected = widget.isServiceSelected( - items[index]); + bool isSelected = + widget.isServiceSelected(items[index]); MySelectedAllergy mySelectedAllergy; if (isSelected) { - mySelectedAllergy = widget - .getServiceSelectedAllergy( - items[index]); + mySelectedAllergy = + widget.getServiceSelectedAllergy( + items[index]); } - TextEditingController remarkController = TextEditingController( - text: isSelected ? mySelectedAllergy - .remark : null); - TextEditingController severityController = TextEditingController( - text: isSelected ? mySelectedAllergy - .selectedAllergySeverity != null - ? projectViewModel - .isArabic - ? mySelectedAllergy - .selectedAllergySeverity - .nameAr - : mySelectedAllergy - .selectedAllergySeverity - .nameEn - : null : null); + TextEditingController remarkController = + TextEditingController( + text: isSelected + ? mySelectedAllergy.remark + : null); + TextEditingController severityController = + TextEditingController( + text: isSelected + ? mySelectedAllergy + .selectedAllergySeverity != + null + ? projectViewModel.isArabic + ? mySelectedAllergy + .selectedAllergySeverity + .nameAr + : mySelectedAllergy + .selectedAllergySeverity + .nameEn + : null + : null); return HeaderBodyExpandableNotifier( - headerWidget: InkWell( - onTap: () { - setState(() { - if (widget.isServiceSelected( - items[index])) { - widget - .removeAllergy( - items[index]); - } else { - // TODO add Allergy + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Checkbox( + value: + widget.isServiceSelected( + items[index]), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + // setState(() { + // if (widget + // .isServiceSelected(items[index])) { + // widget.removeHistory(items[index]); + // } else { + // widget.addHistory(items[index]); + // } + // }); + }), + InkWell( + onTap: () { + setState(() { + if (widget + .isServiceSelected( + items[index])) { + widget.removeAllergy( + items[index]); + } else { + // TODO add Allergy - MySelectedAllergy - mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[index], - selectedAllergySeverity: - _selectedAllergySeverity, - remark: null, - isChecked: true); - widget.addAllergy( - mySelectedAllergy); - } - }); - }, - child: Row( - children: [ - Checkbox( - value: widget - .isServiceSelected( - items[index]), - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - // setState(() { - // if (widget - // .isServiceSelected(items[index])) { - // widget.removeHistory(items[index]); - // } else { - // widget.addHistory(items[index]); - // } - // }); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: AppText( - projectViewModel.isArabic - ? items[index] - .nameAr != - "" - ? items[index] - .nameAr - : items[index] - .nameEn - : items[index].nameEn, - color: Color(0xFF575757), - fontSize: 16, - fontWeight: - FontWeight.w600, + MySelectedAllergy + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy( + mySelectedAllergy); + } + }); + }, + child: Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Container( + + child: AppText( + projectViewModel.isArabic + ? items[index] + .nameAr != + "" + ? items[index] + .nameAr + : items[index] + .nameEn + : items[index].nameEn, + color: Color(0xFF575757), + fontSize: 16, + fontWeight: + FontWeight.w600, + ), + width: MediaQuery.of(context).size.width * 0.55, + ), + ), ), ), - ), - InkWell( - // onTap: onTap, - child: Icon( - isSelected ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline)) - ], - ), + ], + ), + InkWell( + onTap: () { + if (mySelectedAllergy != null) { + setState(() { + mySelectedAllergy + .isExpanded = + mySelectedAllergy + .isExpanded + ? false + : true; + }); + } + }, + child: Icon((mySelectedAllergy != + null + ? mySelectedAllergy + .isExpanded + : false) + ? EvaIcons + .arrowIosUpwardOutline + : EvaIcons + .arrowIosDownwardOutline)) + ], ), - bodyWidget: isSelected?Column(children: [ - TextFields( - onTapTextFields: widget.model - .allergySeverityList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: widget.model - .allergySeverityList, - okText: - TranslationBase.of( + bodyWidget: Column( + children: [ + TextFields( + onTapTextFields: widget.model + .allergySeverityList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: widget.model + .allergySeverityList, + okText: + TranslationBase.of( context) .ok, okFunction: @@ -228,9 +262,10 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } : null, hasLabelText: - mySelectedAllergy - .selectedAllergySeverity != - null + mySelectedAllergy != null && + mySelectedAllergy + .selectedAllergySeverity != + null ? true : false, showLabelText: true, @@ -315,8 +350,10 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState SizedBox( height: 10, ), - ],):Column(), - isExpand: isSelected, + ],), + isExpand: mySelectedAllergy != null + ? mySelectedAllergy.isExpanded + : false, ); From a768dd63cfad6fd595a7d6fd9e4ff750f2fd5238 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 8 Apr 2021 14:53:38 +0300 Subject: [PATCH 19/19] fix steps --- .../profile/soap_update/steps_widget.dart | 173 +++++++++++------- .../soap_update/update_soap_index.dart | 134 +++++++------- 2 files changed, 177 insertions(+), 130 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 3ad583d0..0abc84c7 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -22,18 +22,21 @@ class StepsWidget extends StatelessWidget { children: [ Container( height: height == 0 ? 150 : height, - width: MediaQuery.of(context).size.width, + width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, child: Center( - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, + child: Container( + width: MediaQuery.of(context).size.width * 0.87, + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), ), ), ), Positioned( - top: 50, + top: 43, left: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -84,8 +87,11 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, - left: MediaQuery.of(context).size.width * 0.28, + top: 43, + left: MediaQuery + .of(context) + .size + .width * 0.25, child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( @@ -137,8 +143,11 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, - left: MediaQuery.of(context).size.width * 0.52, + top: 43, + left: MediaQuery + .of(context) + .size + .width * 0.50, child: InkWell( onTap: () { if (index >= 3) changeCurrentTab(2); @@ -192,7 +201,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, + top: 43, right: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -218,30 +227,28 @@ class StepsWidget extends StatelessWidget { ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( height: 5, ), - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - "Plan", - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - fontSize: 12, - ), - StatusLabel( - selectedStepId: index, - stepId: 3, - ), - ], - ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + "Plan", + fontWeight: FontWeight.bold, + // textAlign: TextAlign.center, + fontSize: 12, + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], ), ], ), @@ -264,7 +271,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, + top: 43, right: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -286,28 +293,39 @@ class StepsWidget extends StatelessWidget { ? Color(0xFFCC9B14) : index > 0 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 5), - AppText( - "شخصي", - fontWeight: FontWeight.bold, - fontSize: 16, + Column( + children: [ + AppText( + "شخصي", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + StatusLabel( + selectedStepId: index, + stepId: 0, + ), + ], ), ], ), ), ), Positioned( - top: 50, - right: MediaQuery.of(context).size.width * 0.28, + top: 43, + right: MediaQuery + .of(context) + .size + .width * 0.28, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -328,28 +346,39 @@ class StepsWidget extends StatelessWidget { ? Color(0xFFCC9B14) : index > 1 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 5), - AppText( - "هدف", - fontWeight: FontWeight.bold, - fontSize: 14, + Column( + children: [ + AppText( + "هدف", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + StatusLabel( + selectedStepId: index, + stepId: 1, + ), + ], ), ], ), ), ), Positioned( - top: 50, - right: MediaQuery.of(context).size.width * 0.52, + top: 43, + right: MediaQuery + .of(context) + .size + .width * 0.52, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( @@ -384,10 +413,18 @@ class StepsWidget extends StatelessWidget { ), Padding( padding: const EdgeInsets.only(right: 2), - child: AppText( - "تقدير", - fontWeight: FontWeight.bold, - fontSize: 14, + child: Column( + children: [ + AppText( + "تقدير", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + StatusLabel( + selectedStepId: index, + stepId: 2, + ), + ], ), ), ], @@ -395,12 +432,12 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, + top: 43, left: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( width: 38, @@ -431,10 +468,18 @@ class StepsWidget extends StatelessWidget { ), Container( margin: EdgeInsets.only(right: index == 3 ? 15 : 0), - child: AppText( - "خطة", - fontWeight: FontWeight.bold, - fontSize: 14, + child: Column( + children: [ + AppText( + "خطة", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], ), ), ], 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 e774d913..db9bf63a 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -68,75 +68,77 @@ class _UpdateSoapIndexState extends State // baseViewModel: model, isLoading: _isLoading, isShowAppBar: false, - 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, + 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', height: MediaQuery.of(context).size.height * 0.28,), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), ), - ), - 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) - ], + 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.20, + ), ), - ) - ], + 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) + ], + ), + ) + ], + ), ), - ), - ], + ], + ), ), ), );