SaveableBackStack

Constructors

Link copied to clipboard
constructor(initialRecord: SaveableBackStack.Record)
constructor(root: Screen)

Types

Link copied to clipboard
data class Record(val screen: Screen, val args: Map<String, Any?> = emptyMap(), val key: String = uuid4().toString()) : BackStack.Record

Properties

Link copied to clipboard

true if the BackStack contains exactly one record.

Link copied to clipboard

true if the BackStack contains no records. BackStack.firstOrNull will return null.

Link copied to clipboard
open override val size: Int

The number of records contained in this BackStack that will be seen by an iterator.

Link copied to clipboard

The top-most record in the BackStack, or null if the BackStack is empty.

Functions

Link copied to clipboard
open override fun containsRecord(record: SaveableBackStack.Record, includeSaved: Boolean): Boolean

Whether the back stack contains the given record.

Link copied to clipboard
open operator override fun iterator(): Iterator<SaveableBackStack.Record>
Link copied to clipboard
open override fun pop(result: PopResult?): SaveableBackStack.Record?

Attempt to pop the top item off of the back stack, returning the popped Record if popping was successful or null if no entry was popped.

Link copied to clipboard
open fun popUntil(predicate: (SaveableBackStack.Record) -> Boolean): ImmutableList<SaveableBackStack.Record>

Pop records off the top of the backstack until one is found that matches the given predicate.

Link copied to clipboard
open override fun push(record: SaveableBackStack.Record, resultKey: String?)

Push a new Record onto the back stack. The new record will become the top of the stack.

open override fun push(screen: Screen, resultKey: String?)

Push a new Screen onto the back stack. This will be enveloped in a Record and the new record will become the top of the stack.

fun push(screen: Screen, args: Map<String, Any?>, resultKey: String?)
Link copied to clipboard
open override fun restoreState(screen: Screen): Boolean

Restores the saved state with the given screen, adding it on top of the existing entry list. If you wish to replace the current entry list, you should pop all of the existing entries off before calling this function.

Link copied to clipboard
open override fun saveState()

Saves the current back stack entry list in an internal state store. It can be later restored by the root screen to restoreState.