summaryrefslogtreecommitdiff
path: root/mobile/lib/payement_order.dart
blob: eac05ece9c12fe98f13a0c40b565fff07944d1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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
              ),
            ),
          );
        },
      ),
    );
  }
}