first step from design of subject page and ExpandableSOAPWidget

merge-requests/420/head
Elham Rababah 4 years ago
parent e041538fb8
commit 5dcc875a0a

@ -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/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<UpdateSubjectivePage> {
},
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<UpdateSubjectivePage> {
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<UpdateSubjectivePage> {
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<UpdateSubjectivePage> {
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<UpdateSubjectivePage> {
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<UpdateSubjectivePage> {
myHistoryList: widget.myHistoryList);
},
),
],
),
),),
SizedBox(
height: 15,
),
),
),
),
],
),),
),
);
}
@ -624,12 +592,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
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);
}
}
}
}

@ -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<UpdateSoapIndex>
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: <BoxShadow>[], color: Colors.white),
decoration: BoxDecoration(
boxShadow: <BoxShadow>[],
color: Theme.of(context).scaffoldBackgroundColor),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
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<UpdateSoapIndex>
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
@ -106,32 +116,32 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
scrollDirection: Axis.horizontal,
children: <Widget>[
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
)
],

Loading…
Cancel
Save