calendar issue fixed and courses enabled.

master^2^2
Sultan khan 1 day ago
parent 33829a2ab3
commit 2c2d16674e

@ -138,7 +138,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.keen.tr(), AppRoutes.etqanOvr), DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.keen.tr(), AppRoutes.etqanOvr),
// DrawerMenuItem("assets/images/drawer/car_parking_icon.svg", LocaleKeys.parkingQr.tr(), AppRoutes.parkingQr), // DrawerMenuItem("assets/images/drawer/car_parking_icon.svg", LocaleKeys.parkingQr.tr(), AppRoutes.parkingQr),
DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions), DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
// DrawerMenuItem("assets/images/drawer/courses.svg", "courses".tr(), AppRoutes.courses), DrawerMenuItem("assets/images/drawer/courses.svg", "courses".tr(), AppRoutes.courses),
// DrawerMenuItem("assets/images/drawer/drawer_marathon.svg", LocaleKeys.brainMarathon.tr(), AppRoutes.marathonIntroScreen), // DrawerMenuItem("assets/images/drawer/drawer_marathon.svg", LocaleKeys.brainMarathon.tr(), AppRoutes.marathonIntroScreen),
DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword), DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
]; ];

@ -301,7 +301,6 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
monthCellBuilder: (build, details) { monthCellBuilder: (build, details) {
if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) { if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) {
int val = details.date.day; int val = details.date.day;
int index = val-1;
//check day is off //check day is off
// if (getDayHoursTypeDetailsList.isNotEmpty) { // if (getDayHoursTypeDetailsList.isNotEmpty) {
// bool isDayIsOff = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].dAYTYPE == 'OFF'; // bool isDayIsOff = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].dAYTYPE == 'OFF';
@ -311,12 +310,13 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) => DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date.day).toList(); getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) => DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date.day).toList();
if (getDayHours.isNotEmpty) { if (getDayHours.isNotEmpty) {
bool isDayIsOff = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].dAYTYPE == 'OFF'; GetDayHoursTypeDetailsList dayData = getDayHours.first;
bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y'; bool isDayIsOff = dayData.aTTENDEDFLAG == 'N' && dayData.dAYTYPE == 'OFF';
bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y'; bool isDayIsPresent = dayData.aTTENDEDFLAG == 'Y';
bool isDayIsAbsent = dayData.aTTENDEDFLAG == 'N' && dayData.aBSENTFLAG == 'Y';
// Get leave type code and corresponding color // Get leave type code and corresponding color
String? leaveTypeCode = getDayHoursTypeDetailsList[index].lEAVETYPECODE; String? leaveTypeCode = dayData.lEAVETYPECODE;
Color? leaveTypeColor; Color? leaveTypeColor;
bool useGradient = false; bool useGradient = false;
@ -428,12 +428,18 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
} }
void calendarTapped(CalendarTapDetails details) async { void calendarTapped(CalendarTapDetails details) async {
dynamic index = details.date?.day; if (details.date == null) return;
if (index != null) {
index = index - 1; // Filter to find the matching day data
} List<GetDayHoursTypeDetailsList> getDayHours =
pRTPID = getDayHoursTypeDetailsList[index].rTPID; getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) =>
await getScheduleShiftsDetails(index, pRTPID); DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date!.day).toList();
if (getDayHours.isEmpty) return;
GetDayHoursTypeDetailsList dayData = getDayHours.first;
pRTPID = dayData.rTPID;
await getScheduleShiftsDetails(details.date!.day, pRTPID);
dynamic value = getScheduleShiftsDetailsList!.pERCENTAGE; dynamic value = getScheduleShiftsDetailsList!.pERCENTAGE;
dynamic percentage; dynamic percentage;
if (value!.indexOf('%') == 3) { if (value!.indexOf('%') == 3) {
@ -446,8 +452,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
percentage = 0; percentage = 0;
} }
if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) { if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) {
int val = details.date!.day; dayData.aTTENDEDFLAG == 'Y'
getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y'
? showModalBottomSheet( ? showModalBottomSheet(
context: context, context: context,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
@ -592,7 +597,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
LocaleKeys.lateIn.tr().toText11( LocaleKeys.lateIn.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
"${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), "${dayData.lATEINHRS}".toText22(color: MyColors.redColor, isBold: true),
], ],
).expanded, ).expanded,
Column( Column(
@ -601,7 +606,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
LocaleKeys.excess.tr().toText11( LocaleKeys.excess.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
"${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), "${dayData.eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
], ],
).expanded, ).expanded,
], ],
@ -621,7 +626,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
LocaleKeys.shortage.tr().toText11( LocaleKeys.shortage.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
"${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), "${dayData.sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
], ],
).expanded, ).expanded,
Column( Column(
@ -630,7 +635,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
LocaleKeys.earlyOut.tr().toText11( LocaleKeys.earlyOut.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), "${dayData.eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
], ],
).expanded, ).expanded,
], ],

Loading…
Cancel
Save