diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index d3ac0ba..4765d43 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -306,6 +306,11 @@ "requestType":"نوع الطلب", "employeeDigitalID":"هويةالموظف الرقمية", "businessCard": "بطاقة العمل", + "checkOut":"وقت الخروج", + "regular":"منتظم", + "mark" : "علامة", + "selectMethodOfAttendance":"اختر طريقة تسجيل الحضور", + "comeNearHMGWifi": "HMG wifi من فضلك اقترب من", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 838d20f..2fa6ac8 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -306,6 +306,11 @@ "wantToReject": "Are you sure want to reject?", "employeeDigitalID":"Employee Digital ID", "businessCard": "Business Card", + "checkOut":"Check Out", + "regular":"Regular", + "mark" : "Mark", + "selectMethodOfAttendance":"Select the method to mark the attendance", + "comeNearHMGWifi": "Please come near to HMG wifi", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 5b433e7..60fa6d7 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -322,6 +322,11 @@ class CodegenLoader extends AssetLoader{ "requestType": "نوع الطلب", "employeeDigitalID": "هويةالموظف الرقمية", "businessCard": "بطاقة العمل", + "checkOut": "وقت الخروج", + "regular": "منتظم", + "mark": "علامة", + "selectMethodOfAttendance": "اختر طريقة تسجيل الحضور", + "comeNearHMGWifi": "HMG wifi من فضلك اقترب من", "profile": { "reset_password": { "label": "Reset Password", @@ -661,6 +666,11 @@ static const Map en_US = { "wantToReject": "Are you sure want to reject?", "employeeDigitalID": "Employee Digital ID", "businessCard": "Business Card", + "checkOut": "Check Out", + "regular": "Regular", + "mark": "Mark", + "selectMethodOfAttendance": "Select the method to mark the attendance", + "comeNearHMGWifi": "Please come near to HMG wifi", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 6ff58d6..8eec17b 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -307,6 +307,11 @@ abstract class LocaleKeys { static const requestType = 'requestType'; static const employeeDigitalID = 'employeeDigitalID'; static const businessCard = 'businessCard'; + static const checkOut = 'checkOut'; + static const regular = 'regular'; + static const mark = 'mark'; + static const selectMethodOfAttendance = 'selectMethodOfAttendance'; + static const comeNearHMGWifi = 'comeNearHMGWifi'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; diff --git a/lib/ui/attendance/monthly_attendance.dart b/lib/ui/attendance/monthly_attendance.dart index 1206ebf..be3d24c 100644 --- a/lib/ui/attendance/monthly_attendance.dart +++ b/lib/ui/attendance/monthly_attendance.dart @@ -139,13 +139,13 @@ class _MonthlyAttendanceState extends State { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - optionUI(LocaleKeys.scheduleDays.tr(), "${getTimeCardSummaryList?.sCHEDULEDAYS}"), + optionUI(LocaleKeys.scheduleDays.tr(), "${getTimeCardSummaryList?.sCHEDULEDAYS != null ? getTimeCardSummaryList!.sCHEDULEDAYS : 0}"), 6.width, - optionUI(LocaleKeys.offDays.tr(), "${getTimeCardSummaryList?.oFFDAYS}"), + optionUI(LocaleKeys.offDays.tr(), "${getTimeCardSummaryList?.oFFDAYS != null ? getTimeCardSummaryList!.oFFDAYS : 0}"), 6.width, - optionUI(LocaleKeys.nonAnalyzed.tr(), "${getTimeCardSummaryList?.uNAUTHORIZEDLEAVE}"), + optionUI(LocaleKeys.nonAnalyzed.tr(), "${getTimeCardSummaryList?.uNAUTHORIZEDLEAVE != null ? getTimeCardSummaryList!.uNAUTHORIZEDLEAVE : 0}"), 6.width, - optionUI(LocaleKeys.shortageHour.tr(), "${getTimeCardSummaryList?.sHORTAGEHRS}"), + optionUI(LocaleKeys.shortageHour.tr(), "${getTimeCardSummaryList?.sHORTAGEHRS != null ? getTimeCardSummaryList!.sHORTAGEHRS : 0}"), ], ).paddingOnly(left: 21, right: 21), 35.height, @@ -319,81 +319,87 @@ class _MonthlyAttendanceState extends State { if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) { int val = details.date.day; //check day is off - if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList?[val - 1].dAYTYPE == 'OFF') { - return Container( - margin: const EdgeInsets.all(4), - decoration: BoxDecoration( - color: MyColors.greyACColor.withOpacity(.12), - shape: BoxShape.circle, - ), - alignment: Alignment.center, - child: Text( - "$val", - style: const TextStyle( - fontSize: 13, - fontWeight: FontWeight.w500, - color: MyColors.greyA5Color, - ), - ), - ); - } - //check day is Present - else if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y') { - return Container( - margin: const EdgeInsets.all(4), - decoration: BoxDecoration( - gradient: const LinearGradient( - transform: GradientRotation(.46), - begin: Alignment.topRight, - end: Alignment.bottomLeft, - colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], - ), - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - offset: const Offset(0, 2), - blurRadius: 26, - color: MyColors.blackColor.withOpacity(0.100), + if(getDayHoursTypeDetailsList.isNotEmpty) + + { + if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList?[val - 1].dAYTYPE == 'OFF') { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: MyColors.greyACColor.withOpacity(.12), + shape: BoxShape.circle, ), - ], - ), - alignment: Alignment.center, - child: Text( - "$val", - style: const TextStyle( - fontSize: 13, - fontWeight: FontWeight.w500, - color: MyColors.white, - ), - ), - ); - } - //check day is Absent - else if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList?[val - 1].aBSENTFLAG == 'Y') { - return Container( - margin: const EdgeInsets.all(4), - decoration: BoxDecoration( - color: MyColors.backgroundBlackColor, - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - offset: const Offset(0, 2), - blurRadius: 26, - color: MyColors.blackColor.withOpacity(0.100), + alignment: Alignment.center, + child: Text( + "$val", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.greyA5Color, + ), ), - ], - ), - alignment: Alignment.center, - child: Text( - "$val", - style: const TextStyle( - fontSize: 13, - fontWeight: FontWeight.w500, - color: MyColors.white, - ), - ), - ); - } + ); + } + //check day is Present + else if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y') { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + gradient: const LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], + ), + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "$val", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.white, + ), + ), + ); + } + //check day is Absent + else if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList?[val - 1].aBSENTFLAG == 'Y') { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: MyColors.backgroundBlackColor, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "$val", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.white, + ), + ), + ); + } + + + } return Container( margin: const EdgeInsets.all(4), decoration: BoxDecoration( diff --git a/lib/ui/landing/today_attendance_screen.dart b/lib/ui/landing/today_attendance_screen.dart index fcc4adb..04ee4b1 100644 --- a/lib/ui/landing/today_attendance_screen.dart +++ b/lib/ui/landing/today_attendance_screen.dart @@ -134,7 +134,7 @@ class _TodayAttendanceScreenState extends State { textStyle: TextStyle(color: Colors.white, fontSize: 32, letterSpacing: -1.92, fontWeight: FontWeight.bold, height: 1), ), 19.height, - "Shift Time".tr().toText12(color: MyColors.greyACColor), + LocaleKeys.shiftTime.tr().tr().toText12(color: MyColors.greyACColor), (model.attendanceTracking!.pShtName ?? "00:00:00").toString().toText22(color: Colors.white, isBold: true), ], ), @@ -162,14 +162,14 @@ class _TodayAttendanceScreenState extends State { children: [ Row( children: [ - commonStatusView("Check In", (model.attendanceTracking!.pSwipeIn) ?? "- - : - -"), + commonStatusView(LocaleKeys.checkIn.tr(), (model.attendanceTracking!.pSwipeIn) ?? "- - : - -"), commonStatusView("Check Out", (model.attendanceTracking!.pSwipeOut) ?? "- - : - -") ], ), 21.height, Row( children: [ - commonStatusView("Late In", (model.attendanceTracking!.pLateInHours) ?? "- - : - -"), + commonStatusView(LocaleKeys.lateIn.tr(), (model.attendanceTracking!.pLateInHours) ?? "- - : - -"), commonStatusView("Regular", (model.attendanceTracking!.pScheduledHours) ?? "- - : - -") ], ), @@ -185,9 +185,9 @@ class _TodayAttendanceScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - "Mark".tr().toText12(), - "Attendance".tr().toText24(), - "Select the method to mark the attendance".tr().toText12(color: Color(0xff535353)), + LocaleKeys.mark.tr().tr().toText12(), + LocaleKeys.attendance.tr().tr().toText24(), + LocaleKeys.selectMethodOfAttendance.tr().tr().toText12(color: Color(0xff535353)), 24.height, GridView( physics: const NeverScrollableScrollPhysics(), @@ -312,7 +312,7 @@ class _TodayAttendanceScreenState extends State { }); } } else { - Utils.confirmDialog(context, "Please come near to HMG wifi"); + Utils.confirmDialog(context, LocaleKeys.comeNearHMGWifi.tr()); } }