restoreScreen

inline fun <T : Screen> CircuitSaver.restoreScreen(saved: Any, onAbsent: () -> Unit = {}, onTypeMismatch: (CircuitSaveable) -> Unit = { error("Expected ${T::class}, but CircuitSaver restored ${it::class}.") }): T?(source)

Restores saved as a T.

If this saver returns null, onAbsent is invoked and this returns null. If it restores a CircuitSaveable that is not a T, onTypeMismatch is invoked and this returns null if the callback completes normally. By default, onAbsent does nothing and onTypeMismatch throws.