summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/logo.pngbin0 -> 209266 bytes
-rw-r--r--lib/credit_card_payment.dart1
-rw-r--r--lib/main.dart84
-rw-r--r--lib/routes.dart2
-rw-r--r--lib/signup.dart75
-rw-r--r--pubspec.yaml5
6 files changed, 154 insertions, 13 deletions
diff --git a/assets/logo.png b/assets/logo.png
new file mode 100644
index 0000000..09da5c9
--- /dev/null
+++ b/assets/logo.png
Binary files differ
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'),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/pubspec.yaml b/pubspec.yaml
index dc78338..47fa101 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -60,9 +60,8 @@ flutter:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
- # assets:
- # - images/a_dot_burr.jpeg
- # - images/a_dot_ham.jpeg
+ assets:
+ - assets/logo.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware