From 128e4733744d8908460e1ea9313c9a3011ff86c4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Brule Date: Mon, 17 Nov 2025 08:54:38 -0500 Subject: [PATCH] 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 --- lib/components/delivery_list_item.dart | 109 +------------------------ 1 file changed, 3 insertions(+), 106 deletions(-) diff --git a/lib/components/delivery_list_item.dart b/lib/components/delivery_list_item.dart index 0a1fe13..61b9c4d 100644 --- a/lib/components/delivery_list_item.dart +++ b/lib/components/delivery_list_item.dart @@ -78,18 +78,6 @@ class _DeliveryListItemState extends State 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 Widget build(BuildContext context) { final isDark = Theme.of(context).brightness == Brightness.dark; @@ -141,7 +129,7 @@ class _DeliveryListItemState extends State // Left accent bar Container( width: 4, - height: 60, + height: 48, decoration: BoxDecoration( color: statusColor, borderRadius: BorderRadius.circular(2), @@ -153,7 +141,7 @@ class _DeliveryListItemState extends State child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Name + // Customer Name Text( widget.delivery.name, style: Theme.of(context) @@ -174,105 +162,14 @@ class _DeliveryListItemState extends State style: Theme.of(context) .textTheme .bodySmall, - maxLines: 1, + maxLines: 2, 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, - ), - ), - ), - ), ], ), ),