feat(block1): photo thumbnails in the inventory list

The list showed only initials even when a variety had a photo (quick-add stores
one as an encrypted BLOB). Now the avatar shows the first photo, falling back to
the initial — matching the "foto/inicial" list spec.

- VarietyListItem carries the first photo bytes; watchInventory loads them in a
  single query per emission.
- List tile renders a MemoryImage avatar when present.

Tests: repository (photo bytes surfaced, null when none) and a widget test
(avatar replaces the initial). Full suite: 37 passing, 0 skipped.
This commit is contained in:
vjrj 2026-07-07 22:03:36 +02:00
parent 37427fa738
commit 8a19a6c85a
4 changed files with 87 additions and 10 deletions

View file

@ -122,7 +122,9 @@ class _VarietyTile extends StatelessWidget {
? '?'
: trimmed.substring(0, 1).toUpperCase();
return ListTile(
leading: CircleAvatar(child: Text(initial)),
leading: item.photo != null
? CircleAvatar(backgroundImage: MemoryImage(item.photo!))
: CircleAvatar(child: Text(initial)),
title: Text(item.label),
onTap: () => context.push('/variety/${item.id}'),
);