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
|
|
@ -40,6 +40,7 @@ class Translations with BaseTranslations<AppLocale, Translations> {
|
|||
Translations $copyWith({TranslationMetadata<AppLocale, Translations>? meta}) => Translations(meta: meta ?? this.$meta);
|
||||
|
||||
// Translations
|
||||
late final Translations$calendar$en calendar = Translations$calendar$en.internal(_root);
|
||||
late final Translations$app$en app = Translations$app$en.internal(_root);
|
||||
late final Translations$bootstrap$en bootstrap = Translations$bootstrap$en.internal(_root);
|
||||
late final Translations$common$en common = Translations$common$en.internal(_root);
|
||||
|
|
@ -82,6 +83,27 @@ class Translations with BaseTranslations<AppLocale, Translations> {
|
|||
late final Translations$sale$en sale = Translations$sale$en.internal(_root);
|
||||
}
|
||||
|
||||
// Path: calendar
|
||||
class Translations$calendar$en {
|
||||
Translations$calendar$en.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// en: 'This month'
|
||||
String get title => 'This month';
|
||||
|
||||
/// en: 'What to sow and do now'
|
||||
String get homeSubtitle => 'What to sow and do now';
|
||||
|
||||
/// en: 'This month'
|
||||
String get filterChip => 'This month';
|
||||
|
||||
/// en: 'Nothing noted for {month}.'
|
||||
String nothing({required Object month}) => 'Nothing noted for ${month}.';
|
||||
}
|
||||
|
||||
// Path: app
|
||||
class Translations$app$en {
|
||||
Translations$app$en.internal(this._root);
|
||||
|
|
@ -222,6 +244,9 @@ class Translations$menu$en {
|
|||
/// en: 'Sales'
|
||||
String get sales => 'Sales';
|
||||
|
||||
/// en: 'Calendar'
|
||||
String get calendar => 'Calendar';
|
||||
|
||||
/// en: 'Settings'
|
||||
String get settings => 'Settings';
|
||||
}
|
||||
|
|
@ -2111,6 +2136,10 @@ class Translations$intro$slides$plantare$en {
|
|||
extension on Translations {
|
||||
dynamic _flatMapFunction(String path) {
|
||||
return switch (path) {
|
||||
'calendar.title' => 'This month',
|
||||
'calendar.homeSubtitle' => 'What to sow and do now',
|
||||
'calendar.filterChip' => 'This month',
|
||||
'calendar.nothing' => ({required Object month}) => 'Nothing noted for ${month}.',
|
||||
'app.title' => 'Tanemaki',
|
||||
'bootstrap.failed' => 'Tanemaki couldn\'t start',
|
||||
'bootstrap.retry' => 'Try again',
|
||||
|
|
@ -2140,6 +2169,7 @@ extension on Translations {
|
|||
'menu.following' => 'Following',
|
||||
'menu.plantares' => 'Plantares',
|
||||
'menu.sales' => 'Sales',
|
||||
'menu.calendar' => 'Calendar',
|
||||
'menu.settings' => 'Settings',
|
||||
'settings.language' => 'Language',
|
||||
'settings.systemLanguage' => 'System language',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue