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:
parent
4ebfdca2fd
commit
4bb94db3e0
19 changed files with 954 additions and 2 deletions
|
|
@ -39,6 +39,7 @@ class TranslationsPt extends Translations with BaseTranslations<AppLocale, Trans
|
|||
TranslationsPt $copyWith({TranslationMetadata<AppLocale, Translations>? meta}) => TranslationsPt(meta: meta ?? this.$meta);
|
||||
|
||||
// Translations
|
||||
@override late final _Translations$seedSaving$pt seedSaving = _Translations$seedSaving$pt._(_root);
|
||||
@override late final _Translations$calendar$pt calendar = _Translations$calendar$pt._(_root);
|
||||
@override late final _Translations$app$pt app = _Translations$app$pt._(_root);
|
||||
@override late final _Translations$bootstrap$pt bootstrap = _Translations$bootstrap$pt._(_root);
|
||||
|
|
@ -82,6 +83,39 @@ class TranslationsPt extends Translations with BaseTranslations<AppLocale, Trans
|
|||
@override late final _Translations$sale$pt sale = _Translations$sale$pt._(_root);
|
||||
}
|
||||
|
||||
// Path: seedSaving
|
||||
class _Translations$seedSaving$pt extends Translations$seedSaving$en {
|
||||
_Translations$seedSaving$pt._(TranslationsPt root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsPt _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Guardar a sua semente';
|
||||
@override String get subtitle => 'O que é preciso para manter a variedade fiel';
|
||||
@override String get lifeCycle => 'Ciclo';
|
||||
@override String get cycleAnnual => 'Anual';
|
||||
@override String get cycleBiennial => 'Bienal — dá semente no 2.º ano';
|
||||
@override String get cyclePerennial => 'Perene';
|
||||
@override String get pollination => 'Polinização';
|
||||
@override String get pollSelf => 'Autopoliniza-se';
|
||||
@override String get pollCross => 'Cruza-se com outras';
|
||||
@override String get pollMixed => 'Autopoliniza-se, mas às vezes cruza';
|
||||
@override String get byInsect => 'por insetos';
|
||||
@override String get byWind => 'pelo vento';
|
||||
@override String get isolation => 'Separe-a';
|
||||
@override String isolationRange({required Object min, required Object max}) => '${min}–${max} m de outras variedades';
|
||||
@override String isolationSingle({required Object min}) => '${min} m de outras variedades';
|
||||
@override String get plants => 'Guarde de várias plantas';
|
||||
@override String plantsValue({required Object n}) => 'De pelo menos ${n} plantas';
|
||||
@override String get processing => 'Como limpá-la';
|
||||
@override String get procDry => 'Semente seca (debulhar)';
|
||||
@override String get procWet => 'Semente húmida (fermentar e lavar)';
|
||||
@override String get difficulty => 'Dificuldade';
|
||||
@override String get diffEasy => 'Fácil';
|
||||
@override String get diffMedium => 'Média';
|
||||
@override String get diffHard => 'Difícil';
|
||||
}
|
||||
|
||||
// Path: calendar
|
||||
class _Translations$calendar$pt extends Translations$calendar$en {
|
||||
_Translations$calendar$pt._(TranslationsPt root) : this._root = root, super.internal(root);
|
||||
|
|
@ -1225,6 +1259,30 @@ class _Translations$intro$slides$plantare$pt extends Translations$intro$slides$p
|
|||
extension on TranslationsPt {
|
||||
dynamic _flatMapFunction(String path) {
|
||||
return switch (path) {
|
||||
'seedSaving.title' => 'Guardar a sua semente',
|
||||
'seedSaving.subtitle' => 'O que é preciso para manter a variedade fiel',
|
||||
'seedSaving.lifeCycle' => 'Ciclo',
|
||||
'seedSaving.cycleAnnual' => 'Anual',
|
||||
'seedSaving.cycleBiennial' => 'Bienal — dá semente no 2.º ano',
|
||||
'seedSaving.cyclePerennial' => 'Perene',
|
||||
'seedSaving.pollination' => 'Polinização',
|
||||
'seedSaving.pollSelf' => 'Autopoliniza-se',
|
||||
'seedSaving.pollCross' => 'Cruza-se com outras',
|
||||
'seedSaving.pollMixed' => 'Autopoliniza-se, mas às vezes cruza',
|
||||
'seedSaving.byInsect' => 'por insetos',
|
||||
'seedSaving.byWind' => 'pelo vento',
|
||||
'seedSaving.isolation' => 'Separe-a',
|
||||
'seedSaving.isolationRange' => ({required Object min, required Object max}) => '${min}–${max} m de outras variedades',
|
||||
'seedSaving.isolationSingle' => ({required Object min}) => '${min} m de outras variedades',
|
||||
'seedSaving.plants' => 'Guarde de várias plantas',
|
||||
'seedSaving.plantsValue' => ({required Object n}) => 'De pelo menos ${n} plantas',
|
||||
'seedSaving.processing' => 'Como limpá-la',
|
||||
'seedSaving.procDry' => 'Semente seca (debulhar)',
|
||||
'seedSaving.procWet' => 'Semente húmida (fermentar e lavar)',
|
||||
'seedSaving.difficulty' => 'Dificuldade',
|
||||
'seedSaving.diffEasy' => 'Fácil',
|
||||
'seedSaving.diffMedium' => 'Média',
|
||||
'seedSaving.diffHard' => 'Difícil',
|
||||
'calendar.title' => 'Este mês',
|
||||
'calendar.filterChip' => 'Este mês',
|
||||
'calendar.nothing' => ({required Object month}) => 'Nada anotado para ${month}.',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue