feat(inventory): seed/plant clarity + full-screen photo viewer
- Each lot shows a Seeds/Plantel chip (green vs teal, with icon) so mixed seed-and-plant varieties read clearly at a glance. - Germination is hidden on plant lots (it only applies to seeds). - Tapping a photo in the detail carousel opens a full-screen, swipeable, pinch-to-zoom viewer. Tests: plant lot shows the Plants chip and hides germination. 53 green; Linux runs.
This commit is contained in:
parent
b23f4f1c77
commit
a69047326e
2 changed files with 143 additions and 20 deletions
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:tane/data/species_repository.dart';
|
||||
import 'package:tane/db/database.dart';
|
||||
import 'package:tane/db/enums.dart';
|
||||
|
||||
import '../support/test_support.dart';
|
||||
|
||||
|
|
@ -358,4 +359,32 @@ void main() {
|
|||
expect(find.text('Wiki'), findsNothing);
|
||||
await disposeTree(tester);
|
||||
});
|
||||
|
||||
testWidgets('plant lots show the Plants chip and hide germination', (
|
||||
tester,
|
||||
) async {
|
||||
final repo = newTestRepository(db);
|
||||
final id = await repo.addQuickVariety(label: 'Tomato');
|
||||
await repo.addLot(
|
||||
varietyId: id,
|
||||
type: LotType.plant,
|
||||
harvestYear: 2024,
|
||||
quantity: const Quantity(kind: QuantityKind.plant, count: 3),
|
||||
);
|
||||
|
||||
await tester.pumpWidget(
|
||||
wrapDetail(
|
||||
repository: repo,
|
||||
varietyId: id,
|
||||
species: newTestSpeciesRepository(db),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Plants'), findsOneWidget); // lot-type chip
|
||||
expect(find.text('Year 2024 · 3 plants'), findsOneWidget);
|
||||
// Germination is seed-only.
|
||||
expect(find.byIcon(Icons.grass_outlined), findsNothing);
|
||||
await disposeTree(tester);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue