Skip to main content

Navigation

App Flow

LoginView
└── SplashView (check stored token)
├── Token exists + valid → HomeView
└── No token / expired → PinLoginView or LoginView
└── OTP verified → SetPinView (first time) → HomeView

Screen Routes

RouteScreenDescription
/SplashViewToken check, redirect
/loginLoginViewPhone number entry
/otp-verifyOtpVerifyViewOTP entry
/pin-loginPinLoginViewPIN entry for returning driver
/set-pinSetPinViewFirst-time PIN setup
/forgot-password-phoneForgotPasswordPhoneViewForgot PIN — phone entry
/forgot-password-otpForgotPasswordOtpViewForgot PIN — OTP verify
/forgot-password-set-pinForgotPasswordSetPinViewForgot PIN — new PIN
/homeHomeViewMain dashboard with map
/trip-detail/:idTripDetailViewTrip stops and controls
/students/:tripIdStudentsViewStudent list for a stop
/incident-reportIncidentReportViewReport new incident
/incident-historyIncidentHistoryViewPast incidents
/profileProfileViewProfile and PIN change

Bottom Navigation

Bottom nav on the main shell (HomeView) has 4 tabs:

TabIconScreen
HomeIcons.homeHomeView
HistoryIcons.historyIncidentHistoryView
ReportIcons.warningIncidentReportView
ProfileIcons.personProfileView

AppNavigator

app_navigator.dart uses Navigator.pushNamed for all routing:

class AppNavigator {
static void push(BuildContext context, String routeName, {Object? arguments}) {
Navigator.pushNamed(context, routeName, arguments: arguments);
}

static void pushReplacement(BuildContext context, String routeName, {Object? arguments}) {
Navigator.pushReplacementNamed(context, routeName, arguments: arguments);
}

static void pop(BuildContext context) {
Navigator.pop(context);
}
}