order detail

This commit is contained in:
Phuoc Nguyen
2025-10-27 15:01:34 +07:00
parent c941d6d983
commit 7ce4239772
4 changed files with 1124 additions and 71 deletions

View File

@@ -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(),
],
),
),
),