serializationSaver
@ExperimentalSerializationApi
Create an Saver for Kotlin Serialization.
Usage:
@Serializable
data class FormData(
val firstName: String = "",
val lastName: String = "",
val email: String = "",
val mobileNumber: String = "",
val title: Title? = null,
val developer: Boolean? = null
)
enum class Title {
Mr,
Mrs,
Miss,
Dr,
}
Form(
onSubmit = { .. },
initialValue = FormData(),
modifier = modifier,
saver = serializationSaver()
) { .. }
Content copied to clipboard
Return
The Saver for the value.
Parameters
T
The type of the value to save and restore.
serializer
The serializer to use for the value.
bundler
The bundler to encode and decode the value. Default is Bundler.