resetUserPreferences

abstract suspend fun resetUserPreferences()

Resets all user preferences to their default values.

This function clears all user data and preference settings, returning them to the defaults defined in UserDataPreferences. This is typically used during logout.

When to Use

  • User logout (clear session data)

  • Account switching

  • Factory reset / clear app data

Example

suspend fun logout(): Result<Unit> = suspendRunCatching {
userPreferencesDataSource.resetUserPreferences()
authService.signOut()
}

Post-Reset State

After reset, getUserDataPreferences will emit:

  • id = ""

  • userName = null

  • profilePictureUriString = null

  • darkThemeConfigPreferences = FOLLOW_SYSTEM

  • useDynamicColor = true