Ritmo da Família (com.jhh.solutions.ritmo_familia) grew directly out of real family life as a father of three: young children cannot yet interpret digital clock numbers (14:35), yet they gain deep emotional calm when they can visually see where they are in the flow of the day (what just finished, what we are doing right now, and what comes next). Engineered in Flutter with Clean Architecture, the app combines a daytime Montessori + Time-Timer visual board with a zero-stimulus OLED Night Sanctuary.
Temporal Domain Architecture & Tech Stack
To compute routine transitions, nap dimming windows, and real-time solar/lunar positions every second without leaking pedagogical logic into UI widgets, the codebase strictly enforces Domain • Data • Presentation boundaries:
1Hz Clock Tick
ClockBloc
Pure UseCase
GetDailyRoutineStatus
Immutable Entities
18 Milestones + Family Identity
Celestial Arc
CustomPainter + Semantics
Time-Timer Ring
Before -> Now -> Next
Circadian Mode
Nap Dimming / OLED Sanctuary
- State Management & Functional Contracts: Reactive orchestration via
flutter_bloc 9.1, modular DI withget_it, declarativego_routernavigation, andEither<Failure, T>(dartz) contracts for backward-compatible local persistence. - Dynamic Multi-Child Identity: Grammatical composition engine supporting multiple siblings (e.g., "Rotina do Ben, da Clara e da Maria"), built to welcome new babies into the family schedule without UI refactoring.
- Accessibility & Instrumentation: Explicit
Semanticsannotations on custom-painted astronomical graphics and automated UI inspection hooks viamarionette_flutter.
Three-Zone Pedagogical Spatial Layout
| UI Zone | Technical Component | Pedagogical & Sensory Role |
|---|---|---|
| 1. Top Zone (Context) | Family Header + Full-Day Progress Bar | Displays overall daytime progress and offers an interactive "Explore the Day" learning mode |
| 2. Center Zone (Astronomy) | CelestialArcWidget (CustomPainter) | Renders continuous real-time Sun and Moon positions paired with protective companion themes |
| 3. Bottom Zone (Action) | DailyRoutineTimelineWidget + Time-Timer | Highlights the NOW card with a countdown ring (X min left), completed step (BEFORE ✓), and upcoming step (NEXT) across 18 daily moments |
Hardware-Aware UX: Nap Dimming & OLED Night Sanctuary
- Automatic Nap Atmosphere (
RoutineCategory.rest): Entering a scheduled afternoon nap window (30,60,90, or120 min) automatically softens screen luminance and color temperature into a restful twilight. - Ultra-Clean Night Sanctuary (
19:00to06:30): At bedtime, the entire 18-step daytime timeline disappears completely, eliminating visual stimulation, protecting natural melatonin synthesis, and preventing static OLED pixel wear.