listSaver

Function

Common
public fun <Original, Saveable> listSaver(
    save: SaverScope.(value: Original) -> List<Saveable>,
    restore: (list: List<Saveable>) -> Original?,
): Saver<Original, Any>

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

What types can be saved is defined by SaveableStateRegistry, by default everything which can be stored in the Bundle class can be saved.

You can use it as a parameter for rememberSaveable.