Skip to main content

Attendance

View

Parents can view their child's daily attendance for the current month and previous months (up to 3 months back).

GET /parent/attendance/get-student-attendance?studentId={id}&month=2024-04
{
"data": {
"month": "2024-04",
"totalDays": 22,
"present": 18,
"absent": 2,
"late": 1,
"leave": 1,
"records": [
{ "date": "2024-04-01", "status": "PRESENT" },
{ "date": "2024-04-02", "status": "ABSENT" },
{ "date": "2024-04-03", "status": "PRESENT" }
]
}
}

Calendar View

Each day in the month is color-coded:

StatusColor
PRESENTGreen
ABSENTRed
LATEYellow/Orange
LEAVEBlue
HOLIDAYGrey
// AttendanceCalendar widget
GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 7,
childAspectRatio: 1,
),
itemCount: daysInMonth,
itemBuilder: (context, index) {
final record = records[index];
return Container(
decoration: BoxDecoration(
color: _statusColor(record.status),
borderRadius: BorderRadius.circular(8),
),
child: Center(child: Text('${index + 1}')),
);
},
)

Attendance Summary Card

Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_SummaryChip(label: 'Present', count: 18, color: Colors.green),
_SummaryChip(label: 'Absent', count: 2, color: Colors.red),
_SummaryChip(label: 'Late', count: 1, color: Colors.orange),
_SummaryChip(label: 'Leave', count: 1, color: Colors.blue),
],
)