java.lang.Object
no.ntnu.principes.event.PrincipesEvent<NavigateEvent.NavigationPayload>
no.ntnu.principes.event.navigation.NavigateEvent
Represents a navigation event used for managing route transitions within an application.
It encapsulates a payload describing the type of navigation action, the target route,
and any additional parameters required for the navigation.
This class allows the creation of events to either push a new route, replace the current route, or navigate back (pop).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents the payload for a navigation event, providing details about the navigation action, target route, and optional parameters for the navigation.static enumDefines the types of navigation actions available within the application. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aNavigateEventwith the specified navigation payload. -
Method Summary
Modifier and TypeMethodDescriptionstatic NavigateEventpop()Creates a navigation event for navigating back by removing the last route from the navigation stack.static NavigateEventCreates a navigation event for navigating back to the specified route by removing the route from the navigation stack.static NavigateEventCreates a navigation event for navigating to the specified route by adding it to the navigation stack.static NavigateEventCreates a navigation event to replace the current route with the specified route.
-
Constructor Details
-
Method Details
-
push
Creates a navigation event for navigating to the specified route by adding it to the navigation stack.- Parameters:
route- the target path or identifier of the route to be navigated to- Returns:
- a
NavigateEventrepresenting a PUSH navigation event with the specified route
-
replace
Creates a navigation event to replace the current route with the specified route. This operation replaces the top of the navigation stack without adding a new entry.- Parameters:
route- the target path or identifier of the route to navigate to- Returns:
- a
NavigateEventrepresenting a REPLACE event with the specified route
-
pop
Creates a navigation event for navigating back by removing the last route from the navigation stack.- Returns:
- a
NavigateEventrepresenting a POP navigation event.
-
pop
Creates a navigation event for navigating back to the specified route by removing the route from the navigation stack.- Parameters:
route- the target path or identifier of the route to navigate back to- Returns:
- a
NavigateEventrepresenting a POP navigation event with the specified route
-