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