as Property
Encodes changes to the delegated property into the SharedPreferences and decodes the current value from them.
var setting by preferences.asProperty(Boolean.serializer())Parameters
which encodes and decodes the value
optional tag which is used as SharedPreferences key - default to property name
Encodes changes to the delegated property into the SharedPreferences and decodes the current value from them.
var setting by preferences.asProperty(Boolean.serializer(), tag = "aSetting", default = false)Parameters
which encodes and decodes the value
optional tag which is used as SharedPreferences key - default to property name
optional default value for not initialized preferences
Encodes changes to the delegated property into the SharedPreferences and decodes the current value from them.
var setting: Boolean by preferences.asProperty()Parameters
optional tag which is used as SharedPreferences key - default to property name
Encodes changes to the delegated property into the SharedPreferences and decodes the current value from them.
var setting: Boolean by preferences.asProperty(tag = "aSetting", default = false)Parameters
optional tag which is used as SharedPreferences key - default to property name
optional default value for not initialized preferences