fix(ui): pin edit-sheet Save button as a fixed footer

The variety edit sheet grew with v8 fields (organic, needs-reproduction,
crop calendar) and its Save button, sitting at the bottom of the
SingleChildScrollView, dropped below the fold — the species-linking
widget test could not reach it (tap landed off-screen, species never
linked). Move the fields into a Flexible scroll area and pin the
Cancel/Save row as a fixed footer so Save is always visible and tappable.

Full suite green (233 tests).
This commit is contained in:
vjrj 2026-07-10 02:19:07 +02:00
parent 733c118c3b
commit 0e6ef13d00

View file

@ -667,6 +667,13 @@ class _EditVarietySheetState extends State<_EditVarietySheet> {
top: 16,
bottom: MediaQuery.of(context).viewInsets.bottom + 16,
),
// Fields scroll; the Cancel/Save row is pinned as a fixed footer so Save
// stays visible and tappable no matter how tall the sheet grows.
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Flexible(
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
@ -707,7 +714,9 @@ class _EditVarietySheetState extends State<_EditVarietySheet> {
dense: true,
key: Key('species.option.${match.id}'),
title: Text(match.displayLabel),
subtitle: match.family == null ? null : Text(match.family!),
subtitle: match.family == null
? null
: Text(match.family!),
onTap: () => _pick(match),
),
const SizedBox(height: 12),
@ -785,10 +794,15 @@ class _EditVarietySheetState extends State<_EditVarietySheet> {
_MonthMultiSelect(
label: t.cropCalendar.seedHarvest,
mask: _seedHarvestMonths,
onChanged: (m) => setState(() => _seedHarvestMonths = m),
onChanged: (m) =>
setState(() => _seedHarvestMonths = m),
),
],
),
],
),
),
),
const SizedBox(height: 16),
Row(
children: [
@ -806,7 +820,6 @@ class _EditVarietySheetState extends State<_EditVarietySheet> {
),
],
),
),
);
}
}