NavigationSettingsRepository

Single source of truth for all navigation settings.

Provides typed access to settings via SettingsKey constants from Keys, persists values through SettingsStorage, and exposes reactive observation via StateFlow.

Create an instance using default:

val settingsRepository = NavigationSettingsRepository.default(context)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
operator fun <T> get(key: SettingsKey<T>): T

Reads the current value for key from storage. Returns SettingsKey.defaultValue if no value has been stored.

Link copied to clipboard
fun <T> observe(key: SettingsKey<T>): StateFlow<T>

Returns a StateFlow that emits the current value and subsequent changes for key.

Link copied to clipboard
operator fun <T> set(key: SettingsKey<T>, value: T)

Writes value for key to storage and notifies active observers.