Building Mama Haven: Care Logs, On-Device Sleep Audio, and a Streaming AI Companion
Aug 2026 · 4 min read

I shipped Mama Haven — “supporting every step of parenthood” as a Flutter app: setup a baby profile, log care, set reminders, and optionally talk to NURA, an AI companion.
Parenting apps fail in two ways: they overclaim medically, or they lose trust when yesterday’s diaper note becomes nonsense after you switch the app to Spanish. Mama Haven is built to avoid both.
Care is the spine
Core modules:
- Feeding — breast / bottle / solid
- Sleep — nap vs night, live timer, quality notes, white-noise / recording hooks
- Diapers — wet / dirty / mixed, condition, colour, consistency, rash, free-text note
- Growth — weight / height trends
- Vaccines & medicine
- Daily log — everything grouped by date
- Reminders — feeds, naps, vaccines, and more
Multi-child profiles live in an AppProvider backed by SharedPreferences, with keyed lists per care type (care:diaper, care:feeding, …). Persist is deliberate after mutations so a kill mid-session doesn’t drop the last write.
Locale-safe logs (the quiet bug)
Early builds stored diaper picker values as the English label on screen. Change language, and history became a mix of languages you couldn’t re-read.
The fix: store enum names, render through the active locale. fromJson still accepts legacy English labels ('Very Dark' → veryDark) and recovers colour/consistency that used to be flattened into the note string — then strips them back out so the note stays what the parent typed.
That kind of migration is unglamorous. It’s also why a care log remains useful six months later.
Sleep audio stays on the phone
RecordingService captures AAC-LC (64 kbps, 44.1 kHz) into the app documents directory as sleep_*.m4a. Playback via audioplayers. Paths are indexed by the provider so recordings survive restarts. Mic permission denial returns null — no fake “recording saved.”
Useful for white-noise loops or capturing a stretch of night sounds the parent wants to replay. Not cloud speech analytics unless you explicitly build that later.
NURA: streaming companion, gated gently
NuraAiService talks to the Mama Haven Lovable companion (/api/chat) or an OpenAI-compatible gateway — same family of pattern as VocoLiss. Keys/secrets stay in dart-defines / server, not as a hard-coded production secret in source for shipping.
- Streams assistant chunks (Stop cancels mid-stream)
- Suggestion chips send prompts in the parent’s language
- Free-tier replies, then Threescan consumable message packs
- Network failures surface as offline errors — not silent nonsense
- Optional
simulateRepliesfor UI/quota testing without burning gateway quota
Care context (child profile) can be passed into the chat so answers aren’t generic brochure copy. Framing still matters: AI suggestions are support, not clinical advice. Store listing and in-app voice should stay in that lane — same discipline as KegalFlow’s non-medical rules.
Consent order on iOS
TrackingService requests App Tracking Transparency on splash after UMP consent and before MobileAds.initialize — the order Google documents so the SDK sees final tracking status. Failures never block launch; tracking simply stays unauthorised.
What I shipped
Provider-based app shell, broad l10n, care hub, health/growth screens, notifications, pro/lifetime paywalls, remote-config monetization. Soft home aesthetic; the engineering weight is in the care model and NURA transport.
Store links:
What I’d still harden
Keep medical disclaimers visible near NURA and vaccine/medicine surfaces. Prefer a backend-only path for Lovable keys in production builds. Export/delete-all for family data should stay one tap away. Reminders currently split across prefs — consolidating with care persistence would reduce dual-write bugs.
Bet: parenting apps earn trust with logs that age well and AI that never pretends to be the pediatrician.
If you’re building family care tools: store enums, not labels — and keep sleep audio on-device until the parent chooses otherwise.
- flutter
- parenting
- baby-care
- ai
- local-first
- health-tech