|
|
|
|
@ -114,131 +114,140 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
children: model.getAllSIckLeave
|
|
|
|
|
.map<Widget>((GetAllSickLeaveResponse item) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
left: BorderSide(
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.yellow[800]
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.black,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: Wrap(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
left: BorderSide(
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.yellow[800]
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.black,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: Wrap(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(3),
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.status == 1
|
|
|
|
|
? TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.hold
|
|
|
|
|
: item.status == 2
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(3),
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.status == 1
|
|
|
|
|
? TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.active
|
|
|
|
|
: TranslationBase.of(
|
|
|
|
|
.hold
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? TranslationBase
|
|
|
|
|
.of(
|
|
|
|
|
context)
|
|
|
|
|
.active
|
|
|
|
|
: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.all,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.yellow[800]
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.all,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.yellow[800]
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.daysSickleave),
|
|
|
|
|
AppText(
|
|
|
|
|
item.noOfDays.toString(),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
.daysSickleave),
|
|
|
|
|
AppText(
|
|
|
|
|
item.noOfDays
|
|
|
|
|
.toString(),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.startDate +
|
|
|
|
|
' ',
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.startDate +
|
|
|
|
|
' ',
|
|
|
|
|
),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.startDate,
|
|
|
|
|
'dd-MMM-yyyy'),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.startDate,
|
|
|
|
|
'dd-MMM-yyyy'),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
))
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
item.remarks ?? "",
|
|
|
|
|
),
|
|
|
|
|
// (item.status == 1 ||
|
|
|
|
|
// item.status == 2)
|
|
|
|
|
// ? IconButton(
|
|
|
|
|
// icon: Image.asset(
|
|
|
|
|
// 'assets/images/edit.png'),
|
|
|
|
|
//
|
|
|
|
|
// // color: Colors.green, //Colors.black,
|
|
|
|
|
// onPressed: () => {
|
|
|
|
|
// if (item.status ==
|
|
|
|
|
// 1)
|
|
|
|
|
// {
|
|
|
|
|
// DrAppToastMsg.showErrorToast(
|
|
|
|
|
// TranslationBase.of(
|
|
|
|
|
// context)
|
|
|
|
|
// .sickleaveonhold)
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// openSickLeave(
|
|
|
|
|
// context,
|
|
|
|
|
// true,
|
|
|
|
|
// extendedData:
|
|
|
|
|
// item)
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// )
|
|
|
|
|
// : SizedBox()
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
item.remarks ?? "",
|
|
|
|
|
),
|
|
|
|
|
// (item.status == 1 ||
|
|
|
|
|
// item.status == 2)
|
|
|
|
|
// ? IconButton(
|
|
|
|
|
// icon: Image.asset(
|
|
|
|
|
// 'assets/images/edit.png'),
|
|
|
|
|
//
|
|
|
|
|
// // color: Colors.green, //Colors.black,
|
|
|
|
|
// onPressed: () => {
|
|
|
|
|
// if (item.status ==
|
|
|
|
|
// 1)
|
|
|
|
|
// {
|
|
|
|
|
// DrAppToastMsg.showErrorToast(
|
|
|
|
|
// TranslationBase.of(
|
|
|
|
|
// context)
|
|
|
|
|
// .sickleaveonhold)
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// openSickLeave(
|
|
|
|
|
// context,
|
|
|
|
|
// true,
|
|
|
|
|
// extendedData:
|
|
|
|
|
// item)
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// )
|
|
|
|
|
// : SizedBox()
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
: patient.patientStatusType != 43
|
|
|
|
|
|