Building healthy ergonomic habits requires consistency, and consistency requires prompts. The Reminders module gives teachers two distinct notification channels — recurring active break reminders and a single daily exercise alarm — so that good habits become part of the natural rhythm of a school day. All scheduling runs entirely on-device usingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Cristiang1021/ErgoKawsay/llms.txt
Use this file to discover all available pages before exploring further.
flutter_local_notifications, meaning no internet connection or external service is ever needed.
When notifications are active, the app schedules up to eight lookahead break reminders at once. Each notification carries one of ten rotating motivational messages drawn from both Spanish and Kichwa message banks, so the prompts always feel fresh. A configurable work window and an automatic night silence period ensure that reminders never arrive at inappropriate times.
Notification Types
Active Break Reminders
Periodic notifications delivered at a user-chosen frequency (30 min, 1 h, 2 h, or 3 h). Each notification displays one of ten rotating motivational messages covering neck stretches, hydration, eye rest, breathing, shoulder rolls, walking, back stretches, eye blinking, ankle circles, and gentle neck rotation — available in both Spanish and Kichwa. Only notifications that fall within the configured work window and outside the night silence period are actually delivered.
Daily Exercise Alarm
A single notification delivered once per day at a user-selected hour (default 07:00). It uses a dedicated Android notification channel (
daily_exercise) and prompts the teacher to begin their daily exercise session. The alarm advances to the next calendar day automatically if the scheduled time has already passed when settings are saved.Configuration Options
Every value below maps directly to a field in theReminderSettings model and is persisted to SharedPreferences as JSON under AppConstants.keyReminders ("reminders").
| Setting | Type | Default | Description |
|---|---|---|---|
notificationsActive | bool | true | Master on/off toggle for all reminder notifications |
breakFrequencyMinutes | int | 60 | Minutes between active break reminders (presets: 30, 60, 120, 180) |
dailyExerciseHour | int | 7 | Hour of day (0–23) for the daily exercise notification |
workStartHour | int | 8 | Notifications are only scheduled after this hour |
workEndHour | int | 17 | Notifications are only scheduled before this hour |
nightSilenceStartHour | int | 20 | Night silence window begins at this hour |
nightSilenceEndHour | int | 6 | Night silence window ends at this hour |
customFrequencyMinutes | int | 45 | Persisted value when the user picks a custom break frequency via Settings |
reminderTypes | List<String> | all 5 types | Active reminder categories: neck, shoulders, vision, breathing, hydration |
Night Silence Mode
WhennightSilenceStartHour is greater than nightSilenceEndHour — as in the default 20:00–06:00 window — the logic wraps around midnight. A slot at any hour that is either >= nightSilenceStartHour or < nightSilenceEndHour is considered inside the silence window and is skipped forward to the next workStartHour. When start and end are on the same calendar side (e.g., 01:00–05:00), the simpler >= / < range is used instead.
The companion check for work hours (_isOutsideWorkHours) runs in parallel; if a slot falls outside both the work window and the night silence window, it is bumped to the next workStartHour on the following day.
Motivational Messages
TheNotificationService contains two static lists of ten messages each — one in Spanish (_messagesEs) and one in Kichwa (_messagesQu). The active list is chosen at scheduling time based on the locale stored in StorageService.
To avoid always showing the same first message, the starting index is offset by DateTime.now().minute % 10, so the sequence varies every time the reminders are rescheduled.
Spanish messages (_messagesEs)
- Pausa activa: estira cuello y hombros durante 2 minutos.
- Hidratación: toma un vaso de agua ahora.
- Descansa la vista: mira un punto lejano durante 20 segundos.
- Respira profundo: inhala 4 s, retén 4 s, exhala 4 s.
- Pausa de hombros: eleva y suelta 5 veces lentamente.
- Levántate y camina 2 minutos. Tu cuerpo lo agradece.
- Estira la espalda: entrelaza los dedos y estira hacia arriba.
- Parpadea 20 veces para relajar los ojos.
- Mueve los tobillos en círculos mientras estás sentado.
- Gira el cuello suavemente de lado a lado, sin forzar.
_messagesQu)
- Kawsay sayay: kunkata, rikrak’ta samachiy.
- Yakuta upiy kunan. Alli kawsaypaqmi.
- Ñawikunata samachiy: karupi rikhuriq rurayta qhawaychiy.
- Ukhu samay: 4 sigundu ukhu, 4 chariy, 4 llujshiy.
- Rikrak’ta sayariy: 5 kutita sinchita wicharichiy, samariy.
- Sayariy, 2 minututa puriy. Aychata samachiy.
- Wasan q’ipiyta alliyachiy: makikunata wichaypi.
- Ñawikunata 20 kutita kinrayachiy.
- Chaki moqokunata muyu muyu tukuchiy.
- Kunkata sinchiyachishpa muyurichiy.
Notification IDs
| Notification | ID Range | Notes |
|---|---|---|
| Active break reminders | 100–107 | Eight lookahead slots, IDs 100 through 107 |
| Daily exercise alarm | 200 | Single daily notification |
| Test notification | 999 | Fired immediately; does not affect scheduled slots |
Scheduling Flow
NotificationService.instance.scheduleReminders(settings, locale) always calls cancelAll() first, then re-schedules all active slots from scratch. This guarantees no stale notifications remain after any settings change:
cancelAll()— removes every previously registered notification._scheduleBreakReminders()— registers up to eight break notifications (IDs 100–107), skipping any slot that falls outside work hours or inside the night silence window._scheduleDailyExercise()— registers notification ID 200 for the configured hour (or the same hour next day if it has already passed today).
notificationsActive is false, cancelAll() is called and steps 2 and 3 are skipped entirely.
StorageService Integration
ReminderSettings is serialized to JSON and stored in SharedPreferences. The two key methods are:
NotificationService.instance.scheduleReminders(settings, locale) to cancel any previously scheduled notifications and replace them with a fresh set derived from the new configuration.
The SharedPreferences key used internally is AppConstants.keyReminders ("reminders").
Test Notification
Developers and users can verify that the Android notification channel is properly configured by firing an immediate test notification:999 with the first active break message in the current locale (_testMessageEs or _testMessageQu) without touching any of the scheduled slots. The Settings screen surfaces this as a “Send test notification” row that triggers the call and shows a confirmation snackbar.
Route
Navigate to the Reminders screen via the named route/reminders.