Pref Delegate
class PrefDelegate<T>(prefs: SharedPreferences, key: String, defaultValue: T) : ReadWriteProperty<Any?, T>
A generic ReadWriteProperty delegate that provides concise, type-safe access to SharedPreferences.
Parameters
prefs
The SharedPreferences instance to back the property.
key
The key used to store and retrieve the value.
default Value
The default value to return if no value is found.
Throws
if the type is not supported.