UserPreferencesDataSource

Reads and updates UserDataPreferences in a typed JSON DataStore.

Reads expose a Flow; writes use transactional updateData calls through the implementation's IO dispatcher. Stored profile data is not a check of the current Firebase authentication session. Read/write failures propagate; malformed JSON has no configured default-value recovery handler. Repositories map this storage model to screen-facing data and wrap one-time operations in Result.

See also

Functions

Link copied to clipboard

Observes the complete user preferences data.

Link copied to clipboard
abstract suspend fun getUserIdOrThrow(): String

Returns the stored profile ID, rejecting an empty value.

Link copied to clipboard
abstract suspend fun resetUserPreferences()

Resets all user preferences to their default values.

Link copied to clipboard
abstract suspend fun setDarkThemeConfig(darkThemeConfigPreferences: DarkThemeConfigPreferences)

Updates the dark theme configuration preference.

Link copied to clipboard
abstract suspend fun setDynamicColorPreference(useDynamicColor: Boolean)

Updates the dynamic color preference.

Link copied to clipboard
abstract suspend fun setUserProfile(preferencesUserProfile: PreferencesUserProfile)

Updates the user's profile information in preferences.