asStateFlow
fun <V> SharedPreferencesProperty<V>.asStateFlow(): ReadOnlyProperty<ISharedPreferencesOwner, SharedPreferencesStateFlow<V>>
Convert SharedPreferencesProperty to SharedPreferencesStateFlow.
object ThemeSp: ISharedPreferencesOwner {
.... // Code
val theme by boolean(false).asStateFlow()
}
// In Activity
val theme by boolean(false).asStateFlow()
Content copied to clipboard
Since
0.5.6