The PushView
action opens a new screen on the same stack as the current screen.
The structure of PushView
is:
Attribute | Type | Required | Definition |
---|---|---|---|
route | Route | ✓ | Navigation route (endpoint that returns the new screen). |
navigationContext | NavigationContext | Context to be saved on the target screen. |
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.
Route
property works. It receives the endpoint of a new screen or server driven component. When this is done, a JSON with the screen or component is obtained as a response. This information is handled by the route attribute. Therefore, it is also possible to list a component directly in the route (which was done in the example below), so, instead of fetching the information from the screen (or component) in the endpoint, it gets it directly from the code implemented in the route.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")
)
)
)
)
)
)
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.