busgo: A Bus Ticket Booking Flow in Flutter
A UI prototype for booking bus tickets, search, pick a bus, pick a seat, enter passenger details, pay, ticket. Flutter with Riverpod and go_router; Supabase handles Google sign-in, the booking data stays local.
busgo is a bus-ticket booking flow I built to practise one specific thing: a multi-step flow in Flutter without every screen knowing what comes next.
The booking flow is all local data. The one thing that talks to a server is login: Google sign-in, handed to Supabase. What’s being exercised here is the navigation and the shape of the state, not integration.
The flow
login → home (search form)
→ select_bus_page
→ select_seat_sheet
→ passengger_form_sheet
→ waiting_payment
→ ticket → list_booking
The three middle steps aren’t full pages but bottom sheets (select_seat_sheet, passengger_form_sheet, plus the shared bottom_sheet_selector and bottom_sheet_date_selector). The reason is practical: picking a seat and then changing your mind is normal, and dismissing a sheet feels far cheaper than hitting back on a full page.
Routes and state
Navigation goes through go_router in a single lib/core/router.dart, so every route is readable in one place and no screen pushes directly to another. State is Riverpod (flutter_riverpod + hooks_riverpod), with ProviderScope wrapped around the app in main.dart, after the .env file is read and Supabase is initialised:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Env.load();
await Supabase.initialize(
url: EnvKeys.supabaseUrl,
anonKey: EnvKeys.supabaseAnonKey,
);
runApp(const ProviderScope(child: BusGoApp()));
}
Login
AuthController runs google_sign_in, then passes the Google ID token and access token to Supabase with signInWithIdToken. The router listens to Supabase’s onAuthStateChange through a small GoRouterRefreshStream, and its redirect does the rest: no user sends you to /login, a signed-in user on /login goes to /home. No screen checks the session itself.
The folder layout is by feature, not by file type:
lib/features/{auth,home,booking,payment,profile}
lib/shared/widgets # bottom navigation + sheets used across features
lib/core/router.dart # routes + auth redirect
Status
A UI prototype for Android and iOS (the desktop and web targets were removed). Login is real, the rest is not: no bookings are stored anywhere, and there is no real payment, waiting_payment just holds the screen. If it ever gets wired to an API, the layer to add is a repository under the providers; the screens shouldn’t have to know.