ENGINEERING CASE STUDY

Ritmo da Família — 24h Temporal Localization & OLED Sanctuary

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.

81 Dart Files (Clean Arch)
29 Suites Unit & Widget Test Suites
18 Milestones Configurable Daily Timeline
0 Stimuli OLED Sanctuary (19:00–06:30)

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:

Stage 01

1Hz Clock Tick

ClockBloc

Stage 02

Pure UseCase

GetDailyRoutineStatus

Stage 03

Immutable Entities

18 Milestones + Family Identity

Stage 04

Celestial Arc

CustomPainter + Semantics

Stage 05

Time-Timer Ring

Before -> Now -> Next

Stage 06

Circadian Mode

Nap Dimming / OLED Sanctuary

  • State Management & Functional Contracts: Reactive orchestration via flutter_bloc 9.1, modular DI with get_it, declarative go_router navigation, and Either<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 Semantics annotations on custom-painted astronomical graphics and automated UI inspection hooks via marionette_flutter.

Three-Zone Pedagogical Spatial Layout

UI ZoneTechnical ComponentPedagogical & Sensory Role
1. Top Zone (Context)Family Header + Full-Day Progress BarDisplays 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-TimerHighlights 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, or 120 min) automatically softens screen luminance and color temperature into a restful twilight.
  • Ultra-Clean Night Sanctuary (19:00 to 06:30): At bedtime, the entire 18-step daytime timeline disappears completely, eliminating visual stimulation, protecting natural melatonin synthesis, and preventing static OLED pixel wear.