Finish first step subjective_page.dart

pull/190/head
Elham Rababah 5 years ago
parent 518c30bdeb
commit dcba85c7b9

@ -279,4 +279,8 @@ const Map<String, Map<String, String>> localizedValues = {
'healthRecordInformation': {'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي'},
'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'},
'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'},
"empty-message": {
"en": "Please enter message",
"ar": "يرجى ادخال الموضوع"
},
};

@ -299,6 +299,8 @@ class TranslationBase {
String get bed => localizedValues['bed'][locale.languageCode];
String get next => localizedValues['next'][locale.languageCode];
String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode];
String get emptyMessage => localizedValues['empty-message'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -46,124 +46,126 @@ class _AddSOAPIndexState extends State<AddSOAPIndex>
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).healthRecordInformation,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration:
BoxDecoration(boxShadow: <BoxShadow>[], color: Colors.white),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 5,
),
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration:
BoxDecoration(boxShadow: <BoxShadow>[], color: Colors.white),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 20,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
width: 20,
),
FractionallySizedBox(
child: SingleChildScrollView(
child: Container(
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,
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 5,
),
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
SubjectivePage(changePageViewIndex: changePageViewIndex,),
ObjectivePage(changePageViewIndex: changePageViewIndex,),
AssessmentPage(changePageViewIndex: changePageViewIndex,),
PlanPage(changePageViewIndex: changePageViewIndex,)
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 20,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
),
],
),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
)
],
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
width: 20,
),
FractionallySizedBox(
child: SingleChildScrollView(
child: Container(
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: <Widget>[
SubjectivePage(changePageViewIndex: changePageViewIndex,),
ObjectivePage(changePageViewIndex: changePageViewIndex,),
AssessmentPage(changePageViewIndex: changePageViewIndex,),
PlanPage(changePageViewIndex: changePageViewIndex,)
],
),
),
],
),
),
),
)
],
),
),
),
],
],
),
),
),
);

@ -0,0 +1,115 @@
import 'package:doctor_app_flutter/config/config.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:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class AddAllergiesWidget extends StatefulWidget {
@override
_AddAllergiesWidgetState createState() => _AddAllergiesWidgetState();
}
class _AddAllergiesWidgetState extends State<AddAllergiesWidget> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Allergies",
fontSize: 13.5,
onTapTextFields: () {
openAllergiesList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('White Egg'.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black),
Texts('Severe'.toUpperCase(),
variant: "bodyText",
bold: true,
color: AppGlobal.appPrimaryColor),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
SizedBox(
height: 20,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('White Egg'.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black),
Texts('Severe'.toUpperCase(),
variant: "bodyText",
bold: true,
color: AppGlobal.appPrimaryColor),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
],
),
)
],
);
}
openAllergiesList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: Container(
child: Center(
child: Texts("openAllergiesList"),
)),
);
});
}
}

@ -0,0 +1,107 @@
import 'package:doctor_app_flutter/config/config.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:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class AddHistoryWidget extends StatefulWidget {
@override
_AddHistoryWidgetState createState() => _AddHistoryWidgetState();
}
class _AddHistoryWidgetState extends State<AddHistoryWidget> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add History",
fontSize: 13.5,
onTapTextFields: () {
openHistoryList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('Abdomen Pain',
variant: "bodyText",
bold: true,
color: Colors.black),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
SizedBox(
height: 20,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('Back Pain',
variant: "bodyText",
bold: true,
color: Colors.black),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
],
),
)
],
);
}
openHistoryList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: Container(
child: Center(
child: Texts("HistoryList"),
)),
);
});
}
}

@ -0,0 +1,107 @@
import 'package:doctor_app_flutter/config/config.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:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class AddMedication extends StatefulWidget {
@override
_AddMedicationState createState() => _AddMedicationState();
}
class _AddMedicationState extends State<AddMedication> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Current Medications",
fontSize: 13.5,
onTapTextFields: () {
openMedicationsList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('Abdomen Pain',
variant: "bodyText",
bold: true,
color: Colors.black),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
SizedBox(
height: 20,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('Back Pain',
variant: "bodyText",
bold: true,
color: Colors.black),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
],
),
)
],
);
}
openMedicationsList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: Container(
child: Center(
child: Texts("dfdfd"),
)),
);
});
}
}

