3.5 KiB
3.5 KiB
Siro Driver App - Authentication Flow & Cleanup Report
We traced the active routing flow of the driver app starting from the main entry point to document the actual user journey and identify unused legacy files.
1. Active User Authentication Flow
graph TD
A[main.dart] --> B[SplashScreen]
B --> C{onboarding Done?}
C -- No --> D[OnBoardingPage]
C -- Yes --> E{Phone Registered?}
E -- No --> F[LoginCaptin]
E -- Yes --> G[Auto Login & Go to HomeCaptain]
F --> H{Terms & Location Perms?}
H -- No --> I[Show Agreement & Perm Pages]
H -- Yes --> J[PhoneNumberScreen in otp_page.dart]
J --> K[Send OTP via Nabih]
K --> L[OtpVerificationScreen]
L --> M{isRegistered?}
M -- No --> N[RegistrationView]
M -- Yes --> G
Flow Breakdown
- Splash & Initial Check: Starting from
main.dart, the app boots intoSplashScreenand queriesSplashScreenController. - Onboarding Check: Checks
BoxName.onBoarding. If not completed, redirects toOnBoardingPage. - Identity Check: If
BoxName.phoneDriveris null, routes toLoginCaptininsidelogin_captin.dart. - Permissions & Phone Screen:
LoginCaptinbuilds and checksagreeTermsandlocationPermission. Once granted, it renders thePhoneNumberScreenwidget directly (which is imported fromotp_page.dart). - OTP Validation: Once the 3-digit SMS OTP code is verified,
PhoneAuthHelper.verifyOtpdetermines next steps:- New Captain: Redirects to
RegistrationViewinregistration_view.dart(which guides them through document capture and Gemini OCR extraction). - Existing Captain: Authenticates using the standard controller credentials and redirects to the
HomeCaptainmap/dashboard page.
- New Captain: Redirects to
2. Identified Unused Legacy Files
The following files are completely unreferenced by the driver app's active screens and routing controllers:
Unused Authentication Views
- register_page.dart - Unused email/password signup layout (leftover from Rider app).
- verify_email_page.dart - Unused email OTP verification screen.
- register_captin.dart - Unused captain email registration form.
- forget.dart - Unused forgot password screen.
Unused Controllers
- login_controller.dart - Unreferenced auth controller.
- register_controller.dart - Unreferenced registration logic.
- verify_email_controller.dart - Unreferenced email OTP logic.
- facebook_login.dart - Unused Facebook login helper.
- apple_sigin.dart - Unreferenced Apple sign-in handler (now that social login is removed from driver views).