First step objective_page.dart

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

@ -46,6 +46,7 @@ class _PatientReferredScreenState extends State<PatientReferredScreen> {
List<String>list=List(); List<String>list=List();
return AppScaffold( return AppScaffold(
//TODO : add Translation
appBarTitle: "My Referred Patients",//patientTypetitle, appBarTitle: "My Referred Patients",//patientTypetitle,
body: Center( body: Center(

@ -1,18 +1,47 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.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';
class ObjectivePage extends StatelessWidget { class ObjectivePage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
ObjectivePage({Key key, this.changePageViewIndex}); ObjectivePage({Key key, this.changePageViewIndex});
@override
_ObjectivePageState createState() => _ObjectivePageState();
}
class _ObjectivePageState extends State<ObjectivePage> {
bool isSysExaminationExpand = false;
List<dynamic> ExaminationsList;
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 0.5,
)),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
// baseViewModel: widget.model,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Center( child: Center(
@ -21,11 +50,173 @@ class ObjectivePage extends StatelessWidget {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('Physical/System Examination',
variant:
isSysExaminationExpand ? "bodyText" : '',
bold: isSysExaminationExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
});
},
child: Icon(isSysExaminationExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Examination",
fontSize: 13.5,
onTapTextFields: () {
openExaminationList(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'.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
Colors.white,Colors.grey
),
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Normal",
style: TextStyle(
fontSize: 12,
color:
Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
),
)),
),
onTap: () {
}),
SizedBox(width: 12,),
InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
Color(0xFF515A5D), Colors.black
),
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Abnormal",
style: TextStyle(
fontSize: 12,
color:
Colors.white, //Colors.black,
fontWeight: FontWeight.bold,
),
),
),
)),
),
onTap: () {
}),
],
),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
SizedBox(
height: 20,
),
],
),
)
],
)
]),
isExpand: isSysExaminationExpand,
),
DividerWithSpacesAround(height: 30,),
AppButton( AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
onPressed: () { onPressed: () {},
changePageViewIndex(2); ),
}, SizedBox(
height: 30,
), ),
], ],
), ),
@ -33,4 +224,255 @@ class ObjectivePage extends StatelessWidget {
), ),
)); ));
} }
openExaminationList(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
;
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
"Examinations",
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
height: MediaQuery.of(context).size.height * 0.5,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
Column(
children: [
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('Examinations',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('Examinations',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('Examinations',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('Examinations',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('Examinations',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('Examinations',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('Examinations',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('Examinations',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
],
),
],
),
)),
),
SizedBox(
height: 10,
),
AppButton(
title: "Add SELECTED Examinations".toUpperCase(),
onPressed: () {},
),
]),
)),
);
});
}
} }

@ -1,8 +1,10 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/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_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.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:font_awesome_flutter/font_awesome_flutter.dart';
@ -13,8 +15,21 @@ class AddAllergiesWidget extends StatefulWidget {
} }
class _AddAllergiesWidgetState extends State<AddAllergiesWidget> { class _AddAllergiesWidgetState extends State<AddAllergiesWidget> {
List<dynamic> allergiesList;
dynamic _referTo;
dynamic _selectedBranch;
dynamic _selectedClinic;
dynamic _selectedDoctor;
TextEditingController remarkController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery
.of(context)
.size;
return Column( return Column(
children: [ children: [
Container( Container(
@ -95,7 +110,34 @@ class _AddAllergiesWidgetState extends State<AddAllergiesWidget> {
], ],
); );
} }
openAllergiesList(BuildContext context) { openAllergiesList(BuildContext context) {
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
};
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isScrollControlled: true, isScrollControlled: true,
@ -104,8 +146,147 @@ class _AddAllergiesWidgetState extends State<AddAllergiesWidget> {
return FractionallySizedBox( return FractionallySizedBox(
heightFactor: 0.7, heightFactor: 0.7,
child: Container( child: Container(
child: Center( child: FractionallySizedBox(
child: Texts("openAllergiesList"), widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
"Add Allergy",
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: allergiesList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
list: allergiesList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
// model.getDoctorBranch().then((value) {
// _selectedBranch = value;
// if (_referTo['id'] == 1) {
// model.getClinics(
// _selectedBranch['ID']);
// }
// });
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Select Allergy",
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
), Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: allergiesList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
list: allergiesList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
// model.getDoctorBranch().then((value) {
// _selectedBranch = value;
// if (_referTo['id'] == 1) {
// model.getClinics(
// _selectedBranch['ID']);
// }
// });
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Select Severity",
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: TextFields(
hintText: "Remarks",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: remarkController,
validator: (value) {
if (value == null)
return TranslationBase.of(context).emptyMessage;
else
return null;
}),
),SizedBox(
height: 10,
),
AppButton(
title: "Add".toUpperCase(),
onPressed: () {
},
),
]
),
)), )),
); );
}); });
@ -113,3 +294,4 @@ class _AddAllergiesWidgetState extends State<AddAllergiesWidget> {
} }

