FonamentPreferences

A class that provides functions to set and get data from a DataStore<Preferences> instance.

Constructors

Link copied to clipboard
constructor(dataStore: DataStore<Preferences>)

Functions

Link copied to clipboard
fun getBoolean(key: String): Flow<Boolean?>

Retrieves a Flow containing the value from the data store preferences given its key, or null otherwise.

Link copied to clipboard
fun getBooleanOrDefault(key: String, default: Boolean): Flow<Boolean>

Retrieves a Flow containing the value from the data store preferences given its key, or default otherwise.

Link copied to clipboard
fun getByteArray(key: String): Flow<ByteArray?>

Retrieves a Flow containing the value from the data store preferences given its key, or null otherwise.

Link copied to clipboard
fun getByteArrayOrDefault(key: String, default: ByteArray): Flow<ByteArray>

Retrieves a Flow containing the value from the data store preferences given its key, or default otherwise.

Link copied to clipboard
fun getDouble(key: String): Flow<Double?>

Retrieves a Flow containing the value from the data store preferences given its key, or null otherwise.

Link copied to clipboard
fun getDoubleOrDefault(key: String, default: Double): Flow<Double>

Retrieves a Flow containing the value from the data store preferences given its key, or default otherwise.

Link copied to clipboard
fun getFloat(key: String): Flow<Float?>

Retrieves a Flow containing the value from the data store preferences given its key, or null otherwise.

Link copied to clipboard
fun getFloatOrDefault(key: String, default: Float): Flow<Float>

Retrieves a Flow containing the value from the data store preferences given its key, or default otherwise.

Link copied to clipboard
fun getInt(key: String): Flow<Int?>

Retrieves a Flow containing the value from the data store preferences given its key, or null otherwise.

Link copied to clipboard
fun getIntOrDefault(key: String, default: Int): Flow<Int>

Retrieves a Flow containing the value from the data store preferences given its key, or default otherwise.

Link copied to clipboard
fun getLong(key: String): Flow<Long?>

Retrieves a Flow containing the value from the data store preferences given its key, or null otherwise.

Link copied to clipboard
fun getLongOrDefault(key: String, default: Long): Flow<Long>

Retrieves a Flow containing the value from the data store preferences given its key, or default otherwise.

Link copied to clipboard
fun getString(key: String): Flow<String?>

Retrieves a Flow containing the value from the data store preferences given its key, or null otherwise.

Link copied to clipboard
fun getStringOrDefault(key: String, default: String): Flow<String>

Retrieves a Flow containing the value from the data store preferences given its key, or default otherwise.

Link copied to clipboard
fun getStringSet(key: String): Flow<Set<String>?>

Retrieves a Flow containing the value from the data store preferences given its key, or null otherwise.

Link copied to clipboard
fun getStringSetOrDefault(key: String, default: Set<String>): Flow<Set<String>>

Retrieves a Flow containing the value from the data store preferences given its key, or default otherwise.

Link copied to clipboard
suspend operator fun set(key: String, value: Boolean)

Sets a Boolean in the data store preferences.

suspend operator fun set(key: String, value: ByteArray)

Sets a ByteArray in the data store preferences.

suspend operator fun set(key: String, value: Double)

Sets a Double in the data store preferences.

suspend operator fun set(key: String, value: Float)

Sets a Float in the data store preferences.

suspend operator fun set(key: String, value: Int)

Sets an Int in the data store preferences.

suspend operator fun set(key: String, value: Long)

Sets a Long in the data store preferences.

suspend operator fun set(key: String, value: String)

Sets a String in the data store preferences.

suspend operator fun set(key: String, value: Set<String>)

Sets a Set<String>value in the data store preferences.