|
|
|
|
@ -26,7 +26,8 @@ class AddRescheduleLeavScreen extends StatelessWidget {
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
|
|
|
|
|
body: Column(children: [
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Column(children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
@ -68,180 +69,185 @@ class AddRescheduleLeavScreen extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * .65,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: model.getReschduleLeave
|
|
|
|
|
.map<Widget>((GetRescheduleLeavesResponse item) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
left: BorderSide(
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.green
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? HexColor('#CC9B14')
|
|
|
|
|
: Colors.red[800],
|
|
|
|
|
width: 5.0,
|
|
|
|
|
))),
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: Wrap(
|
|
|
|
|
Column(
|
|
|
|
|
children: model.getReschduleLeave
|
|
|
|
|
.map<Widget>((GetRescheduleLeavesResponse item) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
left: BorderSide(
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.green
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? HexColor('#CC9B14')
|
|
|
|
|
: Colors.red[800],
|
|
|
|
|
width: 5.0,
|
|
|
|
|
))),
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: Wrap(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(3),
|
|
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.status == 1
|
|
|
|
|
? TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.approved
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.pending
|
|
|
|
|
: TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.rejected,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.green
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? HexColor('#CC9B14')
|
|
|
|
|
: Colors.red[800],
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(3),
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.requisitionType == 1
|
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
|
.offTime
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.holiday +
|
|
|
|
|
' ',
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Row(children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.startDate),
|
|
|
|
|
AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.dateTimeFrom,
|
|
|
|
|
'yyyy-MM-dd HH:mm'),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// overflow:
|
|
|
|
|
// TextOverflow.ellipsis,
|
|
|
|
|
item.status == 1
|
|
|
|
|
? TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.approved
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.pending
|
|
|
|
|
: TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.rejected,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.green
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? HexColor('#CC9B14')
|
|
|
|
|
: Colors.red[800],
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.only(top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.dateTimeTo,
|
|
|
|
|
'yyyy-MM-dd HH:mm'),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
))
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.requisitionType == 1
|
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
|
.offTime
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.holiday +
|
|
|
|
|
' ',
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Row(children: [
|
|
|
|
|
AppText(TranslationBase.of(context)
|
|
|
|
|
.startDate),
|
|
|
|
|
AppText(
|
|
|
|
|
DateUtils.convertStringToDateFormat(
|
|
|
|
|
item.dateTimeFrom,
|
|
|
|
|
'yyyy-MM-dd HH:mm'),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// overflow:
|
|
|
|
|
// TextOverflow.ellipsis,
|
|
|
|
|
// overflow:
|
|
|
|
|
// TextOverflow.ellipsis,
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.endDate),
|
|
|
|
|
AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.dateTimeTo,
|
|
|
|
|
'yyyy-MM-dd HH:mm'),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// overflow:
|
|
|
|
|
// TextOverflow.ellipsis,
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
model.coveringDoctors.length > 0
|
|
|
|
|
? Row(children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.coveringDoctor,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
getDoctor(
|
|
|
|
|
model.coveringDoctors,
|
|
|
|
|
item.coveringDoctorId),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
])
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .reasons,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
bottom: 5),
|
|
|
|
|
child: AppText(getReasons(
|
|
|
|
|
model.allReasons,
|
|
|
|
|
item.reasonId))),
|
|
|
|
|
(item.status == 2)
|
|
|
|
|
? IconButton(
|
|
|
|
|
icon: Image.asset(
|
|
|
|
|
'assets/images/edit.png'),
|
|
|
|
|
// color: Colors.green, //Colors.black,
|
|
|
|
|
onPressed: () => {
|
|
|
|
|
openLeave(
|
|
|
|
|
context, true,
|
|
|
|
|
extendedData:
|
|
|
|
|
item)
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(TranslationBase.of(context)
|
|
|
|
|
.endDate),
|
|
|
|
|
AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.dateTimeTo,
|
|
|
|
|
'yyyy-MM-dd HH:mm'),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
model.coveringDoctors.length > 0
|
|
|
|
|
? Row(children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.coveringDoctor,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
getDoctor(
|
|
|
|
|
model.coveringDoctors,
|
|
|
|
|
item.coveringDoctorId),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
])
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .reasons,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
bottom: 5),
|
|
|
|
|
child: AppText(getReasons(
|
|
|
|
|
model.allReasons,
|
|
|
|
|
item.reasonId))),
|
|
|
|
|
(item.status == 2)
|
|
|
|
|
? IconButton(
|
|
|
|
|
icon: Image.asset(
|
|
|
|
|
'assets/images/edit.png'),
|
|
|
|
|
// color: Colors.green, //Colors.black,
|
|
|
|
|
onPressed: () => {
|
|
|
|
|
openLeave(context, true,
|
|
|
|
|
extendedData: item)
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)))
|
|
|
|
|
])),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
]))),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|