Function

listSaver

The Saver implementation which allows to represent your Original class as a list of Saveable values.

ListSaverSample

@Composable
fun ListSaverSample() {
    data class Size(val x: Int, val y: Int)
    val sizeSaver =
        listSaver<Size, Int>(save = { listOf(it.x, it.y) }, restore = { Size(it[0], it[1]) })
}

Last updated: