setDarkThemeConfig

abstract suspend fun setDarkThemeConfig(darkThemeConfigPreferences: DarkThemeConfigPreferences)

Updates the dark theme configuration preference.

This function atomically updates the user's preferred dark theme setting. The change triggers a reactive update in all collectors of getUserDataPreferences.

When to Use

  • User toggles theme in settings

  • Applying theme from synced preferences

  • Resetting theme to system default

Example

fun setLightMode() {
_uiState.updateWith {
userPreferencesDataSource.setDarkThemeConfig(
DarkThemeConfigPreferences.LIGHT
)
}
}

Parameters

darkThemeConfigPreferences

The desired dark theme configuration.

See also

for available options