diff options
Diffstat (limited to 'lib/main.dart')
| -rw-r--r-- | lib/main.dart | 84 |
1 files changed, 76 insertions, 8 deletions
diff --git a/lib/main.dart b/lib/main.dart index 61dfcf0..594be4d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,6 +3,7 @@ import 'routes.dart'; import 'login.dart'; import 'cart.dart'; import 'payement_order.dart'; +import 'signup.dart'; import 'order_history.dart'; void main() { @@ -18,8 +19,9 @@ class MyApp extends StatelessWidget { primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), - home: HomePage(), // Set the home page to a custom HomePage widget + home: HomePage(), routes: { + '/signup': (context) => SignUpPage(), '/login': (context) => LoginPage(), '/routes': (context) => RoutesPage(), '/order_history': (context) => OrderHistoryPage(), @@ -60,6 +62,14 @@ class HomePage extends StatelessWidget { ), ), _buildDrawerItem( + icon: Icons.app_registration_rounded, + text: 'Signup', + onTap: () { + Navigator.pop(context); + Navigator.pushNamed(context, '/signup'); + }, + ), + _buildDrawerItem( icon: Icons.login, text: 'Login', onTap: () { @@ -102,13 +112,71 @@ class HomePage extends StatelessWidget { ], ), ), - body: const Center( - child: Text( - 'Welcome to Carpool App!', - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const SizedBox(height: 20), + const Text( + 'Hello there', + style: TextStyle( + fontSize: 48, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 20), + const Text( + 'Welcome to Carpool', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 20), + Image.asset( + 'assets/logo.png', + width: 200, + height: 200, + ), + const SizedBox(height: 40), + ElevatedButton( + onPressed: () { + Navigator.pushNamed(context, '/login'); + }, + style: ElevatedButton.styleFrom( + primary: Colors.blue, + ), + child: const Padding( + padding: EdgeInsets.symmetric(horizontal: 40, vertical: 16), + child: Text( + 'Login', + style: TextStyle( + fontSize: 18, + color: Colors.white, + ), + ), + ), + ), + const SizedBox(height: 20), + ElevatedButton( + onPressed: () { + Navigator.pushNamed(context, '/signup'); + }, + style: ElevatedButton.styleFrom( + primary: Colors.green, + ), + child: const Padding( + padding: EdgeInsets.symmetric(horizontal: 40, vertical: 16), + child: Text( + 'Signup', + style: TextStyle( + fontSize: 18, + color: Colors.white, + ), + ), + ), + ), + ], ), ), ); |
