|
|
|
@ -32,89 +32,108 @@ class _SelectTransportationMethodState
|
|
|
|
|
Direction _direction = Direction.FromHospital;
|
|
|
|
|
Way _way = Way.OneWay;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
if (widget.patientER.direction != null) {
|
|
|
|
|
_direction = widget.patientER.direction == 1
|
|
|
|
|
? Direction.ToHospital
|
|
|
|
|
: Direction.FromHospital;
|
|
|
|
|
_way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays;
|
|
|
|
|
_erTransportationMethod = widget.amRequestViewModel
|
|
|
|
|
.amRequestModeList[(widget.patientER.selectedAmbulate - 1)];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 12, right: 12),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
Texts('Select Transportation Method'),
|
|
|
|
|
...List.generate(
|
|
|
|
|
widget.amRequestViewModel.amRequestModeList.length,
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_erTransportationMethod =
|
|
|
|
|
widget.amRequestViewModel.amRequestModeList[index];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text(widget
|
|
|
|
|
.amRequestViewModel.amRequestModeList[index].title),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: widget
|
|
|
|
|
.amRequestViewModel.amRequestModeList[index],
|
|
|
|
|
groupValue: _erTransportationMethod,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_erTransportationMethod = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 12, right: 12),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
Texts('Select Transportation Method'),
|
|
|
|
|
...List.generate(
|
|
|
|
|
widget.amRequestViewModel.amRequestModeList.length,
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_erTransportationMethod =
|
|
|
|
|
widget.amRequestViewModel.amRequestModeList[index];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text(widget.amRequestViewModel
|
|
|
|
|
.amRequestModeList[index].title),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: widget
|
|
|
|
|
.amRequestViewModel.amRequestModeList[index],
|
|
|
|
|
groupValue: _erTransportationMethod,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_erTransportationMethod = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Texts(
|
|
|
|
|
'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Texts(
|
|
|
|
|
'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
Texts('Select Direction'),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_direction = Direction.ToHospital;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
ListTile(
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
Texts('Select Direction'),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_direction = Direction.ToHospital;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text('To Hospital'),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: Direction.ToHospital,
|
|
|
|
@ -127,29 +146,26 @@ class _SelectTransportationMethodState
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_direction = Direction.FromHospital;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text('To Hospital'),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_direction = Direction.FromHospital;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text('Form Hospital'),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: Direction.FromHospital,
|
|
|
|
|
groupValue: _direction,
|
|
|
|
@ -161,116 +177,118 @@ class _SelectTransportationMethodState
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (_direction == Direction.ToHospital)
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Texts('Select Direction'),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_way = Way.OneWay;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text('One Way'),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: Way.OneWay,
|
|
|
|
|
groupValue: _way,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_way = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (_direction == Direction.ToHospital)
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
Texts('Select Direction'),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_way = Way.OneWay;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border:
|
|
|
|
|
Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text('One Way'),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: Way.OneWay,
|
|
|
|
|
groupValue: _way,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_way = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_way = Way.TwoWays;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text('Two Ways'),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: Way.TwoWays,
|
|
|
|
|
groupValue: _way,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_way = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_way = Way.TwoWays;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
border:
|
|
|
|
|
Border.all(color: Colors.grey, width: 0.5),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text('Two Ways'),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: Way.TwoWays,
|
|
|
|
|
groupValue: _way,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_way = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
height: 76,
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
color: Colors.grey[800],
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 2;
|
|
|
|
|
widget.patientER.tripType = _way == Way.TwoWays ? 1 : 2;
|
|
|
|
|
widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod)+1);
|
|
|
|
|
widget.changeCurrentTab(1);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
label: 'Next',
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
height: 76,
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
color: Colors.grey[800],
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.patientER.direction =
|
|
|
|
|
_direction == Direction.ToHospital ? 1 : 2;
|
|
|
|
|
widget.patientER.tripType = _way == Way.TwoWays ? 2 : 1;
|
|
|
|
|
widget.patientER.selectedAmbulate = (widget
|
|
|
|
|
.amRequestViewModel.amRequestModeList
|
|
|
|
|
.indexOf(_erTransportationMethod) +
|
|
|
|
|
1);
|
|
|
|
|
widget.changeCurrentTab(1);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
label: 'Next',
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|