import 'package:flutter/material.dart'; import 'routes.dart'; import 'login.dart'; import 'cart.dart'; import 'order_history.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Carpool App', theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: HomePage(), // Set the home page to a custom HomePage widget routes: { '/login': (context) => LoginPage(), '/routes': (context) => RoutesPage(), '/order_history': (context) => OrderHistoryPage(), '/cart': (context) => CartPage( selectedRide: Ride( name: 'Sample Ride', startLocation: 'Sample Start', endLocation: 'Sample End', time: 'Sample Time', )), // Assuming a sample ride is passed to the CartPage for testing }, ); } } class HomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Select Page for Testing'), ), body: Center( child: DropdownButton( onChanged: (String? route) { if (route != null) { Navigator.pushNamed(context, route); } }, items: [ '/login', '/routes', '/cart', '/order_history', ].map>((String value) { return DropdownMenuItem( value: value, child: Text(value), ); }).toList(), ), ), ); } }