pop

actual fun pop(upToRoute: String?): Result<Unit>
expect fun pop(upToRoute: String? = null): Result<Unit>

Pops back to previous screen route on the routes stack.

Return

Result.success if screen was popped successfully or Result.failure with an error:

IllegalArgumentException if there is no upToRoute on the stack or upToRoute is the last route on the stack.

IllegalStateException if it's about to pop last route on the routes stack.

When there was an error, error screens do not change on the stack.

Parameters

upToRoute

if provided optionally pops multiple routes up to given upToRoute.

actual fun pop(upToRoute: String?): Result<Unit>