cioccarellia / ksprefs

Kotlin SharedPreferences wrapper & cryptographic android library.
https://cioccarellia.github.io/ksprefs/
Apache License 2.0
228 stars 22 forks source link

Support for null default value? #35

Closed libern closed 3 years ago

libern commented 3 years ago
fun get(key: String, default: String?): String? {
      return prefs.pull(key, default)
}
libern commented 3 years ago

It seems not able to use null default value if there is no existing value

cioccarellia commented 3 years ago

That's intentional. ksprefs won't allow you to have null initialization values.

fun <T : Any> push(
        key: String,
        value: T
): Unit