ResetApplication

Here you’ll find ResetApplication description and its attribute.

What is it?

What is it? Opens a screen with an informed route and deletes all the navigation piles.

Your structure is represented by the attribute below:

AttributeTypeRequiredDefinition
routeRouteNavigation route.
controllerIdStringThe navigation controller id to be used during the navigation action, If missing, the default navigation controller will be used instead.

How to use it?

On the example below, three screens were used. The two first used PushView to add the screens to the piles and the last one uses ResetApplication and reopens the first screen.

You will need three endpoints to test:

  1. The first endpoint will be what your frontend will call to render the screen zero.
  2. The second endpoint must be mapped as "/firstScreen", because this will be the chose URL to the screen 0 button’s navigation, and it must return to the screen 1.
  3. The third endpoint must be mapped as "/secondScreen", because this will be the chosen URL to the screen 1 button’s navigation, and it must return to the screen 2. On the screen 2 the passed route must be the screen’s endpoint that you want to return when the application starts. In this case, "/home" is the screen’s 0 endpoint.

How to call the screen zero

Screen(
    child = Container(
        children = listOf(
            Text(
                "First Screen on Stack"
            ),
            Button(
                text = "Click me!",
                onPress = listOf(
                    Navigate.PushView(
                        Route.Remote(
                            url = "secondScreenonStack.json"
                        )
                    )
                )
            )
        )
    )
)

How to call the screen 1

Screen(
    child = Container(
        children = listOf(
            Text(
                "Second Screen on Stack"
            ),
            Button(
                text = "Click me!",
                onPress = listOf(
                    Navigate.PushView(
                        Route.Remote(
                            url = "resetApplication.json"
                        )
                    )
                )
            )
        )
    )
)

How to call the screen 2

Screen(
    child = Container(
        children = listOf(
            Text(
                "Third Screen on Stack"
            ),
            Button(
                text = "Click me  to reset application",
                onPress = listOf(
                    Navigate.ResetApplication(
                        route = Route.Remote("firstScreenonStack.json")
                    )
                )
            )
        )
    )
)