diff --git a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart new file mode 100644 index 00000000..24a69a0b --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart @@ -0,0 +1,61 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class ExpandableSOAPWidget extends StatelessWidget { + final bool isExpanded; + final Widget child; + final Function onTap; + final headerTitle; + + const ExpandableSOAPWidget( + {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(vertical: 20, horizontal: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), + ), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts(headerTitle, + variant: isExpanded ? "bodyText" : '', + bold: isExpanded ? true : false, + fontSize: 20, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: onTap, + child: Icon( + isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline)) + ], + ), + bodyWidget: child, + isExpand: isExpanded, + ), + ); + } +} \ 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 3bc89a7f..c8ac819d 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 @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -20,14 +19,13 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../expandable_SOAP_widget.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -220,6 +218,9 @@ class _UpdateSubjectivePageState extends State { }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), @@ -232,46 +233,31 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 30, ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase.of(context).chiefComplaints.toUpperCase(), - variant: isChiefExpand ? "bodyText" : '', - bold: isChiefExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isChiefExpand = !isChiefExpand; - }); - }, - child: Icon( - isChiefExpand ? EvaIcons.minus : EvaIcons.plus)) - ], - ), - bodyWidget: Form( + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .chiefComplaints + .toUpperCase(), + onTap: () { + setState(() { + isChiefExpand = !isChiefExpand; + }); + }, + child: Form( key: formKey, child: Column(children: [ SizedBox( height: 20, ), Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hasLabelText: complaintsController.text != '' ? true : false, - hintText: TranslationBase.of(context) + hintText: TranslationBase + .of(context) .addChiefComplaints, fontSize: 13.5, // hintColor: Colors.black, @@ -297,11 +283,11 @@ class _UpdateSubjectivePageState extends State { height: 20, ), Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hasLabelText: illnessController.text != '' - ? true - : false, + hasLabelText: + illnessController.text != '' ? true : false, showLabelText: true, hintText: TranslationBase .of(context) @@ -326,12 +312,15 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), - UpdateMedicationWidget(medicationController: medicationController,), + UpdateMedicationWidget( + medicationController: medicationController, + ), SizedBox( height: 10, ), Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hasLabelText: medicationController.text != '' ? true @@ -358,117 +347,94 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), - ]), ), - isExpand: isChiefExpand, - ), - - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + isExpanded: isChiefExpand, ), SizedBox( height: 30, ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .histories - .toUpperCase(), - variant: isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column( + + + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .histories + .toUpperCase(), + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Column( children: [ UpdateHistoryWidget(myHistoryList: widget.myHistoryList) ], ), - isExpand: isHistoryExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + isExpanded: isHistoryExpand, ), SizedBox( height: 30, ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .allergiesSoap - .toUpperCase(), - variant: isAllergiesExpand ? "bodyText" : '', - bold: isAllergiesExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isAllergiesExpand = !isAllergiesExpand; - }); - }, - child: Icon(isAllergiesExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget:Column( + + + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .allergiesSoap + .toUpperCase(), + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Column( children: [ - UpdateAllergiesWidget(myAllergiesList: widget.myAllergiesList,), + UpdateAllergiesWidget(myAllergiesList: widget + .myAllergiesList,), SizedBox( height: 30, ), ], - ) - , - isExpand: isAllergiesExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + ), + isExpanded: isAllergiesExpand, ), SizedBox( - height: 30, + height:MediaQuery.of(context).size.height * 0.2, ), - AppButton( - title: TranslationBase.of(context).next, + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), + ), + height: MediaQuery + .of(context) + .size + .height * 0.15, + width: double.infinity, + + child: Column( + children: [ + SizedBox( + height: 15, + ), + Container(child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase + .of(context) + .next, loading: model.state == ViewState.BusyLocal, onPressed: () async { addSubjectiveInfo( @@ -477,11 +443,13 @@ class _UpdateSubjectivePageState extends State { myHistoryList: widget.myHistoryList); }, ), - ], + ), + ),), + SizedBox( + height: 15, ), - ), - ), - ), + ], + ),), ), ); } @@ -624,12 +592,13 @@ class _UpdateSubjectivePageState extends State { numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { // TODO: make it postChiefComplaint after it start to work - postChiefComplaintRequestModel.editedBy=''; + postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); } else { await model.patchChiefComplaint(postChiefComplaintRequestModel); } } - } } + + 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 5c646121..95d03cec 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -6,8 +6,6 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; @@ -17,11 +15,13 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../patient-profile-header-new-design.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); + @override _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); } @@ -65,30 +65,39 @@ class _UpdateSoapIndexState extends State builder: (_, model, w) => AppScaffold( // baseViewModel: model, isLoading: _isLoading, - appBarTitle: TranslationBase.of(context).healthRecordInformation, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).healthRecordInformation, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - decoration: - BoxDecoration(boxShadow: [], color: Colors.white), + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), + // PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign(patient, '7', '7'), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), 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), + left: MediaQuery.of(context).size.width * + 0.05, + right: MediaQuery.of(context).size.width * + 0.05), child: StepsWidget( index: _currentIndex, changeCurrentTab: changePageViewIndex, @@ -96,6 +105,7 @@ class _UpdateSoapIndexState extends State ), Expanded( child: PageView( + physics: NeverScrollableScrollPhysics(), controller: _controller, onPageChanged: (index) { @@ -106,32 +116,32 @@ class _UpdateSoapIndexState extends State scrollDirection: Axis.horizontal, children: [ UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - mySelectedExamination: - mySelectedExamination, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + mySelectedExamination: + mySelectedExamination, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - mySelectedAssessmentList: - mySelectedAssessment, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + mySelectedAssessmentList: + mySelectedAssessment, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - patientInfo: patient, + changePageViewIndex: changePageViewIndex, + patientInfo: patient, patientProgressNote: patientProgressNote, - changeLoadingState:changeLoadingState + changeLoadingState: changeLoadingState ) ],