Navigate

fun EventSchemaBuilderScope.Navigate(id: String = randomId(), trigger: EventTrigger, events: EventSchemaBuilderScope.() -> Unit = {}, destination: String, navigatorId: String, popUpTo: NavigateEventSchema.PopUpTo? = null, data: Map<String, AnySerializable>? = null)

Navigates the graph registered under navigatorId to destination, pushing it onto the back stack. The destination receives incomingData merged with data (with data winning on key collision) as its navigation data — only map-shaped incomingData contributes, and null values are dropped from both, since navigation arguments are never null. When popUpTo is set (built with poppingUpTo), entries are popped up to that destination before the new one is pushed. Dispatches onSuccess (no data) when the navigation was performed; onFailure (no data, logged) when no navigator is registered under navigatorId or it refused the navigation.

Parameters

id

Unique identifier of this event. Defaults to a random id.

trigger

Trigger that fires this event, built via EventTriggers.

events

Child events chained after this one, wired to its triggers (onSuccess, onFailure).

destination

Screen id to navigate to.

navigatorId

Id of the graph (Graph/NestedNavigationGraph) to navigate.

popUpTo

Back-stack entries to pop before pushing destination, built with poppingUpTo. Defaults to none.

data

Extra navigation data merged with incomingData, winning on key collision. Defaults to none.