Merge branch 'soap_new_design' into 'development'

first step from design of subject page and ExpandableSOAPWidget

See merge request Cloud_Solution/doctor_app_flutter!420
merge-requests/421/merge
Mohammad Aljammal 5 years ago
commit 1df3c1b2c2

@ -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,
),
);
}
}

@ -1,5 +1,4 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; 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/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/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_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_history_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_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/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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_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: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 { class UpdateSubjectivePage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
@ -220,6 +218,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme
.of(context)
.scaffoldBackgroundColor,
// baseViewModel: model, // baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
@ -232,46 +233,31 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
HeaderBodyExpandableNotifier( ExpandableSOAPWidget(
headerWidget: Row( headerTitle: TranslationBase
mainAxisAlignment: MainAxisAlignment.spaceBetween, .of(context)
children: [ .chiefComplaints
Row( .toUpperCase(),
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: () { onTap: () {
setState(() { setState(() {
isChiefExpand = !isChiefExpand; isChiefExpand = !isChiefExpand;
}); });
}, },
child: Icon( child: Form(
isChiefExpand ? EvaIcons.minus : EvaIcons.plus))
],
),
bodyWidget: Form(
key: formKey, key: formKey,
child: Column(children: [ child: Column(children: [
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hasLabelText: complaintsController.text != '' hasLabelText: complaintsController.text != ''
? true ? true
: false, : false,
hintText: TranslationBase.of(context) hintText: TranslationBase
.of(context)
.addChiefComplaints, .addChiefComplaints,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
@ -297,11 +283,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
height: 20, height: 20,
), ),
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hasLabelText: illnessController.text != '' hasLabelText:
? true illnessController.text != '' ? true : false,
: false,
showLabelText: true, showLabelText: true,
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
@ -326,12 +312,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
UpdateMedicationWidget(medicationController: medicationController,), UpdateMedicationWidget(
medicationController: medicationController,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hasLabelText: medicationController.text != '' hasLabelText: medicationController.text != ''
? true ? true
@ -358,117 +347,94 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
]), ]),
), ),
isExpand: isChiefExpand, isExpanded: isChiefExpand,
), ),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
Container(
width: double.infinity,
height: 1, ExpandableSOAPWidget(
color: Color(0xffCCCCCC), headerTitle: TranslationBase
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts(TranslationBase
.of(context) .of(context)
.histories .histories
.toUpperCase(), .toUpperCase(),
variant: isHistoryExpand ? "bodyText" : '',
bold: isHistoryExpand ? true : false,
color: Colors.black),
],
),
InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isHistoryExpand = !isHistoryExpand; isHistoryExpand = !isHistoryExpand;
}); });
}, },
child: Icon(isHistoryExpand child: Column(
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(
children: [ children: [
UpdateHistoryWidget(myHistoryList: widget.myHistoryList) UpdateHistoryWidget(myHistoryList: widget.myHistoryList)
], ],
), ),
isExpand: isHistoryExpand, isExpanded: isHistoryExpand,
), ),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
Container(
width: double.infinity,
height: 1, ExpandableSOAPWidget(
color: Color(0xffCCCCCC), headerTitle: TranslationBase
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts(TranslationBase
.of(context) .of(context)
.allergiesSoap .allergiesSoap
.toUpperCase(), .toUpperCase(),
variant: isAllergiesExpand ? "bodyText" : '',
bold: isAllergiesExpand ? true : false,
color: Colors.black),
],
),
InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isAllergiesExpand = !isAllergiesExpand; isAllergiesExpand = !isAllergiesExpand;
}); });
}, },
child: Icon(isAllergiesExpand child: Column(
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget:Column(
children: [ children: [
UpdateAllergiesWidget(myAllergiesList: widget.myAllergiesList,), UpdateAllergiesWidget(myAllergiesList: widget
.myAllergiesList,),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
], ],
) ),
, isExpanded: isAllergiesExpand,
isExpand: isAllergiesExpand,
), ),
SizedBox( SizedBox(
height: 30, height:MediaQuery.of(context).size.height * 0.2,
),
],
),
),
), ),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
), ),
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( SizedBox(
height: 30, height: 15,
), ),
AppButton( Container(child: FractionallySizedBox(
title: TranslationBase.of(context).next, widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase
.of(context)
.next,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
addSubjectiveInfo( addSubjectiveInfo(
@ -477,11 +443,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
myHistoryList: widget.myHistoryList); myHistoryList: widget.myHistoryList);
}, },
), ),
],
),
),
), ),
),),
SizedBox(
height: 15,
), ),
],
),),
), ),
); );
} }
@ -624,12 +592,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
numberOfWeeks: 0); numberOfWeeks: 0);
if (model.patientChiefComplaintList.isEmpty) { if (model.patientChiefComplaintList.isEmpty) {
// TODO: make it postChiefComplaint after it start to work // TODO: make it postChiefComplaint after it start to work
postChiefComplaintRequestModel.editedBy=''; postChiefComplaintRequestModel.editedBy = '';
await model.postChiefComplaint(postChiefComplaintRequestModel); await model.postChiefComplaint(postChiefComplaintRequestModel);
} else { } else {
await model.patchChiefComplaint(postChiefComplaintRequestModel); await model.patchChiefComplaint(postChiefComplaintRequestModel);
} }
} }
} }
} }

