Mohit
03/07/2025, 8:29 AMStefan Oltmann
03/07/2025, 8:57 AMMohit
03/07/2025, 8:58 AMStefan Oltmann
03/07/2025, 8:59 AMStefan Oltmann
03/07/2025, 9:00 AMMohit
03/07/2025, 9:00 AMMohit
03/07/2025, 9:00 AMStefan Oltmann
03/07/2025, 9:01 AMStefan Oltmann
03/07/2025, 9:02 AMMohit
03/07/2025, 9:04 AMStefan Oltmann
03/07/2025, 9:06 AMMohit
03/07/2025, 9:11 AMJoel Denke
03/08/2025, 7:13 AMMohit
03/08/2025, 7:22 AMStefan Oltmann
03/08/2025, 5:02 PMMohit
03/10/2025, 4:23 AMabstract class PreferenceState<T>(
private val key: Preferences.Key<T>,
private val defaultValue: T,
private val dataStore: DataStore<Preferences> = _dataStore
) : MutableState<T> {
private val _state = mutableStateOf(defaultValue)
}
It is using mutableState. This is required so that I can directly use it like this in UI
var randomString by rememberStringPreferenceState("randomString", "Hello World")
to edit
randomString = UUID.randomUUID().toString()
Basically you can directly assign the value to var and it will be written in datastore.
But the problem with KMP is that "mutableState" is not available there and instead I will have to use mutableStateFlow which works in a slightly different way. So using that would not make writing the var so easy.
It would be great if you guys can also contribute to make it compatible with KMPkpgalligan
03/13/2025, 5:25 AMMohit
03/21/2025, 4:43 AMmohamed rejeb
04/03/2025, 9:54 AMMohit
04/03/2025, 9:56 AM