Skip to main content

Documentation 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.

The Settings screen is the single place where teachers can tailor every aspect of ErgoKawsay to suit their classroom environment, device preferences, and individual needs. From choosing a language to activating a colorblind color filter, each preference is written to SharedPreferences immediately on change — there is no save button to forget. The screen is also available as an embedded widget for use inside the home tab without a navigation push.

Settings Categories

ErgoKawsay ships with full bilingual support for Spanish (es) and Kichwa (qu). The current language is displayed in the row’s subtitle and tapping opens the LanguageSelectionScreen as a full-screen modal dialog.
// Persist a language selection
await storage.setLanguage('qu'); // 'es' or 'qu'

// Read the active language
final lang = storage.getLanguage(); // returns null if unset
Changing the language immediately reloads all UI strings from the app’s localization layer (AppLocalizations). The entire widget tree rebuilds with the new locale — no restart required.A secondary “Reset language” row (shown in a destructive red style) clears the persisted language via storage.clearLanguage() and navigates back to the initial /language onboarding screen, allowing the teacher to pick a different language from scratch.
The language selection screen (/language) also appears during first launch. Returning to it from Settings does not reset any other preferences.

AccessibilitySettings Model

enum TextSizeOption { normal, large, extraLarge }

class AccessibilitySettings {
  final TextSizeOption textSize; // default: TextSizeOption.normal
  final bool colorBlind;        // default: false

  // Derived scale factor consumed by MediaQuery via TextScaler.linear
  double get textScale => switch (textSize) {
    TextSizeOption.normal     => 1.0,
    TextSizeOption.large      => 1.18,
    TextSizeOption.extraLarge => 1.38,
  };
}
The model serializes to JSON as { "textSize": "normal", "colorBlind": false } and is stored under the "accessibility" SharedPreferences key. Deserialization is null-safe and falls back to defaults for any missing field.

Active Break Notifications (Settings Screen Controls)

The Settings screen also exposes the full reminders configuration as a dedicated “Active breaks” section, surfacing the same data as the standalone /reminders screen through a set of tappable rows and a master toggle:
A Switch row bound to storage.notificationsEnabled. When turned off, NotificationService.instance.cancelAll() is called and no new notifications are scheduled — regardless of the individual ReminderSettings.notificationsActive flag. When turned back on, the stored ReminderSettings are immediately re-applied.
await storage.setNotificationsEnabled(false); // cancels all
await storage.setNotificationsEnabled(true);  // re-schedules
Opens a bottom sheet with two time pickers (start and end hour). Updates ReminderSettings.workStartHour and ReminderSettings.workEndHour, then re-schedules all notifications for the new window.
Opens a bottom sheet with presets (every 30 min, 45 min, 60 min) and a custom slider (10–120 min). Updates ReminderSettings.breakFrequencyMinutes and, for custom values, ReminderSettings.customFrequencyMinutes.
Opens a bottom sheet with five checkboxes: neck, shoulders, vision, breathing, hydration. Updates ReminderSettings.reminderTypes.
Calls NotificationService.instance.showTestNotification(locale) immediately and shows a confirmation snackbar. Useful for verifying that the Android notification channel is correctly registered on the device.
All settings are persisted immediately on change via their respective StorageService methods. No save button is required anywhere on the Settings screen.

SharedPreferences Keys

All Settings-related data uses the following keys from AppConstants:
ConstantKey stringUsed for
AppConstants.keyLanguage"language"Selected locale ("es" or "qu")
AppConstants.keyThemeMode"theme_mode"Active ThemeMode
AppConstants.keyNotificationsEnabled"notifications_enabled"Master notifications toggle
AppConstants.keyReminders"reminders"ReminderSettings JSON
AppConstants.keyAccessibility"accessibility"AccessibilitySettings JSON
AppConstants.keyProfileName"profile_name"Teacher display name
AppConstants.keyProfileAvatar"profile_avatar"Avatar file path
AppConstants.keyProfileCompleted"profile_completed"Profile setup completion flag

App Information

At the bottom of the Settings screen a read-only info block displays the app logo, name, subtitle (AppConstants.appSubtitle), version (AppConstants.appVersion), and the ESPOCH institutional logo. This section has no interactive controls.

Route

Navigate to the Settings screen via the named route /settings. The screen can also be embedded within a parent Scaffold by constructing it with embedded: true, which renders the screen without its own navigation bar.

Build docs developers (and LLMs) love