|
|
|
|
@ -17,6 +17,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
|
|
|
|
|
final Function addSelectedHistories;
|
|
|
|
|
final Function(EntityList) removeHistory;
|
|
|
|
|
final Function(EntityList) addHistory;
|
|
|
|
|
final Function(EntityList) addRemarks;
|
|
|
|
|
|
|
|
|
|
final bool Function(EntityList) isEntityListSelected;
|
|
|
|
|
final List<EntityList> masterList;
|
|
|
|
|
|
|
|
|
|
@ -27,7 +29,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
|
|
|
|
|
this.removeHistory,
|
|
|
|
|
this.masterList,
|
|
|
|
|
this.addHistory,
|
|
|
|
|
this.isEntityListSelected})
|
|
|
|
|
this.isEntityListSelected,
|
|
|
|
|
this.addRemarks})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -37,7 +40,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _EntityListCheckboxSearchWidgetState
|
|
|
|
|
extends State<EntityListCheckboxSearchWidget> {
|
|
|
|
|
int selectedType;
|
|
|
|
|
int selectedType = 1;
|
|
|
|
|
setSelectedType(int val) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedType = val;
|
|
|
|
|
@ -45,6 +48,8 @@ class _EntityListCheckboxSearchWidgetState
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<EntityList> items = List();
|
|
|
|
|
List<String> remarksList = List();
|
|
|
|
|
List<int> typeList = List();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
@ -52,6 +57,7 @@ class _EntityListCheckboxSearchWidgetState
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TextEditingController remarksController = TextEditingController();
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
@ -84,34 +90,87 @@ class _EntityListCheckboxSearchWidgetState
|
|
|
|
|
children: items.map((historyInfo) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
ExpansionTile(
|
|
|
|
|
title: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: widget.isEntityListSelected(
|
|
|
|
|
historyInfo),
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (widget.isEntityListSelected(
|
|
|
|
|
historyInfo)) {
|
|
|
|
|
widget.removeHistory(
|
|
|
|
|
historyInfo);
|
|
|
|
|
} else {
|
|
|
|
|
widget
|
|
|
|
|
.addHistory(historyInfo);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts(
|
|
|
|
|
historyInfo.procedureName,
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: widget.isEntityListSelected(
|
|
|
|
|
historyInfo),
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (widget.isEntityListSelected(
|
|
|
|
|
historyInfo)) {
|
|
|
|
|
widget
|
|
|
|
|
.removeHistory(historyInfo);
|
|
|
|
|
} else {
|
|
|
|
|
widget.addHistory(historyInfo);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts(
|
|
|
|
|
historyInfo.procedureName,
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(TranslationBase.of(context)
|
|
|
|
|
.orderType),
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFB9382C),
|
|
|
|
|
value: 1,
|
|
|
|
|
groupValue: selectedType,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
historyInfo.type =
|
|
|
|
|
setSelectedType(value)
|
|
|
|
|
.toString();
|
|
|
|
|
// historyInfo.type =
|
|
|
|
|
// value.toString();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Text('routine'),
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFB9382C),
|
|
|
|
|
groupValue: selectedType,
|
|
|
|
|
value: 0,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
historyInfo.type =
|
|
|
|
|
setSelectedType(value)
|
|
|
|
|
.toString();
|
|
|
|
|
// historyInfo.type =
|
|
|
|
|
// value.toString();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Text(TranslationBase.of(context)
|
|
|
|
|
.urgent),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15.0,
|
|
|
|
|
),
|
|
|
|
|
TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).remarks,
|
|
|
|
|
//controller: remarksController,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
historyInfo.remarks = value;
|
|
|
|
|
},
|
|
|
|
|
minLines: 3,
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
|