mapSaver

Function

Common
public fun <T> mapSaver(
    save: SaverScope.(value: T) -> Map<String, Any?>,
    restore: (Map<String, Any?>) -> T?,
): Saver<T, Any>

The Saver implementation which allows to represent your class as a map of values which can be saved individually.

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.