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 | |
| 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')
| -rw-r--r-- | lib/credit_card_payment.dart | 1 | ||||
| -rw-r--r-- | lib/main.dart | 84 | ||||
| -rw-r--r-- | lib/routes.dart | 2 | ||||
| -rw-r--r-- | lib/signup.dart | 75 |
4 files changed, 152 insertions, 10 deletions
diff --git a/lib/credit_card_payment.dart b/lib/credit_card_payment.dart index 7da09e4..0e73e6d 100644 --- a/lib/credit_card_payment.dart +++ b/lib/credit_card_payment.dart @@ -54,7 +54,6 @@ class CreditCardDetailsPage extends StatelessWidget { onPressed: () { // TODO // Implement payment processing logic here - // You can use the provided orderID to process payment print('Payment processed for Order ID: $orderID'); Navigator.pop( context); // Return to previous screen after payment 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, + ), + ), + ), + ), + ], ), ), ); diff --git a/lib/routes.dart b/lib/routes.dart index 2bedc8d..de5864c 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -46,7 +46,7 @@ class RoutesPage extends StatelessWidget { name: route.name, startLocation: route.startLocation, endLocation: route.endLocation, - time: formattedDateTime, // Get current time + time: formattedDateTime, ); Navigator.push( context, diff --git a/lib/signup.dart b/lib/signup.dart new file mode 100644 index 0000000..ecb8ec0 --- /dev/null +++ b/lib/signup.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; + +class SignUpPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Sign Up'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextFormField( + decoration: const InputDecoration( + labelText: 'First Name', + hintText: 'Enter your first name', + ), + ), + const SizedBox(height: 16.0), + TextFormField( + decoration: const InputDecoration( + labelText: 'Last Name', + hintText: 'Enter your last name', + ), + ), + const SizedBox(height: 16.0), + TextFormField( + decoration: const InputDecoration( + labelText: 'Email', + hintText: 'Enter your email', + ), + keyboardType: TextInputType.emailAddress, + ), + const SizedBox(height: 16.0), + TextFormField( + decoration: const InputDecoration( + labelText: 'Password', + hintText: 'Enter your password', + ), + obscureText: true, + ), + const SizedBox(height: 16.0), + TextFormField( + decoration: const InputDecoration( + labelText: 'Confirm password', + hintText: 'Re enter your password', + ), + obscureText: true, + ), + const SizedBox(height: 16.0), + TextFormField( + decoration: const InputDecoration( + labelText: 'Phone Number', + hintText: 'Enter your phone number', + ), + keyboardType: TextInputType.phone, + ), + const SizedBox(height: 24.0), + ElevatedButton( + onPressed: () { + // TODO + // Implement sign-up logic here + Navigator.pushNamed(context, '/home'); + }, + child: const Text('Sign Up'), + ), + ], + ), + ), + ); + } +} |
