calendar issue fixed and courses enabled.

master
Sultan khan 9 hours 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/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/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/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
];

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

Loading…
Cancel
Save