design updates

merge-requests/385/head
Sultan Khan 5 years ago
parent ee2e3fbbd6
commit 9c111b07dd

@ -803,4 +803,12 @@ const Map<String, Map<String, String>> localizedValues = {
"add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"},
"update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"},
"sick_leave": {"en": "Sick Leave", "ar": "أجازة مرضية"},
"addSickLeaveRequest": {
"en": "Add Sick Leave Request",
"ar": "إضافة طلب إجازة مرضية"
},
"extendSickLeaveRequest": {
"en": "Extend Sick Leave Request",
"ar": "تمديد طلب الإجازة المرضية"
},
};

@ -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(),
)
]))),
);
}

@ -390,7 +390,9 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
AppButton(
title: widget.isExtended == true
? TranslationBase.of(context).extend
: TranslationBase.of(context).add,
: TranslationBase.of(context)
.addSickLeaverequest,
color: Colors.green,
onPressed: () async {
if (widget.isExtended) {
await model2.extendSickLeave(

@ -523,7 +523,10 @@ class TranslationBase {
localizedValues['add-sickleave'][locale.languageCode];
String get add => localizedValues['add'][locale.languageCode];
String get addSickLeaverequest =>
localizedValues['addSickLeaveRequest'][locale.languageCode];
String get extendSickLeaverequest =>
localizedValues['extendSickLeaveRequest'][locale.languageCode];
String get approved => localizedValues['approved'][locale.languageCode];
String get extended => localizedValues['extended'][locale.languageCode];

Loading…
Cancel
Save