feat(calendar): "what's due this month" — dedicated screen + inventory filter
Reuses the existing per-variety crop-calendar masks (sow/transplant/ flowering/fruiting/seed-harvest) — no schema change, no migration — to answer "qué toca este mes" across the whole inventory. Since the months are the grower's own record, there's no hemisphere assumption. - Repo: CalendarEntry + watchCalendar() (varieties with any recorded phase); VarietyListItem now carries sowMonths. - Dedicated CalendarScreen (/calendar): a month strip (defaults to the current month, intl month names) and varieties grouped by phase — actions (sow/transplant/harvest seed) above informational (flowering/ fruiting), each tinted, tap → variety detail; empty-month state. - Inventory filter: a 'this month' chip (shown only when some variety has a calendar) keeps what sows in the current month; folded into the attributes group + clear-filters. - Entry points: a live Home card + a drawer item. - i18n calendar block + menu.calendar (en/es/pt/ast). - Tests: calendar_test (watchCalendar, list carries sow-months, pure filter), calendar_screen_test (phase grouping, month switch, empty), plus the screen added to the small-screen overflow guard.
This commit is contained in:
parent
28e8318026
commit
171daabce3
19 changed files with 681 additions and 5 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$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);
|
||||
@override late final _Translations$common$pt common = _Translations$common$pt._(_root);
|
||||
|
|
@ -81,6 +82,19 @@ class TranslationsPt extends Translations with BaseTranslations<AppLocale, Trans
|
|||
@override late final _Translations$sale$pt sale = _Translations$sale$pt._(_root);
|
||||
}
|
||||
|
||||
// Path: calendar
|
||||
class _Translations$calendar$pt extends Translations$calendar$en {
|
||||
_Translations$calendar$pt._(TranslationsPt root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsPt _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Este mês';
|
||||
@override String get homeSubtitle => 'O que semear e fazer agora';
|
||||
@override String get filterChip => 'Este mês';
|
||||
@override String nothing({required Object month}) => 'Nada anotado para ${month}.';
|
||||
}
|
||||
|
||||
// Path: app
|
||||
class _Translations$app$pt extends Translations$app$en {
|
||||
_Translations$app$pt._(TranslationsPt root) : this._root = root, super.internal(root);
|
||||
|
|
@ -162,6 +176,7 @@ class _Translations$menu$pt extends Translations$menu$en {
|
|||
@override String get following => 'A seguir';
|
||||
@override String get plantares => 'Plantares';
|
||||
@override String get sales => 'Vendas';
|
||||
@override String get calendar => 'Calendário';
|
||||
@override String get settings => 'Definições';
|
||||
}
|
||||
|
||||
|
|
@ -1207,6 +1222,10 @@ class _Translations$intro$slides$plantare$pt extends Translations$intro$slides$p
|
|||
extension on TranslationsPt {
|
||||
dynamic _flatMapFunction(String path) {
|
||||
return switch (path) {
|
||||
'calendar.title' => 'Este mês',
|
||||
'calendar.homeSubtitle' => 'O que semear e fazer agora',
|
||||
'calendar.filterChip' => 'Este mês',
|
||||
'calendar.nothing' => ({required Object month}) => 'Nada anotado para ${month}.',
|
||||
'app.title' => 'Tanemaki',
|
||||
'bootstrap.failed' => 'O Tanemaki não conseguiu iniciar',
|
||||
'bootstrap.retry' => 'Tentar de novo',
|
||||
|
|
@ -1236,6 +1255,7 @@ extension on TranslationsPt {
|
|||
'menu.following' => 'A seguir',
|
||||
'menu.plantares' => 'Plantares',
|
||||
'menu.sales' => 'Vendas',
|
||||
'menu.calendar' => 'Calendário',
|
||||
'menu.settings' => 'Definições',
|
||||
'settings.language' => 'Idioma',
|
||||
'settings.systemLanguage' => 'Idioma do sistema',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue