feat(screenshots): real maize photo as hero variety, surfaced at top of inventory

This commit is contained in:
vjrj 2026-07-15 13:07:46 +02:00
parent 6ee61046c8
commit eed96b2a75
48 changed files with 27 additions and 14 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 389 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 398 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 397 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 389 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 398 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 397 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 207 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 389 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 399 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 206 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 206 KiB

Before After
Before After

View file

@ -1,4 +1,6 @@
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:commons_core/commons_core.dart';
import 'package:drift/drift.dart' show Value;
@ -149,10 +151,14 @@ Future<SeededInventory> seedShowcase(
final sow = monthsToMask(const [3, 4, 5]);
final harvest = monthsToMask(const [8, 9]);
// Varieties render with the app's default coloured-initial disc avatar —
// the on-brand default when no photo is set so no image decoding is needed.
Future<String> add(String label, String family) async {
final id = await repo.addQuickVariety(label: label, category: family);
// Most varieties use the app's default coloured-initial disc avatar; the hero
// (maize) carries a real photo (below).
Future<String> add(String label, String family, {Uint8List? photo}) async {
final id = await repo.addQuickVariety(
label: label,
category: family,
photoBytes: photo,
);
await (db.update(db.varieties)..where((v) => v.id.equals(id))).write(
VarietiesCompanion(
sowMonths: Value(sow),
@ -162,27 +168,34 @@ Future<SeededInventory> seedShowcase(
return id;
}
final tomato = await add('Cherry tomato', 'Solanaceae');
// A real photo of red & white flint corn is the hero variety, so the detail
// shot shows a genuine seed photo. Loaded from the committed test fixture
// (CWD is the package root under `flutter test`).
final maizePhoto = await File(
'test/screenshots/fixtures/maize.jpg',
).readAsBytes();
final maize = await add('Painted flint corn', 'Poaceae', photo: maizePhoto);
await repo.addLot(
varietyId: tomato,
varietyId: maize,
harvestYear: 2024,
quantity: const Quantity(kind: QuantityKind.handful),
quantity: const Quantity(kind: QuantityKind.cob, count: 6),
originName: 'Community seed swap',
abundance: Abundance.plentyToShare,
offerStatus: OfferStatus.shared,
);
await repo.addLot(
varietyId: tomato,
varietyId: maize,
harvestYear: 2023,
quantity: const Quantity(kind: QuantityKind.packet, count: 1),
offerStatus: OfferStatus.exchange,
);
await add('Climbing bean', 'Fabaceae');
await add('Sunflower', 'Asteraceae');
await add('Sweet basil', 'Lamiaceae');
await add('Rainbow chard', 'Amaranthaceae');
await add('Purple carrot', 'Apiaceae');
// The rest sit in families that sort at/after Poaceae, so the maize (and its
// photo) stays the first, top-of-list group in the inventory shot.
await add('Common buckwheat', 'Polygonaceae');
await add('Alpine strawberry', 'Rosaceae');
await add('Cherry tomato', 'Solanaceae');
await add('Sweet pepper', 'Solanaceae');
return SeededInventory(tomato);
return SeededInventory(maize);
}