sick leave

merge-requests/564/head
Sultan Khan 5 years ago
parent 9e87c63d22
commit 3e9c93e0cd

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

@ -43,130 +43,139 @@ class ShowSickLeaveScreen extends StatelessWidget {
children: model.getAllSIckLeave children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) { .map<Widget>((GetAllSickLeaveResponse item) {
return RoundedContainer( return RoundedContainer(
margin: EdgeInsets.all(10),
child: Column( child: Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
left: BorderSide( left: BorderSide(
color: item.status == 1 color: item.status == 1
? Colors.yellow[800] ? Colors.yellow[800]
: item.status == 2 : item.status == 2
? Colors.green ? Colors.green
: Colors.black, : Colors.black,
width: 5.0, width: 5.0,
))), ))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
children: <Widget>[ MainAxisAlignment.start,
Expanded( children: <Widget>[
flex: 4, Expanded(
child: Wrap( flex: 4,
// mainAxisAlignment: child: Wrap(
// MainAxisAlignment.start, // mainAxisAlignment:
children: <Widget>[ // MainAxisAlignment.start,
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Column(
padding: EdgeInsets.all(3), crossAxisAlignment:
child: AppText( CrossAxisAlignment.start,
item.status == 1 children: <Widget>[
? TranslationBase.of( Container(
context) padding: EdgeInsets.all(3),
.hold child: AppText(
: item.status == 2 item.status == 1
? TranslationBase.of( ? TranslationBase.of(
context) context)
.active .hold
: TranslationBase.of( : 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) context)
.all, .daysSickleave),
fontWeight: FontWeight.bold, AppText(
color: item.status == 1 item.noOfDays
? Colors.yellow[800] .toString(),
: item.status == 2 fontWeight:
? Colors.green FontWeight.bold,
: Colors.black, ),
), ],
),
Row(
children: [
AppText(TranslationBase.of(
context)
.daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
), ),
], Row(
), children: [
Row( AppText(
children: [ TranslationBase.of(
AppText( context)
TranslationBase.of(context) .startDate +
.startDate + ' ',
' ', ),
Flexible(
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight:
FontWeight.bold,
))
],
), ),
Flexible( Row(
child: AppText( mainAxisAlignment:
DateUtils MainAxisAlignment
.convertStringToDateFormat( .spaceBetween,
item.startDate, children: [
'dd-MMM-yyyy'), AppText(
fontWeight: FontWeight.bold, item.remarks ?? "",
)) ),
(item.status == 1)
? 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( SizedBox(
mainAxisAlignment: width: 20,
MainAxisAlignment ),
.spaceBetween,
children: [
AppText(
item.remarks ?? "",
),
(item.status == 1)
? 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, ],
), )),
], ],
), ));
),
],
)),
],
));
}).toList(), }).toList(),
) )
: Center( : Center(

Loading…
Cancel
Save