From 8d6d7a1da19e691ce0b643b4136d946931a93b46 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Mon, 20 Nov 2023 19:06:30 +0200 Subject: Added signup page and added logo asset and added simple home page --- lib/main.dart | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 76 insertions(+), 8 deletions(-) (limited to 'lib/main.dart') 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(), @@ -59,6 +61,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', @@ -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, + ), + ), + ), + ), + ], ), ), ); -- cgit v1.2.3