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": "أضف إعادة الجدولة"}, "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"},
"update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"},
"sick_leave": {"en": "Sick Leave", "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, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves, appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: Column(children: [ body: SingleChildScrollView(
child: Column(children: [
Container( Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
@ -68,180 +69,185 @@ class AddRescheduleLeavScreen extends StatelessWidget {
], ],
), ),
), ),
Container( Column(
height: MediaQuery.of(context).size.height * .65, children: model.getReschduleLeave
child: SingleChildScrollView( .map<Widget>((GetRescheduleLeavesResponse item) {
child: Column( return RoundedContainer(
children: model.getReschduleLeave child: Column(
.map<Widget>((GetRescheduleLeavesResponse item) { children: [
return RoundedContainer( Container(
child: Column( decoration: BoxDecoration(
children: [ border: Border(
Container( left: BorderSide(
decoration: BoxDecoration( color: item.status == 1
border: Border( ? Colors.green
left: BorderSide( : item.status == 2
color: item.status == 1 ? HexColor('#CC9B14')
? Colors.green : Colors.red[800],
: item.status == 2 width: 5.0,
? HexColor('#CC9B14') ))),
: Colors.red[800], padding: EdgeInsets.only(left: 10, right: 10),
width: 5.0, child: Row(
))), mainAxisAlignment: MainAxisAlignment.start,
padding: EdgeInsets.only(left: 10, right: 10), children: <Widget>[
child: Row( Expanded(
mainAxisAlignment: MainAxisAlignment.start, flex: 4,
children: <Widget>[ child: Wrap(
Expanded( children: <Widget>[
flex: 4, Column(
child: Wrap( crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Row(
crossAxisAlignment: mainAxisAlignment:
CrossAxisAlignment.start, MainAxisAlignment.spaceBetween,
children: <Widget>[ children: [
Container( Container(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
margin: EdgeInsets.only(top: 10), margin:
child: AppText( EdgeInsets.only(top: 10),
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(
child: AppText( child: AppText(
item.requisitionType == 1 item.status == 1
? TranslationBase.of(context) ? TranslationBase.of(
.offTime context)
: TranslationBase.of(context) .approved
.holiday + : item.status == 2
' ', ? TranslationBase.of(
fontWeight: FontWeight.bold, context)
)), .pending
SizedBox( : TranslationBase.of(
height: 5, context)
), .rejected,
Row(children: [ fontWeight: FontWeight.bold,
AppText( color: item.status == 1
TranslationBase.of(context) ? Colors.green
.startDate), : item.status == 2
AppText( ? HexColor('#CC9B14')
DateUtils : Colors.red[800],
.convertStringToDateFormat( fontSize: 14,
item.dateTimeFrom, ),
'yyyy-MM-dd HH:mm'), ),
fontWeight: FontWeight.bold, Padding(
) padding:
EdgeInsets.only(top: 10),
// overflow: child: AppText(
// TextOverflow.ellipsis, 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: // overflow:
// TextOverflow.ellipsis, // TextOverflow.ellipsis,
]),
SizedBox( // overflow:
height: 5, // TextOverflow.ellipsis,
),
Row(
children: [
AppText(
TranslationBase.of(context)
.endDate),
AppText(
DateUtils
.convertStringToDateFormat(
item.dateTimeTo,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
)
],
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
model.coveringDoctors.length > 0 Row(
? Row(children: [ children: [
AppText( AppText(TranslationBase.of(context)
TranslationBase.of( .endDate),
context) AppText(
.coveringDoctor, DateUtils
), .convertStringToDateFormat(
AppText( item.dateTimeTo,
getDoctor( 'yyyy-MM-dd HH:mm'),
model.coveringDoctors, fontWeight: FontWeight.bold,
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( 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(),
]),
], ],
), ),
), SizedBox(
], width: 10,
)), ),
], ],
), ),
); ),
}).toList(), ],
))) )),
])), ],
),
);
}).toList(),
)
]))),
); );
} }

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

@ -523,7 +523,10 @@ class TranslationBase {
localizedValues['add-sickleave'][locale.languageCode]; localizedValues['add-sickleave'][locale.languageCode];
String get add => localizedValues['add'][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 approved => localizedValues['approved'][locale.languageCode];
String get extended => localizedValues['extended'][locale.languageCode]; String get extended => localizedValues['extended'][locale.languageCode];

Loading…
Cancel
Save