RuntimeThemeProvider

A runtime-only implementation of ThemeProvider that stores theme state in memory.

This provider maintains theme state only during the application's runtime and does not persist theme changes to any storage mechanism. The theme state is lost when the application is terminated. It's suitable for temporary theme switching or when persistence is handled by other components.

Parameters

initial

The initial theme to start with.

Constructors

Link copied to clipboard
constructor(initial: Theme)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val currentTheme: StateFlow<Theme>

A StateFlow that emits the current theme whenever it changes.

Functions

Link copied to clipboard
open suspend override fun updateTheme(theme: Theme)

Updates the current theme to the specified value.