|
|
|
|
@ -84,10 +84,10 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
onModelReady: (model2) => model2.preSickLeaveStatistics(
|
|
|
|
|
widget.appointmentNo, widget.patientMRN),
|
|
|
|
|
builder: (_, model2, w) => GestureDetector(
|
|
|
|
|
onTap: (){
|
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
|
},
|
|
|
|
|
child: AppScaffold(
|
|
|
|
|
onTap: () {
|
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
|
},
|
|
|
|
|
child: AppScaffold(
|
|
|
|
|
baseViewModel: model2,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: Center(
|
|
|
|
|
@ -113,10 +113,12 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
@ -144,14 +146,15 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
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,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context).sickLeaveDate,
|
|
|
|
|
@ -168,7 +171,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
controller: _toDateController,
|
|
|
|
|
onTap: () {
|
|
|
|
|
_presentDatePicker('_selectedToDate');
|
|
|
|
|
_presentDatePicker(
|
|
|
|
|
'_selectedToDate');
|
|
|
|
|
},
|
|
|
|
|
inputFormatter: ONLY_DATE,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
@ -184,8 +188,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 10, left: 10, right: 10),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
@ -193,7 +197,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom:
|
|
|
|
|
SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -209,55 +214,59 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: new IgnorePointer(
|
|
|
|
|
ignoring: true,
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: getClinicName(
|
|
|
|
|
model) ??
|
|
|
|
|
"",
|
|
|
|
|
iconSize: 0,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext
|
|
|
|
|
context) {
|
|
|
|
|
return model
|
|
|
|
|
.getClinicNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize:
|
|
|
|
|
MainAxisSize
|
|
|
|
|
.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
child:
|
|
|
|
|
DropdownButtonHideUnderline(
|
|
|
|
|
child: new IgnorePointer(
|
|
|
|
|
ignoring: true,
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged:
|
|
|
|
|
(newValue) =>
|
|
|
|
|
{},
|
|
|
|
|
items: model
|
|
|
|
|
.getClinicNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
value: item
|
|
|
|
|
.toString(),
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
color:
|
|
|
|
|
Colors.grey,
|
|
|
|
|
textAlign:
|
|
|
|
|
TextAlign
|
|
|
|
|
.end,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) =>
|
|
|
|
|
{},
|
|
|
|
|
items: model
|
|
|
|
|
.getClinicNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
value:
|
|
|
|
|
item.toString(),
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
textAlign:
|
|
|
|
|
TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
))),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
))),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
@ -285,7 +294,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
@ -317,7 +327,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
@ -364,7 +375,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
model2.sickleaveResponse[
|
|
|
|
|
'ListSickLeavesToExtent']
|
|
|
|
|
['success']);
|
|
|
|
|
Navigator.of(context).popUntil((route) {
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.popUntil((route) {
|
|
|
|
|
return route.settings.name ==
|
|
|
|
|
PATIENTS_PROFILE;
|
|
|
|
|
});
|
|
|
|
|
@ -396,7 +408,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)));
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _validateInputs(model2) async {
|
|
|
|
|
@ -413,7 +425,15 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
} else {
|
|
|
|
|
addSickLeave.patientMRN = widget.patient.patientMRN.toString();
|
|
|
|
|
addSickLeave.appointmentNo = widget.patient.appointmentNo.toString();
|
|
|
|
|
model2.addSickLeave(addSickLeave).then((value) => print(value));
|
|
|
|
|
await model2.addSickLeave(addSickLeave).then((value) => print(value));
|
|
|
|
|
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
model2.sickleaveResponse['ListSickLeavesToExtent']['success']);
|
|
|
|
|
Navigator.of(context).popUntil((route) {
|
|
|
|
|
return route.settings.name == PATIENTS_PROFILE;
|
|
|
|
|
});
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
print(err);
|
|
|
|
|
|