order detail
This commit is contained in:
@@ -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