summaryrefslogtreecommitdiff
path: root/lib/payement_order.dart
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-11-20 18:21:13 +0200
committeromagdy7 <omar.professional8777@gmail.com>2023-11-20 18:21:13 +0200
commit0a609bb12e8ad1666bc3681a82465307385e8713 (patch)
treec7bf64a680d25d1df81916bb8c0b410ba0065bca /lib/payement_order.dart
parent6fa08163ed9c794482f27d17bf0e0508b474f239 (diff)
downloadcarpool-0a609bb12e8ad1666bc3681a82465307385e8713.tar.xz
carpool-0a609bb12e8ad1666bc3681a82465307385e8713.zip
Added payment page
Diffstat (limited to 'lib/payement_order.dart')
-rw-r--r--lib/payement_order.dart81
1 files changed, 81 insertions, 0 deletions
diff --git a/lib/payement_order.dart b/lib/payement_order.dart
new file mode 100644
index 0000000..eac05ec
--- /dev/null
+++ b/lib/payement_order.dart
@@ -0,0 +1,81 @@
+import 'package:flutter/material.dart';
+import 'credit_card_payment.dart';
+
+class Order {
+ final String orderID;
+ final String rideName;
+ final String status;
+ final double amount;
+
+ Order(
+ {required this.orderID,
+ required this.rideName,
+ required this.status,
+ required this.amount});
+}
+
+class PaymentOrderTrackingPage extends StatelessWidget {
+ final List<Order> orders = [
+ Order(
+ orderID: '001',
+ rideName: 'Morning Ride - Gate 3 to Abdu-Basha',
+ status: 'Completed',
+ amount: 15.0),
+ Order(
+ orderID: '002',
+ rideName: 'Afternoon Ride - Abdu-Basha to Gate 3',
+ status: 'Pending',
+ amount: 12.5),
+ ];
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ title: Text('Payment & Order Tracking'),
+ ),
+ body: ListView.builder(
+ itemCount: orders.length,
+ itemBuilder: (BuildContext context, int index) {
+ final Order order = orders[index];
+ return GestureDetector(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) =>
+ CreditCardDetailsPage(orderID: order.orderID),
+ ),
+ );
+ },
+ child: Card(
+ elevation: 3,
+ margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: ListTile(
+ title: Text(
+ 'Order ID: ${order.orderID}',
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ subtitle: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('Ride: ${order.rideName}'),
+ Text('Status: ${order.status}'),
+ Text('Amount: \$${order.amount.toStringAsFixed(2)}'),
+ ],
+ ),
+ leading: Icon(Icons
+ .payment), // TODO Use an appropriate icon for payment/order tracking
+ ),
+ ),
+ );
+ },
+ ),
+ );
+ }
+}