feat(seed-saving): per-crop 'how to save this seed' guidance

A bundled, curated knowledge layer — the differentiator of a serious
seed app. For a variety's crop it shows how the plant reproduces and what
it takes to keep the variety true: life cycle, pollination (self/cross +
insect/wind), isolation distance, how many plants to save from, dry/wet
processing, a difficulty pill, and a short tip — all in human words.

- assets/catalog/seed_saving.json: curated public-domain data (Seed to
  Seed / Seed Savers), keyed by botanical FAMILY (defaults) with
  per-species/genus OVERRIDES that win — so e.g. Vicia faba is correctly
  insect-cross-pollinated despite the selfing Fabaceae default, and maize
  is wind-pollinated with a large population. Notes are locale-keyed
  (es/en), extensible to any language — a starter set, not a ceiling.
- domain/seed_saving.dart (pure): enums + SeedSavingGuide (merge, note
  fallback) + SeedSavingData.guideFor (species → genus → family).
- data/seed_saving_catalog.dart: loads the asset once into an in-memory
  singleton (no DB table, no migration); injector loads it at startup.
- VarietyDetail gains  (from the linked species — the reliable
  key, vs the editable category); detail screen shows a _SeedSavingView
  when a guide resolves.
- i18n seedSaving block (labels + enum values + params) in en/es/pt/ast.
- Tests: domain lookup/merge, the real asset's key corrections, and the
  detail section shows/hides. 314 suite tests green; analyze clean.
This commit is contained in:
vjrj 2026-07-11 07:17:12 +02:00
parent 4ebfdca2fd
commit 4bb94db3e0
19 changed files with 954 additions and 2 deletions

View file

@ -39,6 +39,7 @@ class TranslationsEs extends Translations with BaseTranslations<AppLocale, Trans
TranslationsEs $copyWith({TranslationMetadata<AppLocale, Translations>? meta}) => TranslationsEs(meta: meta ?? this.$meta);
// Translations
@override late final _Translations$seedSaving$es seedSaving = _Translations$seedSaving$es._(_root);
@override late final _Translations$calendar$es calendar = _Translations$calendar$es._(_root);
@override late final _Translations$app$es app = _Translations$app$es._(_root);
@override late final _Translations$bootstrap$es bootstrap = _Translations$bootstrap$es._(_root);
@ -82,6 +83,39 @@ class TranslationsEs extends Translations with BaseTranslations<AppLocale, Trans
@override late final _Translations$sale$es sale = _Translations$sale$es._(_root);
}
// Path: seedSaving
class _Translations$seedSaving$es extends Translations$seedSaving$en {
_Translations$seedSaving$es._(TranslationsEs root) : this._root = root, super.internal(root);
final TranslationsEs _root; // ignore: unused_field
// Translations
@override String get title => 'Conservar su semilla';
@override String get subtitle => 'Lo que hace falta para mantener la variedad fiel';
@override String get lifeCycle => 'Ciclo';
@override String get cycleAnnual => 'Anual';
@override String get cycleBiennial => 'Bienal — da semilla el 2.º año';
@override String get cyclePerennial => 'Perenne';
@override String get pollination => 'Polinización';
@override String get pollSelf => 'Se autopoliniza';
@override String get pollCross => 'Se cruza con otras';
@override String get pollMixed => 'Se autopoliniza, pero se cruza a veces';
@override String get byInsect => 'por insectos';
@override String get byWind => 'por el viento';
@override String get isolation => 'Sepárala';
@override String isolationRange({required Object min, required Object max}) => '${min}${max} m de otras variedades';
@override String isolationSingle({required Object min}) => '${min} m de otras variedades';
@override String get plants => 'Guarda de varias plantas';
@override String plantsValue({required Object n}) => 'De al menos ${n} plantas';
@override String get processing => 'Cómo limpiarla';
@override String get procDry => 'Semilla seca (trillar)';
@override String get procWet => 'Semilla húmeda (fermentar y lavar)';
@override String get difficulty => 'Dificultad';
@override String get diffEasy => 'Fácil';
@override String get diffMedium => 'Media';
@override String get diffHard => 'Difícil';
}
// Path: calendar
class _Translations$calendar$es extends Translations$calendar$en {
_Translations$calendar$es._(TranslationsEs root) : this._root = root, super.internal(root);
@ -1228,6 +1262,30 @@ class _Translations$intro$slides$plantare$es extends Translations$intro$slides$p
extension on TranslationsEs {
dynamic _flatMapFunction(String path) {
return switch (path) {
'seedSaving.title' => 'Conservar su semilla',
'seedSaving.subtitle' => 'Lo que hace falta para mantener la variedad fiel',
'seedSaving.lifeCycle' => 'Ciclo',
'seedSaving.cycleAnnual' => 'Anual',
'seedSaving.cycleBiennial' => 'Bienal — da semilla el 2.º año',
'seedSaving.cyclePerennial' => 'Perenne',
'seedSaving.pollination' => 'Polinización',
'seedSaving.pollSelf' => 'Se autopoliniza',
'seedSaving.pollCross' => 'Se cruza con otras',
'seedSaving.pollMixed' => 'Se autopoliniza, pero se cruza a veces',
'seedSaving.byInsect' => 'por insectos',
'seedSaving.byWind' => 'por el viento',
'seedSaving.isolation' => 'Sepárala',
'seedSaving.isolationRange' => ({required Object min, required Object max}) => '${min}${max} m de otras variedades',
'seedSaving.isolationSingle' => ({required Object min}) => '${min} m de otras variedades',
'seedSaving.plants' => 'Guarda de varias plantas',
'seedSaving.plantsValue' => ({required Object n}) => 'De al menos ${n} plantas',
'seedSaving.processing' => 'Cómo limpiarla',
'seedSaving.procDry' => 'Semilla seca (trillar)',
'seedSaving.procWet' => 'Semilla húmeda (fermentar y lavar)',
'seedSaving.difficulty' => 'Dificultad',
'seedSaving.diffEasy' => 'Fácil',
'seedSaving.diffMedium' => 'Media',
'seedSaving.diffHard' => 'Difícil',
'calendar.title' => 'Este mes',
'calendar.filterChip' => 'Este mes',
'calendar.nothing' => ({required Object month}) => 'Nada anotado para ${month}.',