Skip to main content

Navigation

Screen Flow

                    ┌──────────────────┐
│ Splash │
│ (auth check) │
└────────┬─────────┘

┌──────────────┴──────────────┐
│ │
┌──────▼──────┐ ┌────────▼────────┐
│ Login │ │ Home │
│ (OTP/PIN) │ │ (Dashboard) │
└──────┬──────┘ └────────┬────────┘
│ │
│ ┌─────────┴─────────┐
│ ┌────────▼────────┐ │
│ │ Bottom Nav │ │
│ │ Home │ Messages │ Modules │ Settings │
│ └────────────────────────────┘
│ │
│ Modules (Grid) ──► Feature Screens

┌──────▼──────┐
│ Student │
│ Switcher │
└─────────────┘

Bottom Navigation

4 tabs:

TabIconScreens
HomeHomeIconDashboard, Student Switcher
MessagesMessageIconChat list, Chat thread
ModulesGridIconModule grid → feature screens
SettingsSettingsIconProfile, Notifications, Logout

AppNavigator

// core/navigation/app_navigator.dart
class AppNavigator {
static const String splash = '/';
static const String login = '/login';
static const String home = '/home';
static const String attendance = '/attendance';
static const String exam = '/exam';
static const String fee = '/fee';
// ...

static Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case splash:
return MaterialPageRoute(builder: (_) => const SplashScreen());
case login:
return MaterialPageRoute(builder: (_) => const LoginScreen());
case home:
return MaterialPageRoute(builder: (_) => const HomeScreen());
case attendance:
return MaterialPageRoute(builder: (_) => const AttendanceScreen());
// ...
}
}
}

Student Switcher

When a parent has multiple linked students, a student switcher widget at the top of the home screen allows switching context:

// StudentSwitcher widget
DropdownButton<String>(
value: selectedStudentId,
items: students.map((s) => DropdownMenuItem(
value: s.id,
child: Row(
children: [
CircleAvatar(backgroundImage: NetworkImage(s.photoUrl)),
Text(s.fullName),
],
),
)).toList(),
onChanged: (studentId) {
context.read<HomeViewModel>().switchStudent(studentId!);
},
)

Switching student updates the currentStudentId in HomeViewModel, which triggers a reload of all module data for the newly selected student.