feat: enhance category handling with new category chip logic and user-specific product categorization
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -374,6 +374,10 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
if (index == 1) return headerSection;
|
||||
final item = filteredItems[index - 2];
|
||||
final l1Category = _resolveL1Category(item);
|
||||
final categoryChip = categoryChipText(
|
||||
categoryPath: item.categoryPath,
|
||||
fallbackL1: l1Category,
|
||||
);
|
||||
final location = normalizedOptionalText(item.location);
|
||||
|
||||
return ListTile(
|
||||
@@ -390,19 +394,22 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
const SizedBox(height: 6),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Chip(
|
||||
label: Text(
|
||||
l1CategoryChipLabel('L1: ', l1Category),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
padding: EdgeInsets.zero,
|
||||
visualDensity: VisualDensity.compact,
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
side: BorderSide(color: colorScheme.outlineVariant),
|
||||
backgroundColor: colorScheme.surface,
|
||||
labelStyle: textTheme.bodySmall?.copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
child: Tooltip(
|
||||
message: categoryChip.tooltip,
|
||||
child: Chip(
|
||||
label: Text(
|
||||
categoryChip.label,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
padding: EdgeInsets.zero,
|
||||
visualDensity: VisualDensity.compact,
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
side: BorderSide(color: colorScheme.outlineVariant),
|
||||
backgroundColor: colorScheme.surface,
|
||||
labelStyle: textTheme.bodySmall?.copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user