@ -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/SOAP/my_selected_history.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/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/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/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../patient-profile-header-new-design.dart';
class UpdateSoapIndex extends StatefulWidget { class UpdateSoapIndex extends StatefulWidget {
final bool isUpdate; final bool isUpdate;
const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key);
@override @override
_UpdateSoapIndexState createState() => _UpdateSoapIndexState(); _UpdateSoapIndexState createState() => _UpdateSoapIndexState();
} }
@ -65,30 +65,39 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
// baseViewModel: model, // baseViewModel: model,
isLoading: _isLoading, isLoading: _isLoading,
appBarTitle: TranslationBase.of(context).healthRecordInformation, isShowAppBar: false,
// appBarTitle: TranslationBase.of(context).healthRecordInformation,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
decoration: decoration: BoxDecoration(
BoxDecoration(boxShadow: <BoxShadow>[], color: Colors.white), boxShadow: <BoxShadow>[],
color: Theme.of(context).scaffoldBackgroundColor),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
PatientPageHeaderWidget(patient), // PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(patient, '7', '7'),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
FractionallySizedBox( FractionallySizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.75, height: MediaQuery.of(context).size.height * 0.75,
child: Column( child: Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: left: MediaQuery.of(context).size.width *
MediaQuery.of(context).size.width * 0.05, 0.05,
right: right: MediaQuery.of(context).size.width *
MediaQuery.of(context).size.width * 0.05), 0.05),
child: StepsWidget( child: StepsWidget(
index: _currentIndex, index: _currentIndex,
changeCurrentTab: changePageViewIndex, changeCurrentTab: changePageViewIndex,
@ -96,6 +105,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
), ),
Expanded( Expanded(
child: PageView( child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: _controller, controller: _controller,
onPageChanged: (index) { onPageChanged: (index) {
@ -110,28 +120,28 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
myAllergiesList: myAllergiesList, myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList, myHistoryList: myHistoryList,
patientInfo: patient, patientInfo: patient,
changeLoadingState:changeLoadingState changeLoadingState: changeLoadingState
), ),
UpdateObjectivePage( UpdateObjectivePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
mySelectedExamination: mySelectedExamination:
mySelectedExamination, mySelectedExamination,
patientInfo: patient, patientInfo: patient,
changeLoadingState:changeLoadingState changeLoadingState: changeLoadingState
), ),
UpdateAssessmentPage( UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList: mySelectedAssessmentList:
mySelectedAssessment, mySelectedAssessment,
patientInfo: patient, patientInfo: patient,
changeLoadingState:changeLoadingState changeLoadingState: changeLoadingState
), ),
UpdatePlanPage( UpdatePlanPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
patientInfo: patient, patientInfo: patient,
patientProgressNote: patientProgressNote, patientProgressNote: patientProgressNote,
changeLoadingState:changeLoadingState changeLoadingState: changeLoadingState
) )
], ],

Loading…
Cancel
Save