diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2023-11-20 19:06:30 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2023-11-20 19:06:30 +0200 |
| commit | 8d6d7a1da19e691ce0b643b4136d946931a93b46 (patch) | |
| tree | b4c5afa91ea0763c3e5e5f389d8f1d6bdf3d8a51 /lib/main.dart | |
| parent | b327ea0d47024fc3d58a7624ba0e83a3d3534314 (diff) | |
| download | carpool-8d6d7a1da19e691ce0b643b4136d946931a93b46.tar.xz carpool-8d6d7a1da19e691ce0b643b4136d946931a93b46.zip | |
Added signup page and added logo asset and added simple home page
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, + ), + ), + ), + ), + ], ), ), ); |
