feat: enhance category handling with new category chip logic and user-specific product categorization
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-11 22:03:09 +02:00
parent f19c157e8f
commit cd84e25890
5 changed files with 110 additions and 27 deletions
@@ -288,6 +288,10 @@ class _ForegroundTile extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context);
final location = normalizedOptionalText(item.location);
final categoryChip = categoryChipText(
categoryPath: item.categoryPath,
fallbackL1: item.l1Category,
);
final subtitleText = [
'${_fmtQty(item.quantity)} ${item.unit}',
@@ -333,19 +337,22 @@ class _ForegroundTile extends ConsumerWidget {
const SizedBox(height: 6),
Align(
alignment: Alignment.centerLeft,
child: Chip(
label: Text(
l1CategoryChipLabel('L1: ', item.l1Category),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
side: BorderSide(color: theme.colorScheme.outlineVariant),
backgroundColor: theme.colorScheme.surface,
labelStyle: theme.textTheme.bodySmall?.copyWith(
color: theme.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: theme.colorScheme.outlineVariant),
backgroundColor: theme.colorScheme.surface,
labelStyle: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),
),
),
),