Skip to main content

Home Dashboard

Student Switcher

The home screen's top section shows the currently selected student. If a parent has multiple children linked, a dropdown or horizontal list allows switching between students. The entire dashboard refreshes to show data for the selected student.

// lib/modules/home/view/home_screen.dart
class HomeScreen extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final selectedStudent = ref.watch(selectedStudentProvider);
final studentList = ref.watch(studentListProvider);

return Column(
children: [
// Student switcher strip
StudentSwitcher(
students: studentList,
selected: selectedStudent,
onChanged: (student) {
ref.read(selectedStudentProvider.notifier).state = student;
// Refetch all data for new student
ref.invalidate(attendanceProvider);
ref.invalidate(examResultsProvider);
ref.invalidate(feeBalanceProvider);
},
),
// Dashboard content
Expanded(child: DashboardContent(student: selectedStudent)),
],
);
}
}

Quick Tiles

Below the student switcher is a grid of quick-access tiles, each navigating to a feature module:

TileIconNavigates To
AttendanceIcons.calendar_todayAttendance
ResultsIcons.assessmentExams
FeesIcons.account_balance_walletFees
AnnouncementsIcons_campaignAnnouncements
TimetableIcons.scheduleTimetable
LeaveIcons.event_busyLeaves
MessagesIcons.messageMessages
TeachersIcons.schoolTeachers

Dashboard Content

The main body shows:

  • Latest Attendance — today's attendance status or most recent day's status
  • Upcoming Exams — next exam date + subject (if any)
  • Fee Balance — outstanding amount with a "Pay Now" CTA if > 0
  • Recent Announcement — most recent announcement title + time
  • Upcoming Events — next 2-3 events from the calendar

Each section has a "View All" link that navigates to the respective module.

Loading & Error States

// All providers follow this pattern
final attendanceProvider = FutureProvider.autoDispose<AttendanceRecord>((ref) async {
final student = ref.watch(selectedStudentProvider);
return ref.read(attendanceRepositoryProvider).getAttendance(student.id);
});

// In the UI
attendance.when(
data: (record) => AttendanceCard(record: record),
loading: () => const ShimmerCard(),
error: (e, _) => ErrorCard(message: e.toString(), onRetry: () => ref.invalidate(attendanceProvider)),
);