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:
@@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user