@ -3,23 +3,40 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/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/divider_with_spaces_around.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.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:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
class AddHistoryWidget extends StatefulWidget { class AddHistoryWidget extends StatefulWidget {
@override @override
_AddHistoryWidgetState createState() => _AddHistoryWidgetState(); _AddHistoryWidgetState createState() => _AddHistoryWidgetState();
} }
class _AddHistoryWidgetState extends State<AddHistoryWidget> { class _AddHistoryWidgetState extends State<AddHistoryWidget>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 0;
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
}
@override
void initState() {
_controller = new PageController();
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(left: 10, right: 10, top: 15),
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: "Add History", hintText: "Add History",
fontSize: 13.5, fontSize: 13.5,
@ -87,6 +104,7 @@ class _AddHistoryWidgetState extends State<AddHistoryWidget> {
], ],
); );
} }
openHistoryList(BuildContext context) { openHistoryList(BuildContext context) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
@ -96,12 +114,323 @@ class _AddHistoryWidgetState extends State<AddHistoryWidget> {
return FractionallySizedBox( return FractionallySizedBox(
heightFactor: 0.7, heightFactor: 0.7,
child: Container( child: Container(
child: Center( child: FractionallySizedBox(
child: Texts("HistoryList"), widthFactor: 0.9,
)), child: Column(
children: [
SizedBox(
height: 10,
),
PriorityBar(onTap: (activePriority) {
changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.5,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
Column(
children: [
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('History',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('History',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('History',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('History',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('History',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('History',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('History',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
Row(
children: [
Checkbox(
value: true,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts('History',
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
],
),
],
),
)),
),
SizedBox(
height: 10,
),
AppButton(
title: "Add SELECTED HISTORIES".toUpperCase(),
onPressed: () {},
),
],
),
Container(
child: Center(
child: Texts("eee"),
),
),
Container(
child: Center(
child: Texts("cccc"),
),
),
],
),
),
],
),
)),
); );
}); });
} }
}
class PriorityBar extends StatefulWidget {
final Function onTap;
const PriorityBar({Key key, this.onTap}) : super(key: key);
@override
_PriorityBarState createState() => _PriorityBarState();
} }
class _PriorityBarState extends State<PriorityBar> {
int _activePriority = 0;
List<String> _priorities = [
"Family",
"Surgical/Sports",
"Medical",
];
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return Container(
height: screenSize.height * 0.070,
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () {
widget.onTap(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
}),
);
}).toList(),
),
);
}
}

@ -22,7 +22,7 @@ class SubjectivePage extends StatefulWidget {
} }
class _SubjectivePageState extends State<SubjectivePage> { class _SubjectivePageState extends State<SubjectivePage> {
bool isChiefExpand = true; bool isChiefExpand = false;
bool isHistoryExpand = false; bool isHistoryExpand = false;
bool isAllergiesExpand = false; bool isAllergiesExpand = false;
@ -30,6 +30,7 @@ class _SubjectivePageState extends State<SubjectivePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(

@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
class DividerWithSpacesAround extends StatelessWidget {
DividerWithSpacesAround({
Key key, this.height = 0,
});
final double height ;
@override
Widget build(BuildContext context) {
return Column(
children: [
SizedBox(
height: height,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: height,
),
],
);
}
}
Loading…
Cancel
Save