order detail
This commit is contained in:
1057
lib/features/orders/presentation/pages/order_detail_page.dart
Normal file
1057
lib/features/orders/presentation/pages/order_detail_page.dart
Normal file
File diff suppressed because it is too large
Load Diff
@@ -107,15 +107,7 @@ class _OrdersPageState extends ConsumerState<OrdersPage> {
|
||||
return OrderCard(
|
||||
order: order,
|
||||
onTap: () {
|
||||
// TODO: Navigate to order detail page
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'Order ${order.orderNumber} tapped',
|
||||
),
|
||||
duration: const Duration(seconds: 1),
|
||||
),
|
||||
);
|
||||
context.push('/orders/${order.orderId}');
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
@@ -45,74 +45,64 @@ class OrderCard extends StatelessWidget {
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
left: BorderSide(
|
||||
color: _getStatusColor(order.status),
|
||||
width: 4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Order number and amount row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Order number
|
||||
Text(
|
||||
'#${order.orderNumber}',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.grey900,
|
||||
),
|
||||
),
|
||||
|
||||
// Amount
|
||||
Text(
|
||||
currencyFormatter.format(order.finalAmount),
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.primaryBlue,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Order number and amount row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Order number
|
||||
Text(
|
||||
'#${order.orderNumber}',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.grey900,
|
||||
),
|
||||
),
|
||||
|
||||
// Amount
|
||||
Text(
|
||||
currencyFormatter.format(order.finalAmount),
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.primaryBlue,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
const SizedBox(height: 12),
|
||||
// Order details
|
||||
_buildDetailRow(
|
||||
'Ngày đặt:',
|
||||
_formatDate(order.createdAt),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
|
||||
// Order details
|
||||
_buildDetailRow(
|
||||
'Ngày đặt:',
|
||||
_formatDate(order.createdAt),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
_buildDetailRow(
|
||||
'Ngày giao:',
|
||||
order.expectedDeliveryDate != null
|
||||
? _formatDate(order.expectedDeliveryDate!)
|
||||
: 'Chưa xác định',
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
|
||||
_buildDetailRow(
|
||||
'Ngày giao:',
|
||||
order.expectedDeliveryDate != null
|
||||
? _formatDate(order.expectedDeliveryDate!)
|
||||
: 'Chưa xác định',
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
_buildDetailRow(
|
||||
'Địa chỉ:',
|
||||
_getShortAddress(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_buildDetailRow(
|
||||
'Địa chỉ:',
|
||||
_getShortAddress(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Status badge
|
||||
_buildStatusBadge(),
|
||||
],
|
||||
),
|
||||
// Status badge
|
||||
_buildStatusBadge(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user