From 9c111b07dddd3a2c88af46756cfcc6e51b8cefa6 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 30 Mar 2021 13:08:05 +0300 Subject: [PATCH] design updates --- lib/config/localized_values.dart | 8 + .../add-rescheduleleave.dart | 332 +++++++++--------- lib/screens/sick-leave/sick_leave.dart | 4 +- lib/util/translations_delegate_base.dart | 5 +- 4 files changed, 184 insertions(+), 165 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5a66b0ae..662111d0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -803,4 +803,12 @@ const Map> 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": "تمديد طلب الإجازة المرضية" + }, }; diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index dacbba72..aaafa380 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -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((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: [ - Expanded( - flex: 4, - child: Wrap( + Column( + children: model.getReschduleLeave + .map((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: [ + Expanded( + flex: 4, + child: Wrap( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - 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(), + ) + ]))), ); } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 8188c302..12f157c2 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -390,7 +390,9 @@ class _SickLeaveScreenState extends State { 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( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 83f43cbc..da9e5f75 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -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];