|
|
|
|
@ -85,126 +85,125 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
///TODO Elham* user view list builder
|
|
|
|
|
|
|
|
|
|
...List.generate(
|
|
|
|
|
widget.items.length,
|
|
|
|
|
(index) => Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 15.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(10.0))),
|
|
|
|
|
child: ExpansionTile(
|
|
|
|
|
initiallyExpanded: true,
|
|
|
|
|
title: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.check_box,
|
|
|
|
|
color: Color(0xffD02127),
|
|
|
|
|
size: 30.5,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 6.0,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
widget.items[index].procedureName)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
ListView.builder(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
itemCount: widget.items.length,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 15.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(10.0))),
|
|
|
|
|
child: ExpansionTile(
|
|
|
|
|
initiallyExpanded: true,
|
|
|
|
|
title: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 11),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderType,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: Color(0xff2B353E),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFD02127),
|
|
|
|
|
value: 0,
|
|
|
|
|
groupValue:
|
|
|
|
|
widget.items[index].selectedType,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
widget.items[index].selectedType =
|
|
|
|
|
0;
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.items[index].type =
|
|
|
|
|
value.toString();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
'routine',
|
|
|
|
|
color: Color(0xff575757),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFD02127),
|
|
|
|
|
groupValue:
|
|
|
|
|
widget.items[index].selectedType,
|
|
|
|
|
value: 1,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
widget.items[index].selectedType =
|
|
|
|
|
1;
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.items[index].type =
|
|
|
|
|
value.toString();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).urgent,
|
|
|
|
|
color: Color(0xff575757),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.check_box,
|
|
|
|
|
color: Color(0xffD02127),
|
|
|
|
|
size: 30.5,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 2.0,
|
|
|
|
|
width: 6.0,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 12, vertical: 15.0),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context).remarks,
|
|
|
|
|
controller: remarksController,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
widget.items[index].remarks = value;
|
|
|
|
|
},
|
|
|
|
|
minLines: 3,
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
borderWidth: 0.5,
|
|
|
|
|
borderColor: Colors.grey[500],
|
|
|
|
|
Expanded(
|
|
|
|
|
child:
|
|
|
|
|
AppText(widget.items[index].procedureName)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 11),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).orderType,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: Color(0xff2B353E),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFD02127),
|
|
|
|
|
value: 0,
|
|
|
|
|
groupValue:
|
|
|
|
|
widget.items[index].selectedType,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
widget.items[index].selectedType = 0;
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.items[index].type =
|
|
|
|
|
value.toString();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
'routine',
|
|
|
|
|
color: Color(0xff575757),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFD02127),
|
|
|
|
|
groupValue:
|
|
|
|
|
widget.items[index].selectedType,
|
|
|
|
|
value: 1,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
widget.items[index].selectedType = 1;
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.items[index].type =
|
|
|
|
|
value.toString();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).urgent,
|
|
|
|
|
color: Color(0xff575757),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 19.0,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 2.0,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 12, vertical: 15.0),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context).remarks,
|
|
|
|
|
controller: remarksController,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
widget.items[index].remarks = value;
|
|
|
|
|
},
|
|
|
|
|
minLines: 3,
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
borderWidth: 0.5,
|
|
|
|
|
borderColor: Colors.grey[500],
|
|
|
|
|
),
|
|
|
|
|
//DividerWithSpacesAround(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 19.0,
|
|
|
|
|
),
|
|
|
|
|
//DividerWithSpacesAround(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 90,
|
|
|
|
|
),
|
|
|
|
|
@ -222,31 +221,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
|
|
|
|
|
color: AppGlobal.appGreenColor,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
|
|
///TODO Elham* move it to function
|
|
|
|
|
|
|
|
|
|
List<EntityList> entityList = List();
|
|
|
|
|
widget.items.forEach((element) {
|
|
|
|
|
entityList.add(
|
|
|
|
|
EntityList(
|
|
|
|
|
procedureId: element.procedureID,
|
|
|
|
|
remarks: element.remarks,
|
|
|
|
|
categoryID: element.categoryID,
|
|
|
|
|
type: element.type,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
await locator<AnalyticsService>().logEvent(
|
|
|
|
|
eventCategory: "Procedure Checkout Screen",
|
|
|
|
|
eventAction: "Add New Procedure",
|
|
|
|
|
);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
await model.preparePostProcedure(
|
|
|
|
|
entityList: entityList,
|
|
|
|
|
patient: widget.patient,
|
|
|
|
|
remarks: remarksController.text);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
addProcedures(model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -255,4 +230,29 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future addProcedures(ProcedureViewModel model) async {
|
|
|
|
|
List<EntityList> entityList = List();
|
|
|
|
|
widget.items.forEach((element) {
|
|
|
|
|
entityList.add(
|
|
|
|
|
EntityList(
|
|
|
|
|
procedureId: element.procedureID,
|
|
|
|
|
remarks: element.remarks,
|
|
|
|
|
categoryID: element.categoryID,
|
|
|
|
|
type: element.type,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
await locator<AnalyticsService>().logEvent(
|
|
|
|
|
eventCategory: "Procedure Checkout Screen",
|
|
|
|
|
eventAction: "Add New Procedure",
|
|
|
|
|
);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
await model.preparePostProcedure(
|
|
|
|
|
entityList: entityList,
|
|
|
|
|
patient: widget.patient,
|
|
|
|
|
remarks: remarksController.text);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|