@ -0,0 +1,242 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_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';
class SubjectivePage extends StatefulWidget {
final Function changePageViewIndex;
SubjectivePage({Key key, this.changePageViewIndex});
@override
_SubjectivePageState createState() => _SubjectivePageState();
}
class _SubjectivePageState extends State<SubjectivePage> {
bool isChiefExpand = true;
bool isHistoryExpand = false;
bool isAllergiesExpand = false;
TextEditingController messageController = TextEditingController();
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('CHIEF COMPLAINTS',
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: Column(children: [
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Chief Complaints",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context).emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "History of Present Illness",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context).emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
AddMedication(),
]),
isExpand: isChiefExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('History',
variant: isHistoryExpand ? "bodyText" : '',
bold: isHistoryExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
});
},
child: Icon(isHistoryExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(
children: [
AddHistoryWidget()
],
),
isExpand: isHistoryExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('Allergies',
variant: isAllergiesExpand ? "bodyText" : '',
bold: isAllergiesExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isAllergiesExpand = !isAllergiesExpand;
});
},
child: Icon(isAllergiesExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget:Column(
children: [
AddAllergiesWidget(),
SizedBox(
height: 30,
),
],
)
,
isExpand: isAllergiesExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
AppButton(
title: TranslationBase.of(context).next,
onPressed: () {
widget.changePageViewIndex(1);
},
),
],
),
),
),
));
}
}

@ -1,56 +0,0 @@
import 'package:doctor_app_flutter/config/config.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/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class SubjectivePage extends StatelessWidget {
final Function changePageViewIndex;
SubjectivePage({Key key, this.changePageViewIndex});
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
// baseViewModel: widget.model,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(height: 30,),
Row(children: [
Row(
children: [
Texts('ASSESSMENT',
variant: "bodyText",
bold: true,
color: Colors.black),
Icon(FontAwesomeIcons.asterisk, color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
Icon(EvaIcons.plus)
],),
AppButton(
title: TranslationBase.of(context).next,
onPressed: () {
changePageViewIndex(1);
},
),
],
),
),
),
));
}
}

@ -8,7 +8,7 @@ class TextFields extends StatefulWidget {
TextFields({Key key, this.type, this.hintText, this.suffixIcon, this.autoFocus, this.onChanged, this.initialValue, this.minLines, this.maxLines, this.inputFormatters, this.padding, this.focus=false, this.maxLengthEnforced=true,
this.suffixIconColor, this.inputAction, this.onSubmit, this.keepPadding=true, this.textCapitalization = TextCapitalization.none, this.onTap, this.controller, this.keyboardType, this.validator, this.borderOnlyError=false,
this.onSaved, this.onSuffixTap, this.readOnly: false, this.maxLength, this.prefixIcon, this.bare=false, this.fontSize=16.0, this.fontWeight=FontWeight.w700, this.autoValidate=false}) : super(key: key);
this.onSaved, this.onSuffixTap, this.readOnly: false, this.maxLength, this.prefixIcon, this.bare=false, this.fontSize=16.0, this.fontWeight=FontWeight.w700, this.autoValidate=false, this.onTapTextFields}) : super(key: key);
final String hintText;
final String initialValue;
@ -18,6 +18,7 @@ class TextFields extends StatefulWidget {
final Color suffixIconColor;
final IconData prefixIcon;
final VoidCallback onTap;
final Function onTapTextFields;
final TextEditingController controller;
final TextInputType keyboardType;
final FormFieldValidator validator;
@ -112,6 +113,7 @@ class _TextFieldsState extends State<TextFields> {
boxShadow: [BoxShadow(color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0)]
),
child: TextFormField(
onTap: widget.onTapTextFields,
keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(),
autovalidate: widget.autoValidate,

Loading…
Cancel
Save