PushView

PushView action details and its attributes

What is it?

The PushView action opens a new screen on the same stack as the current screen.

The structure of PushView is:

AttributeTypeRequiredDefinition
routeRouteNavigation route (endpoint that returns the new screen).
navigationContextNavigationContextContext to be saved on the target screen.

How to use?

In the example below, we have a screen with a button, which, when clicked, opens a new screen loaded from the endpoint specified in the PushView action.

To test it, just load the code screen below on the frontend.

Screen(
    child = Button(
        text = "Click me!",
        onPress = listOf(
            Navigate.PushView(
                Route.Local(
                    Screen(
                        child = Text("Hello second Screen")
                    )
                )
            )
        )
    )
)

Last modified March 7, 2022: fix: Update docs 2.0 (#858) (4368557d)