|
|
|
@ -315,6 +315,26 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
|
|
|
|
bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y';
|
|
|
|
bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y';
|
|
|
|
bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y';
|
|
|
|
bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get leave type code and corresponding color
|
|
|
|
|
|
|
|
String? leaveTypeCode = getDayHoursTypeDetailsList[index].lEAVETYPECODE;
|
|
|
|
|
|
|
|
Color? leaveTypeColor;
|
|
|
|
|
|
|
|
bool useGradient = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Determine color based on leave type code
|
|
|
|
|
|
|
|
if (leaveTypeCode != null && leaveTypeCode.isNotEmpty) {
|
|
|
|
|
|
|
|
leaveTypeColor = leaveTypeColors[leaveTypeCode];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If no leave type color found, use default colors based on attendance status
|
|
|
|
|
|
|
|
if (leaveTypeColor == null) {
|
|
|
|
|
|
|
|
if (isDayIsPresent) {
|
|
|
|
|
|
|
|
leaveTypeColor = leaveTypeColors['Present'];
|
|
|
|
|
|
|
|
useGradient = true; // Use gradient for present days without leave type
|
|
|
|
|
|
|
|
} else if (isDayIsAbsent) {
|
|
|
|
|
|
|
|
leaveTypeColor = leaveTypeColors['Absent'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isDayIsOff) {
|
|
|
|
if (isDayIsOff) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
margin: const EdgeInsets.all(4),
|
|
|
|
margin: const EdgeInsets.all(4),
|
|
|
|
@ -331,12 +351,13 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
margin: const EdgeInsets.all(4),
|
|
|
|
margin: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: const LinearGradient(
|
|
|
|
gradient: useGradient && leaveTypeColor != null ? LinearGradient(
|
|
|
|
transform: GradientRotation(.46),
|
|
|
|
transform: GradientRotation(.46),
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
end: Alignment.bottomLeft,
|
|
|
|
end: Alignment.bottomLeft,
|
|
|
|
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
|
|
|
|
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
|
|
|
|
),
|
|
|
|
) : null,
|
|
|
|
|
|
|
|
color: !useGradient && leaveTypeColor != null ? leaveTypeColor : null,
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
boxShadow: [
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
BoxShadow(
|
|
|
|
@ -358,7 +379,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
margin: const EdgeInsets.all(4),
|
|
|
|
margin: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColors.backgroundBlackColor,
|
|
|
|
color: leaveTypeColor ?? MyColors.backgroundBlackColor,
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
boxShadow: [
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
BoxShadow(
|
|
|
|
@ -751,3 +772,24 @@ class Meeting {
|
|
|
|
Color background;
|
|
|
|
Color background;
|
|
|
|
bool isAllDay;
|
|
|
|
bool isAllDay;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const Map<String, Color> leaveTypeColors = {
|
|
|
|
|
|
|
|
'Present': Color(0xFF00ad62),
|
|
|
|
|
|
|
|
'Absent': Color(0xFFcb3232),
|
|
|
|
|
|
|
|
'HOLIDAY': Color(0xFFF26B0F),
|
|
|
|
|
|
|
|
'BUS_TRIP': Color(0xFF001A6E),
|
|
|
|
|
|
|
|
'WFH': Color(0xFF5DB996),
|
|
|
|
|
|
|
|
'ANNUAL': Color(0xFFf39c12),
|
|
|
|
|
|
|
|
'EMERGENCY': Color(0xFFFF2929),
|
|
|
|
|
|
|
|
'EXAM': Color(0xFFCB6040),
|
|
|
|
|
|
|
|
'HAJJ': Color(0xFF798645),
|
|
|
|
|
|
|
|
'HALF': Color(0xFFE8B86D),
|
|
|
|
|
|
|
|
'LWOP': Color(0xFFCD5C08),
|
|
|
|
|
|
|
|
'LWOP_MATUNPAID': Color(0xFFE73879),
|
|
|
|
|
|
|
|
'LWOP_UNAUUNPAID': Color(0xFFA02334),
|
|
|
|
|
|
|
|
'MATPAID': Color(0xFFE73879),
|
|
|
|
|
|
|
|
'MRGE': Color(0xFF0D7C66),
|
|
|
|
|
|
|
|
'PAT': Color(0xFFC96868),
|
|
|
|
|
|
|
|
'PROF': Color(0xFF6256CA),
|
|
|
|
|
|
|
|
'SICK': Color(0xFFA5B68D),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|