value
inline fun <T : Any> SavedStateHandle.value(key: String = "", default: T? = null, json: Json = Json, serializer: KSerializer<T> = serializer<T>()): StateValue<T>(source)
Creates a saved property for use in common code, with no ViewModel requirement.
key defaults to the delegated property name. Supply it explicitly when using StateValue.get, StateValue.set or StateValue.flow without a delegated property. default initializes an absent entry only; saved null stays null. Complex models require a generated or explicit serializer, using the supplied json. Access on the main thread. Encoding failures preserve the previous saved value.