ModalContext

@Serializable
data class ModalContext(val modalEntry: NavigationEntry, val originalUnderlyingScreenEntry: NavigationEntry, val navigatedAwayToRoute: String? = null)(source)

Tracks the relationship between a modal and the screen it was opened on top of.

Created automatically by the navigation system when a Modal is pushed onto the back stack. It ensures that the correct underlying screen is rendered behind the modal, and that navigation from within a modal (e.g. navigating to a new screen) is handled correctly.

Constructors

Link copied to clipboard
constructor(modalEntry: NavigationEntry, originalUnderlyingScreenEntry: NavigationEntry, navigatedAwayToRoute: String? = null)

Properties

Link copied to clipboard

The NavigationEntry for the modal itself.

Link copied to clipboard

If the user navigated to a new screen from inside the modal, this holds that screen's route so it can be restored on back-press.

Link copied to clipboard

The screen that was active when the modal was opened; rendered behind the modal while it is visible.