ThemeController

class ThemeController(store: ThemeStore = InMemoryThemeStore, defaultDark: Boolean = true)

App-wide theme state holder (Mileway ThemeController idiom). Dark-first: defaults to true when the user hasn't chosen. Reads the persisted choice from store at construction and writes every change back, so the Settings toggle survives process death once a persistent ThemeStore is bound. Wasm-safe. Bound as a Koin singleton so the shell and the Settings screen share one instance.

Constructors

Link copied to clipboard
constructor(store: ThemeStore = InMemoryThemeStore, defaultDark: Boolean = true)

Properties

Link copied to clipboard
val isDark: StateFlow<Boolean>

Functions

Link copied to clipboard
fun setDark(dark: Boolean)
Link copied to clipboard
fun toggle()