Settings

data class Settings(val userName: String? = null, val useDynamicColor: Boolean = true, val darkThemeConfig: DarkThemeConfig = DarkThemeConfig.FOLLOW_SYSTEM, val language: Language = Language.ENGLISH)

Domain model representing user-configurable application settings.

This model encapsulates all editable user preferences for themes, appearance, and localization. Settings are persisted in DataStore via UserDataPreferences and observed by the app's theme system in dev.atick.app.JetpackApp to apply user preferences across the entire application.

Settings data flow:

  • User modifies settings in dev.atick.feature.settings.ui.SettingsScreen

  • dev.atick.feature.settings.ui.SettingsViewModel updates via dev.atick.data.repository.settings.SettingsRepository

  • Repository persists changes to DataStore immediately (no sync required)

  • App composable observes settings and applies theme/language changes reactively

  • Settings survive app restarts and device reboots (DataStore persistence)

Mapping extensions for layer conversion:

Usage context:

  • Applied in app-level theme configuration (dev.atick.app.JetpackApp)

  • Displayed and edited in settings screen

  • useDynamicColor enables Material You dynamic theming on Android 12+

  • darkThemeConfig controls light/dark/system theme preference

  • language controls app localization (English/Arabic)

See also

DataStore preferences model for persistence

Enum representing theme configuration options

Enum representing supported languages

Repository providing settings operations

dev.atick.feature.settings.ui.SettingsViewModel

ViewModel managing settings state

Constructors

Link copied to clipboard
constructor(userName: String? = null, useDynamicColor: Boolean = true, darkThemeConfig: DarkThemeConfig = DarkThemeConfig.FOLLOW_SYSTEM, language: Language = Language.ENGLISH)

Properties

Link copied to clipboard

Theme preference: follow system, light, or dark (default: FOLLOW_SYSTEM).

Link copied to clipboard

App language preference (default: ENGLISH).

Link copied to clipboard

Whether to enable Material You dynamic colors (default: true).

Link copied to clipboard

Optional user name displayed in settings (nullable for unauthenticated users).