Simplify delivery list item UI - customer name and address only

Remove status badges, phone button, and order amounts from delivery cards.
Display only customer name and address with left accent bar for status color.
This fixes the layout overflow issue by removing unnecessary elements.

Updated delivery_list_item.dart:
- Removed status badge container with icon and label
- Removed call button
- Removed order count text
- Removed total amount display
- Cleaned up unused helper methods (_getStatusIcon, _getStatusLabel)
- Reduced left accent bar height from 60 to 48

Result: Clean, simple delivery card showing only essential information

Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jean-Philippe Brule 2025-11-17 08:54:38 -05:00
parent dc9282e2c7
commit 128e473374

View File

@ -78,18 +78,6 @@ class _DeliveryListItemState extends State<DeliveryListItem>
return SvrntyColors.statusInTransit; return SvrntyColors.statusInTransit;
} }
IconData _getStatusIcon(Delivery delivery) {
if (delivery.isSkipped) return Icons.skip_next;
if (delivery.delivered) return Icons.check_circle;
return Icons.schedule;
}
String _getStatusLabel(Delivery delivery) {
if (delivery.isSkipped) return 'Skipped';
if (delivery.delivered) return 'Delivered';
return 'Pending';
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark; final isDark = Theme.of(context).brightness == Brightness.dark;
@ -141,7 +129,7 @@ class _DeliveryListItemState extends State<DeliveryListItem>
// Left accent bar // Left accent bar
Container( Container(
width: 4, width: 4,
height: 60, height: 48,
decoration: BoxDecoration( decoration: BoxDecoration(
color: statusColor, color: statusColor,
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
@ -153,7 +141,7 @@ class _DeliveryListItemState extends State<DeliveryListItem>
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Name // Customer Name
Text( Text(
widget.delivery.name, widget.delivery.name,
style: Theme.of(context) style: Theme.of(context)
@ -174,105 +162,14 @@ class _DeliveryListItemState extends State<DeliveryListItem>
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodySmall, .bodySmall,
maxLines: 1, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
const SizedBox(height: 4),
// Order count
Text(
'${widget.delivery.orders.length} order${widget.delivery.orders.length != 1 ? 's' : ''}',
style: Theme.of(context)
.textTheme
.labelSmall
?.copyWith(
fontSize: 10,
),
),
], ],
), ),
), ),
const SizedBox(width: 8),
// Status badge + Call button
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
// Status badge
Container(
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
decoration: BoxDecoration(
color: statusColor,
borderRadius: BorderRadius.circular(6),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
_getStatusIcon(widget.delivery),
color: Colors.white,
size: 12,
),
const SizedBox(width: 4),
Text(
_getStatusLabel(widget.delivery),
style: Theme.of(context)
.textTheme
.labelSmall
?.copyWith(
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 10,
),
),
], ],
), ),
),
const SizedBox(height: 6),
// Call button (if contact exists)
if (widget.delivery.orders.isNotEmpty &&
widget.delivery.orders.first.contact != null)
GestureDetector(
onTap: widget.onCall,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(6),
),
child: Icon(
Icons.phone,
color: Theme.of(context).colorScheme.onSurface,
size: 14,
),
),
),
],
),
],
),
// Total amount (if present)
if (widget.delivery.orders.isNotEmpty)
Padding(
padding: const EdgeInsets.only(top: 8, left: 16),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
'Total: \$${widget.delivery.orders.first.totalAmount.toStringAsFixed(2)}',
style: Theme.of(context)
.textTheme
.labelSmall
?.copyWith(
color: SvrntyColors.warning,
fontWeight: FontWeight.w500,
),
),
),
),
], ],
), ),
), ),