|
|
|
@ -37,9 +37,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
TextEditingController _toDateController = new TextEditingController();
|
|
|
|
TextEditingController _toDateController = new TextEditingController();
|
|
|
|
TextEditingController _toDateController2 = new TextEditingController();
|
|
|
|
TextEditingController _toDateController2 = new TextEditingController();
|
|
|
|
ProjectViewModel projectsProvider;
|
|
|
|
late ProjectViewModel projectsProvider;
|
|
|
|
SickLeaveViewModel sickLeaveViewModel;
|
|
|
|
late SickLeaveViewModel sickLeaveViewModel;
|
|
|
|
String _selectedClinic;
|
|
|
|
late String _selectedClinic;
|
|
|
|
Map profile = {};
|
|
|
|
Map profile = {};
|
|
|
|
var offTime = '1';
|
|
|
|
var offTime = '1';
|
|
|
|
var date;
|
|
|
|
var date;
|
|
|
|
@ -48,8 +48,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
dynamic fromDate;
|
|
|
|
dynamic fromDate;
|
|
|
|
dynamic toDate;
|
|
|
|
dynamic toDate;
|
|
|
|
var clinicID;
|
|
|
|
var clinicID;
|
|
|
|
String fromTime;
|
|
|
|
late String fromTime;
|
|
|
|
String toTime;
|
|
|
|
late String toTime;
|
|
|
|
TextEditingController _controller4 = new TextEditingController();
|
|
|
|
TextEditingController _controller4 = new TextEditingController();
|
|
|
|
TextEditingController _controller5 = new TextEditingController();
|
|
|
|
TextEditingController _controller5 = new TextEditingController();
|
|
|
|
void _presentDatePicker(id) {
|
|
|
|
void _presentDatePicker(id) {
|
|
|
|
@ -99,7 +99,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
projectsProvider = Provider.of(context);
|
|
|
|
projectsProvider = Provider.of(context);
|
|
|
|
offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime;
|
|
|
|
offTime = widget.updateData != null
|
|
|
|
|
|
|
|
? widget.updateData.requisitionType.toString()
|
|
|
|
|
|
|
|
: offTime;
|
|
|
|
return BaseView<PatientViewModel>(
|
|
|
|
return BaseView<PatientViewModel>(
|
|
|
|
onModelReady: (model) => model.getClinicsList(),
|
|
|
|
onModelReady: (model) => model.getClinicsList(),
|
|
|
|
builder: (_, model, w) => BaseView<SickLeaveViewModel>(
|
|
|
|
builder: (_, model, w) => BaseView<SickLeaveViewModel>(
|
|
|
|
@ -119,7 +121,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
child: AppScaffold(
|
|
|
|
child: AppScaffold(
|
|
|
|
baseViewModel: model2,
|
|
|
|
baseViewModel: model2,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
|
|
|
|
appBarTitle: TranslationBase.of(context).rescheduleLeaves!,
|
|
|
|
body: Center(
|
|
|
|
body: Center(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
|
@ -127,136 +129,25 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
widthFactor: 0.9,
|
|
|
|
widthFactor: 0.9,
|
|
|
|
child: ListView(
|
|
|
|
child: ListView(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// Container(
|
|
|
|
|
|
|
|
// margin: EdgeInsets.all(8),
|
|
|
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
|
|
|
// borderRadius: BorderRadius.all(
|
|
|
|
|
|
|
|
// Radius.circular(6.0)),
|
|
|
|
|
|
|
|
// border: Border.all(
|
|
|
|
|
|
|
|
// width: 1.0,
|
|
|
|
|
|
|
|
// color: HexColor("#CCCCCC"))),
|
|
|
|
|
|
|
|
// width: double.infinity,
|
|
|
|
|
|
|
|
// child: Padding(
|
|
|
|
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
// top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
|
|
|
// bottom:
|
|
|
|
|
|
|
|
// SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
|
|
|
// right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
|
|
|
// left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment:
|
|
|
|
|
|
|
|
// CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// mainAxisSize: MainAxisSize.max,
|
|
|
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
|
|
|
// Expanded(
|
|
|
|
|
|
|
|
// // add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
|
|
|
// child:
|
|
|
|
|
|
|
|
// DropdownButtonHideUnderline(
|
|
|
|
|
|
|
|
// child: new IgnorePointer(
|
|
|
|
|
|
|
|
// ignoring: true,
|
|
|
|
|
|
|
|
// child: DropdownButton(
|
|
|
|
|
|
|
|
// focusColor:
|
|
|
|
|
|
|
|
// Colors.grey,
|
|
|
|
|
|
|
|
// isExpanded: true,
|
|
|
|
|
|
|
|
// dropdownColor:
|
|
|
|
|
|
|
|
// Colors.grey,
|
|
|
|
|
|
|
|
// value: getClinicName(
|
|
|
|
|
|
|
|
// model) ??
|
|
|
|
|
|
|
|
// "",
|
|
|
|
|
|
|
|
// iconSize: 0,
|
|
|
|
|
|
|
|
// elevation: 16,
|
|
|
|
|
|
|
|
// selectedItemBuilder:
|
|
|
|
|
|
|
|
// (BuildContext
|
|
|
|
|
|
|
|
// context) {
|
|
|
|
|
|
|
|
// return model
|
|
|
|
|
|
|
|
// .getClinicNameList()
|
|
|
|
|
|
|
|
// .map((item) {
|
|
|
|
|
|
|
|
// return Row(
|
|
|
|
|
|
|
|
// mainAxisSize:
|
|
|
|
|
|
|
|
// MainAxisSize
|
|
|
|
|
|
|
|
// .max,
|
|
|
|
|
|
|
|
// children: <
|
|
|
|
|
|
|
|
// Widget>[
|
|
|
|
|
|
|
|
// AppText(
|
|
|
|
|
|
|
|
// item,
|
|
|
|
|
|
|
|
// fontSize:
|
|
|
|
|
|
|
|
// SizeConfig.textMultiplier *
|
|
|
|
|
|
|
|
// 2.1,
|
|
|
|
|
|
|
|
// color: Colors
|
|
|
|
|
|
|
|
// .grey[
|
|
|
|
|
|
|
|
// 500],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// }).toList();
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// onChanged:
|
|
|
|
|
|
|
|
// (newValue) =>
|
|
|
|
|
|
|
|
// {},
|
|
|
|
|
|
|
|
// items: model
|
|
|
|
|
|
|
|
// .getClinicNameList()
|
|
|
|
|
|
|
|
// .map((item) {
|
|
|
|
|
|
|
|
// return DropdownMenuItem(
|
|
|
|
|
|
|
|
// value: item
|
|
|
|
|
|
|
|
// .toString(),
|
|
|
|
|
|
|
|
// child: Text(
|
|
|
|
|
|
|
|
// item,
|
|
|
|
|
|
|
|
// textAlign:
|
|
|
|
|
|
|
|
// TextAlign
|
|
|
|
|
|
|
|
// .end,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// }).toList(),
|
|
|
|
|
|
|
|
// ))),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// )),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Container(
|
|
|
|
|
|
|
|
// margin: EdgeInsets.all(8),
|
|
|
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
|
|
|
// borderRadius:
|
|
|
|
|
|
|
|
// BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
|
|
|
// border: Border.all(
|
|
|
|
|
|
|
|
// width: 1.0,
|
|
|
|
|
|
|
|
// color: HexColor("#CCCCCC"))),
|
|
|
|
|
|
|
|
// padding: EdgeInsets.all(5),
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// new IgnorePointer(
|
|
|
|
|
|
|
|
// ignoring: true,
|
|
|
|
|
|
|
|
// child: AppTextFormField(
|
|
|
|
|
|
|
|
// readOnly: true,
|
|
|
|
|
|
|
|
// hintText: profile != null
|
|
|
|
|
|
|
|
// ? profile['DoctorName']
|
|
|
|
|
|
|
|
// : "",
|
|
|
|
|
|
|
|
// borderColor: Colors.white,
|
|
|
|
|
|
|
|
// onSaved: (value) {},
|
|
|
|
|
|
|
|
// inputFormatter: ONLY_NUMBERS))
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
bottom:
|
|
|
|
|
|
|
|
SizeConfig.widthMultiplier * 0.9,
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
@ -264,22 +155,35 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
model2.allOffTime.length > 0
|
|
|
|
model2.allOffTime.length > 0
|
|
|
|
? Expanded(
|
|
|
|
? Expanded(
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
child:
|
|
|
|
child: DropdownButton(
|
|
|
|
DropdownButtonHideUnderline(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
DropdownButton(
|
|
|
|
// focusColor: Colors.grey,
|
|
|
|
// focusColor: Colors.grey,
|
|
|
|
isExpanded: true,
|
|
|
|
isExpanded: true,
|
|
|
|
value: offTime == null ? model2.allOffTime[0]['code'] : offTime,
|
|
|
|
value: offTime == null
|
|
|
|
|
|
|
|
? model2.allOffTime[0]
|
|
|
|
|
|
|
|
['code']
|
|
|
|
|
|
|
|
: offTime,
|
|
|
|
iconSize: 40,
|
|
|
|
iconSize: 40,
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
selectedItemBuilder:
|
|
|
|
return model2.allOffTime.map((item) {
|
|
|
|
(BuildContext
|
|
|
|
|
|
|
|
context) {
|
|
|
|
|
|
|
|
return model2.allOffTime
|
|
|
|
|
|
|
|
.map((item) {
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisSize:
|
|
|
|
|
|
|
|
MainAxisSize
|
|
|
|
|
|
|
|
.max,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
item['description'],
|
|
|
|
item[
|
|
|
|
|
|
|
|
'description'],
|
|
|
|
|
|
|
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.1,
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
|
|
|
2.1,
|
|
|
|
// color:
|
|
|
|
// color:
|
|
|
|
// Colors.grey,
|
|
|
|
// Colors.grey,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -293,21 +197,29 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (offTime == '1') {
|
|
|
|
if (offTime == '1') {
|
|
|
|
model2.getReasons(18);
|
|
|
|
model2.getReasons(18);
|
|
|
|
} else if (offTime == '2') {
|
|
|
|
} else if (offTime ==
|
|
|
|
|
|
|
|
'2') {
|
|
|
|
model2.getReasons(19);
|
|
|
|
model2.getReasons(19);
|
|
|
|
} else if (offTime == '3' || offTime == '5') {
|
|
|
|
} else if (offTime ==
|
|
|
|
model2.getReasons(102);
|
|
|
|
'3' ||
|
|
|
|
|
|
|
|
offTime == '5') {
|
|
|
|
|
|
|
|
model2
|
|
|
|
|
|
|
|
.getReasons(102);
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
offTime = newValue;
|
|
|
|
offTime = newValue;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items: model2.allOffTime.map((item) {
|
|
|
|
items: model2.allOffTime
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
.map((item) {
|
|
|
|
value: item['code'].toString(),
|
|
|
|
return DropdownMenuItem<
|
|
|
|
|
|
|
|
String>(
|
|
|
|
|
|
|
|
value: item['code']
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
item['description'],
|
|
|
|
item['description'],
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
textAlign:
|
|
|
|
|
|
|
|
TextAlign.end,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
@ -325,24 +237,39 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
HexColor("#CCCCCC"))),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppTextFormField(
|
|
|
|
AppTextFormField(
|
|
|
|
hintText: TranslationBase.of(context).fromDate,
|
|
|
|
hintText: TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.fromDate,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
prefix: IconButton(icon: Icon(Icons.calendar_today)),
|
|
|
|
prefix: IconButton(
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
icon: Icon(
|
|
|
|
|
|
|
|
Icons.calendar_today),
|
|
|
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textInputType:
|
|
|
|
|
|
|
|
TextInputType.number,
|
|
|
|
controller: _toDateController,
|
|
|
|
controller: _toDateController,
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
_presentDatePicker('fromDate');
|
|
|
|
_presentDatePicker(
|
|
|
|
|
|
|
|
'fromDate');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inputFormatter: ONLY_DATE,
|
|
|
|
inputFormatter: ONLY_DATE,
|
|
|
|
onChanged: (val) => fromDate = val,
|
|
|
|
onChanged: (val) =>
|
|
|
|
onSaved: (val) => fromDate = val,
|
|
|
|
fromDate = val,
|
|
|
|
|
|
|
|
onSaved: (val) =>
|
|
|
|
|
|
|
|
fromDate = val,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
@ -352,24 +279,37 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
borderRadius:
|
|
|
|
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
BorderRadius.all(
|
|
|
|
|
|
|
|
Radius.circular(
|
|
|
|
|
|
|
|
6.0)),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color: HexColor(
|
|
|
|
|
|
|
|
"#CCCCCC"))),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
DateTimePicker(
|
|
|
|
DateTimePicker(
|
|
|
|
timeHintText: TranslationBase.of(context).fromTime,
|
|
|
|
timeHintText:
|
|
|
|
type: DateTimePickerType.time,
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.fromTime,
|
|
|
|
|
|
|
|
type: DateTimePickerType
|
|
|
|
|
|
|
|
.time,
|
|
|
|
controller: _controller4,
|
|
|
|
controller: _controller4,
|
|
|
|
onChanged: (val) => fromTime = val,
|
|
|
|
onChanged: (val) =>
|
|
|
|
|
|
|
|
fromTime = val,
|
|
|
|
validator: (val) {
|
|
|
|
validator: (val) {
|
|
|
|
print(val);
|
|
|
|
print(val);
|
|
|
|
// setState(
|
|
|
|
// setState(
|
|
|
|
// () => _valueToValidate4 = val);
|
|
|
|
// () => _valueToValidate4 = val);
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onSaved: (val) => fromTime = val,
|
|
|
|
onSaved: (val) =>
|
|
|
|
|
|
|
|
fromTime = val!,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -379,24 +319,37 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
borderRadius:
|
|
|
|
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
BorderRadius.all(
|
|
|
|
|
|
|
|
Radius.circular(
|
|
|
|
|
|
|
|
6.0)),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color: HexColor(
|
|
|
|
|
|
|
|
"#CCCCCC"))),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
DateTimePicker(
|
|
|
|
DateTimePicker(
|
|
|
|
timeHintText: TranslationBase.of(context).toTime,
|
|
|
|
timeHintText:
|
|
|
|
type: DateTimePickerType.time,
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.toTime,
|
|
|
|
|
|
|
|
type: DateTimePickerType
|
|
|
|
|
|
|
|
.time,
|
|
|
|
controller: _controller5,
|
|
|
|
controller: _controller5,
|
|
|
|
onChanged: (val) => toTime = val,
|
|
|
|
onChanged: (val) =>
|
|
|
|
|
|
|
|
toTime = val,
|
|
|
|
validator: (val) {
|
|
|
|
validator: (val) {
|
|
|
|
print(val);
|
|
|
|
print(val);
|
|
|
|
// setState(
|
|
|
|
// setState(
|
|
|
|
// () => _valueToValidate4 = val);
|
|
|
|
// () => _valueToValidate4 = val);
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onSaved: (val) => toTime = val,
|
|
|
|
onSaved: (val) =>
|
|
|
|
|
|
|
|
toTime = val!,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -411,21 +364,36 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
HexColor("#CCCCCC"))),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppTextFormField(
|
|
|
|
AppTextFormField(
|
|
|
|
hintText: TranslationBase.of(context).fromDate,
|
|
|
|
hintText:
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.fromDate,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
prefix: IconButton(icon: Icon(Icons.calendar_today)),
|
|
|
|
prefix: IconButton(
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
icon: Icon(
|
|
|
|
|
|
|
|
Icons.calendar_today),
|
|
|
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textInputType:
|
|
|
|
|
|
|
|
TextInputType.number,
|
|
|
|
readOnly: true,
|
|
|
|
readOnly: true,
|
|
|
|
controller: _toDateController,
|
|
|
|
controller:
|
|
|
|
|
|
|
|
_toDateController,
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
_presentDatePicker('fromDate');
|
|
|
|
_presentDatePicker(
|
|
|
|
|
|
|
|
'fromDate');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inputFormatter: ONLY_DATE,
|
|
|
|
inputFormatter: ONLY_DATE,
|
|
|
|
onChanged: (value) {
|
|
|
|
onChanged: (value) {
|
|
|
|
@ -438,21 +406,36 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
HexColor("#CCCCCC"))),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppTextFormField(
|
|
|
|
AppTextFormField(
|
|
|
|
hintText: TranslationBase.of(context).toDate,
|
|
|
|
hintText:
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.toDate,
|
|
|
|
readOnly: true,
|
|
|
|
readOnly: true,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
prefix: IconButton(icon: Icon(Icons.calendar_today)),
|
|
|
|
prefix: IconButton(
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
icon: Icon(
|
|
|
|
controller: _toDateController2,
|
|
|
|
Icons.calendar_today),
|
|
|
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textInputType:
|
|
|
|
|
|
|
|
TextInputType.number,
|
|
|
|
|
|
|
|
controller:
|
|
|
|
|
|
|
|
_toDateController2,
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
_presentDatePicker('toDate');
|
|
|
|
_presentDatePicker(
|
|
|
|
|
|
|
|
'toDate');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inputFormatter: ONLY_DATE,
|
|
|
|
inputFormatter: ONLY_DATE,
|
|
|
|
onChanged: (value) {
|
|
|
|
onChanged: (value) {
|
|
|
|
@ -467,17 +450,22 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
bottom:
|
|
|
|
|
|
|
|
SizeConfig.widthMultiplier * 0.9,
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
@ -485,23 +473,39 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
model2.allReasons.length > 0
|
|
|
|
model2.allReasons.length > 0
|
|
|
|
? Expanded(
|
|
|
|
? Expanded(
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
child:
|
|
|
|
child: DropdownButton(
|
|
|
|
DropdownButtonHideUnderline(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
DropdownButton(
|
|
|
|
focusColor: Colors.grey,
|
|
|
|
focusColor: Colors.grey,
|
|
|
|
isExpanded: true,
|
|
|
|
isExpanded: true,
|
|
|
|
value: model2.allReasons[0]['id'].toString() ?? "",
|
|
|
|
value: model2
|
|
|
|
|
|
|
|
.allReasons[0]
|
|
|
|
|
|
|
|
['id']
|
|
|
|
|
|
|
|
.toString() ??
|
|
|
|
|
|
|
|
"",
|
|
|
|
iconSize: 40,
|
|
|
|
iconSize: 40,
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
selectedItemBuilder:
|
|
|
|
return model2.allReasons.map((item) {
|
|
|
|
(BuildContext
|
|
|
|
|
|
|
|
context) {
|
|
|
|
|
|
|
|
return model2.allReasons
|
|
|
|
|
|
|
|
.map((item) {
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisSize:
|
|
|
|
|
|
|
|
MainAxisSize
|
|
|
|
|
|
|
|
.max,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
projectsProvider.isArabic
|
|
|
|
projectsProvider
|
|
|
|
? item['nameAr']
|
|
|
|
.isArabic
|
|
|
|
: item['nameEn'],
|
|
|
|
? item[
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.1,
|
|
|
|
'nameAr']
|
|
|
|
|
|
|
|
: item[
|
|
|
|
|
|
|
|
'nameEn'],
|
|
|
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
|
|
|
2.1,
|
|
|
|
// color:
|
|
|
|
// color:
|
|
|
|
// Colors.grey,
|
|
|
|
// Colors.grey,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -514,12 +518,20 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
reason = newValue;
|
|
|
|
reason = newValue;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items: model2.allReasons.map((item) {
|
|
|
|
items: model2.allReasons
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
.map((item) {
|
|
|
|
value: item['id'].toString(),
|
|
|
|
return DropdownMenuItem<
|
|
|
|
|
|
|
|
String>(
|
|
|
|
|
|
|
|
value: item['id']
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
projectsProvider.isArabic ? item['nameAr'] : item['nameEn'],
|
|
|
|
projectsProvider
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
.isArabic
|
|
|
|
|
|
|
|
? item['nameAr']
|
|
|
|
|
|
|
|
: item[
|
|
|
|
|
|
|
|
'nameEn'],
|
|
|
|
|
|
|
|
textAlign:
|
|
|
|
|
|
|
|
TextAlign.end,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
@ -535,56 +547,81 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
bottom:
|
|
|
|
|
|
|
|
SizeConfig.widthMultiplier * 0.9,
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
model2.coveringDoctors.length > 0
|
|
|
|
if (model2.coveringDoctors.length >
|
|
|
|
? Expanded(
|
|
|
|
0)
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
child: DropdownSearch(
|
|
|
|
child: DropdownSearch(
|
|
|
|
mode: Mode.BOTTOM_SHEET,
|
|
|
|
mode: Mode.BOTTOM_SHEET,
|
|
|
|
|
|
|
|
|
|
|
|
dropdownSearchDecoration: InputDecoration(
|
|
|
|
dropdownSearchDecoration:
|
|
|
|
contentPadding: EdgeInsets.all(0), border: InputBorder.none),
|
|
|
|
InputDecoration(
|
|
|
|
|
|
|
|
contentPadding:
|
|
|
|
|
|
|
|
EdgeInsets.all(0),
|
|
|
|
|
|
|
|
border:
|
|
|
|
|
|
|
|
InputBorder.none),
|
|
|
|
//maxHeight: 300,
|
|
|
|
//maxHeight: 300,
|
|
|
|
items: model2.coveringDoctors.map((item) {
|
|
|
|
items: model2.coveringDoctors
|
|
|
|
return projectsProvider.isArabic
|
|
|
|
.map((item) {
|
|
|
|
|
|
|
|
return projectsProvider
|
|
|
|
|
|
|
|
.isArabic
|
|
|
|
? item['doctorNameN']
|
|
|
|
? item['doctorNameN']
|
|
|
|
: item['doctorName'];
|
|
|
|
: item['doctorName'];
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
// label: "Doctor List",
|
|
|
|
// label: "Doctor List",
|
|
|
|
onChanged: (item) {
|
|
|
|
onChanged: (item) {
|
|
|
|
model2.coveringDoctors.forEach((newVal) => {
|
|
|
|
model2.coveringDoctors
|
|
|
|
if (newVal['doctorName'] == item)
|
|
|
|
.forEach((newVal) => {
|
|
|
|
doctorID = newVal['DoctorID']
|
|
|
|
if (newVal[
|
|
|
|
|
|
|
|
'doctorName'] ==
|
|
|
|
|
|
|
|
item)
|
|
|
|
|
|
|
|
doctorID = newVal[
|
|
|
|
|
|
|
|
'DoctorID']
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selectedItem: getSelectedDoctor(model2),
|
|
|
|
selectedItem:
|
|
|
|
|
|
|
|
getSelectedDoctor(model2),
|
|
|
|
showSearchBox: true,
|
|
|
|
showSearchBox: true,
|
|
|
|
searchBoxDecoration: InputDecoration(
|
|
|
|
searchBoxDecoration:
|
|
|
|
border: OutlineInputBorder(),
|
|
|
|
InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0),
|
|
|
|
border:
|
|
|
|
|
|
|
|
OutlineInputBorder(),
|
|
|
|
|
|
|
|
contentPadding:
|
|
|
|
|
|
|
|
EdgeInsets.fromLTRB(
|
|
|
|
|
|
|
|
12, 12, 8, 0),
|
|
|
|
labelText: "Search Doctor",
|
|
|
|
labelText: "Search Doctor",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
popupTitle: Container(
|
|
|
|
popupTitle: Container(
|
|
|
|
height: 50,
|
|
|
|
height: 50,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Theme.of(context).primaryColorDark,
|
|
|
|
color: Theme.of(context)
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
.primaryColorDark,
|
|
|
|
topLeft: Radius.circular(20),
|
|
|
|
borderRadius:
|
|
|
|
topRight: Radius.circular(20),
|
|
|
|
BorderRadius.only(
|
|
|
|
|
|
|
|
topLeft:
|
|
|
|
|
|
|
|
Radius.circular(20),
|
|
|
|
|
|
|
|
topRight:
|
|
|
|
|
|
|
|
Radius.circular(20),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
@ -592,82 +629,27 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 24,
|
|
|
|
fontSize: 24,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.bold,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
popupShape: RoundedRectangleBorder(
|
|
|
|
popupShape:
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
RoundedRectangleBorder(
|
|
|
|
topLeft: Radius.circular(24),
|
|
|
|
borderRadius:
|
|
|
|
topRight: Radius.circular(24),
|
|
|
|
BorderRadius.only(
|
|
|
|
|
|
|
|
topLeft:
|
|
|
|
|
|
|
|
Radius.circular(24),
|
|
|
|
|
|
|
|
topRight:
|
|
|
|
|
|
|
|
Radius.circular(24),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// DropdownButtonHideUnderline(
|
|
|
|
|
|
|
|
// child: DropdownButton(
|
|
|
|
|
|
|
|
// focusColor: Colors.grey,
|
|
|
|
|
|
|
|
// isExpanded: true,
|
|
|
|
|
|
|
|
// value: doctorID == null
|
|
|
|
|
|
|
|
// ? model2
|
|
|
|
|
|
|
|
// .coveringDoctors[0]
|
|
|
|
|
|
|
|
// ['doctorID']
|
|
|
|
|
|
|
|
// .toString()
|
|
|
|
|
|
|
|
// : doctorID,
|
|
|
|
|
|
|
|
// iconSize: 40,
|
|
|
|
|
|
|
|
// elevation: 16,
|
|
|
|
|
|
|
|
// selectedItemBuilder:
|
|
|
|
|
|
|
|
// (BuildContext context) {
|
|
|
|
|
|
|
|
// return model2
|
|
|
|
|
|
|
|
// .coveringDoctors
|
|
|
|
|
|
|
|
// .map((item) {
|
|
|
|
|
|
|
|
// return Row(
|
|
|
|
|
|
|
|
// mainAxisSize:
|
|
|
|
|
|
|
|
// MainAxisSize.max,
|
|
|
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
|
|
|
// AppText(
|
|
|
|
|
|
|
|
// projectsProvider
|
|
|
|
|
|
|
|
// .isArabic
|
|
|
|
|
|
|
|
// ? item[
|
|
|
|
|
|
|
|
// 'doctorNameN']
|
|
|
|
|
|
|
|
// : item[
|
|
|
|
|
|
|
|
// 'doctorName'],
|
|
|
|
|
|
|
|
// fontSize: SizeConfig
|
|
|
|
|
|
|
|
// .textMultiplier *
|
|
|
|
|
|
|
|
// 2.1,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// }).toList();
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// onChanged: (newValue) => {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// doctorID = newValue;
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// items: model2
|
|
|
|
|
|
|
|
// .coveringDoctors
|
|
|
|
|
|
|
|
// .map((item) {
|
|
|
|
|
|
|
|
// return DropdownMenuItem<
|
|
|
|
|
|
|
|
// String>(
|
|
|
|
|
|
|
|
// value: item['doctorID']
|
|
|
|
|
|
|
|
// .toString(),
|
|
|
|
|
|
|
|
// child: Text(
|
|
|
|
|
|
|
|
// projectsProvider
|
|
|
|
|
|
|
|
// .isArabic
|
|
|
|
|
|
|
|
// ? item[
|
|
|
|
|
|
|
|
// 'doctorNameN']
|
|
|
|
|
|
|
|
// : item[
|
|
|
|
|
|
|
|
// 'doctorName'],
|
|
|
|
|
|
|
|
// textAlign:
|
|
|
|
|
|
|
|
// TextAlign.start,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// }).toList(),
|
|
|
|
|
|
|
|
// )),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
else
|
|
|
|
|
|
|
|
SizedBox(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -675,14 +657,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
SizedBox(height: SizeConfig.screenHeight * .3),
|
|
|
|
SizedBox(height: SizeConfig.screenHeight * .3),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
|
|
|
|
SizeConfig.widthMultiplier * 5),
|
|
|
|
child: Wrap(
|
|
|
|
child: Wrap(
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppButton(
|
|
|
|
AppButton(
|
|
|
|
title: widget.isUpdate == true
|
|
|
|
title: widget.isUpdate == true
|
|
|
|
? TranslationBase.of(context).updateReschedule
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
: TranslationBase.of(context).addReschedule,
|
|
|
|
.updateReschedule
|
|
|
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
|
|
|
.addReschedule,
|
|
|
|
color: HexColor('#359846'),
|
|
|
|
color: HexColor('#359846'),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
if (offTime == '1' || offTime == '2') {
|
|
|
|
if (offTime == '1' || offTime == '2') {
|
|
|
|
@ -692,7 +677,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
addRecheduleLeave(model2);
|
|
|
|
addRecheduleLeave(model2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday);
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.onlyOfftimeHoliday);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -725,13 +712,16 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
final df = new DateFormat('HH:mm:ss');
|
|
|
|
final df = new DateFormat('HH:mm:ss');
|
|
|
|
final dateFormat = new DateFormat('yyyy-MM-dd');
|
|
|
|
final dateFormat = new DateFormat('yyyy-MM-dd');
|
|
|
|
this.offTime = widget.updateData.requisitionType.toString();
|
|
|
|
this.offTime = widget.updateData.requisitionType.toString();
|
|
|
|
_toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
|
|
|
|
_toDateController.text =
|
|
|
|
|
|
|
|
dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
|
|
|
|
//df.format(DateTime.parse(widget.updateData.dateTimeFrom));
|
|
|
|
//df.format(DateTime.parse(widget.updateData.dateTimeFrom));
|
|
|
|
this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom));
|
|
|
|
this.fromTime =
|
|
|
|
|
|
|
|
df.format(DateTime.parse(widget.updateData.dateTimeFrom));
|
|
|
|
this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3);
|
|
|
|
this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3);
|
|
|
|
this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo));
|
|
|
|
this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo));
|
|
|
|
this.toTime = this.toTime.substring(0, this.toTime.length - 3);
|
|
|
|
this.toTime = this.toTime.substring(0, this.toTime.length - 3);
|
|
|
|
_toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
|
|
|
|
_toDateController2.text =
|
|
|
|
|
|
|
|
dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
|
|
|
|
_controller5.text = toTime;
|
|
|
|
_controller5.text = toTime;
|
|
|
|
_controller4.text = fromTime;
|
|
|
|
_controller4.text = fromTime;
|
|
|
|
toDate = _toDateController2.text;
|
|
|
|
toDate = _toDateController2.text;
|
|
|
|
@ -744,7 +734,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
|
|
|
|
|
|
|
|
getClinicName(model) {
|
|
|
|
getClinicName(model) {
|
|
|
|
var clinicID = this.profile['ClinicID'] ?? 1;
|
|
|
|
var clinicID = this.profile['ClinicID'] ?? 1;
|
|
|
|
var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
|
|
|
|
var clinicInfo =
|
|
|
|
|
|
|
|
model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
|
|
|
|
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
|
|
|
|
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -754,10 +745,16 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
var fromDates = fromDate;
|
|
|
|
var fromDates = fromDate;
|
|
|
|
var toDates = toDate;
|
|
|
|
var toDates = toDate;
|
|
|
|
if (offTime == '1') {
|
|
|
|
if (offTime == '1') {
|
|
|
|
fromDate = df.format(
|
|
|
|
fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
|
|
|
|
DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString()));
|
|
|
|
'T' +
|
|
|
|
toDate = df
|
|
|
|
fromTime +
|
|
|
|
.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString()));
|
|
|
|
':' +
|
|
|
|
|
|
|
|
DateTime.now().second.toString()));
|
|
|
|
|
|
|
|
toDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
|
|
|
|
|
|
|
|
'T' +
|
|
|
|
|
|
|
|
toTime +
|
|
|
|
|
|
|
|
':' +
|
|
|
|
|
|
|
|
DateTime.now().second.toString()));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
fromDate = df.format(fromDates);
|
|
|
|
fromDate = df.format(fromDates);
|
|
|
|
toDate = df.format(toDates);
|
|
|
|
toDate = df.format(toDates);
|
|
|
|
@ -772,7 +769,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
"dateTimeTo": toDate,
|
|
|
|
"dateTimeTo": toDate,
|
|
|
|
"date": offTime == '1' ? fromDate : df.format(DateTime.now()),
|
|
|
|
"date": offTime == '1' ? fromDate : df.format(DateTime.now()),
|
|
|
|
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
|
|
|
|
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
|
|
|
|
"coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
|
|
|
|
"coveringDoctorId":
|
|
|
|
|
|
|
|
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
|
|
|
|
"status": 2,
|
|
|
|
"status": 2,
|
|
|
|
"schedule": [
|
|
|
|
"schedule": [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -795,7 +793,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
|
|
|
|
builder: (context) => AddRescheduleLeavScreen(),
|
|
|
|
|
|
|
|
settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
|
|
|
|
// MyReferredPatient(),
|
|
|
|
// MyReferredPatient(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -810,13 +809,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
dynamic fromDates = fromDate;
|
|
|
|
dynamic fromDates = fromDate;
|
|
|
|
dynamic toDates = toDate;
|
|
|
|
dynamic toDates = toDate;
|
|
|
|
if (offTime == '1') {
|
|
|
|
if (offTime == '1') {
|
|
|
|
fromDate =
|
|
|
|
fromDate = df.format(DateTime.parse(_toDateController.text)) +
|
|
|
|
df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString();
|
|
|
|
'T' +
|
|
|
|
toDate =
|
|
|
|
fromTime +
|
|
|
|
df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString();
|
|
|
|
':' +
|
|
|
|
|
|
|
|
DateTime.now().second.toString();
|
|
|
|
|
|
|
|
toDate = df.format(DateTime.parse(_toDateController2.text)) +
|
|
|
|
|
|
|
|
'T' +
|
|
|
|
|
|
|
|
toTime +
|
|
|
|
|
|
|
|
':' +
|
|
|
|
|
|
|
|
DateTime.now().second.toString();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates));
|
|
|
|
fromDate = df.format(
|
|
|
|
toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates));
|
|
|
|
fromDates is DateTime ? fromDates : DateTime.parse(fromDates));
|
|
|
|
|
|
|
|
toDate =
|
|
|
|
|
|
|
|
df.format(toDates is DateTime ? toDates : DateTime.parse(toDates));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
@ -829,7 +836,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
"dateTimeTo": toDate,
|
|
|
|
"dateTimeTo": toDate,
|
|
|
|
"date": offTime == '1' ? fromDate : df.format(DateTime.now()),
|
|
|
|
"date": offTime == '1' ? fromDate : df.format(DateTime.now()),
|
|
|
|
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
|
|
|
|
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
|
|
|
|
"coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
|
|
|
|
"coveringDoctorId":
|
|
|
|
|
|
|
|
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
|
|
|
|
"status": 2,
|
|
|
|
"status": 2,
|
|
|
|
"schedule": [
|
|
|
|
"schedule": [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -867,7 +875,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
|
|
|
: model2.coveringDoctors[0]['doctorName'];
|
|
|
|
: model2.coveringDoctors[0]['doctorName'];
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
model2.coveringDoctors.forEach((newVal) => {
|
|
|
|
model2.coveringDoctors.forEach((newVal) => {
|
|
|
|
if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']}
|
|
|
|
if (newVal['doctorID'].toString() == doctorID)
|
|
|
|
|
|
|
|
{doctorName = newVal['doctorName']}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return doctorName;
|
|
|
|
return doctorName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|