Home
Dashboard
The home screen shows:
- Teacher Profile Card — name, designation, assigned classes
- Today's Timetable — periods for today
- Attendance Summary — today's attendance status (if class is assigned)
- Pending Actions — leave approvals count, unread messages
- Quick Stats — total students, upcoming exams
Assigned Classes
// GET /teacher/classes/get-teacher-classes
{
"data": {
"classes": [
{ "classId": "uuid", "className": "Class 5", "division": "A", "subject": "Mathematics" },
{ "classId": "uuid", "className": "Class 6", "division": "B", "subject": "Science" }
]
}
}
Today's Schedule
// GET /teacher/teachers/get-time-table-teacher
{
"data": {
"weekdays": {
"MONDAY": [
{ "period": 1, "className": "Class 5-A", "subject": "Mathematics", "startTime": "08:00", "endTime": "08:45" },
{ "period": 2, "className": "Class 6-B", "subject": "Science", "startTime": "08:45", "endTime": "09:30" }
]
}
}
}
UI — Dashboard Card
class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final homeVM = context.watch<HomeViewModel>();
return SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TeacherProfileCard(profile: homeVM.profile),
const SizedBox(height: 16),
const Text('Today\'s Schedule', style: TextStyle(fontWeight: FontWeight.bold)),
TodayTimetableCard(periods: homeVM.todayPeriods),
const SizedBox(height: 16),
const Text('Pending Actions', style: TextStyle(fontWeight: FontWeight.bold)),
PendingActionsCard(
leaveCount: homeVM.pendingLeaveCount,
unreadMessages: homeVM.unreadMessages,
),
],
),
);
}
}