Class Navigator
java.lang.Object
com.ultikits.ultitools.abstracts.gui.declarative.core.Widget
com.ultikits.ultitools.abstracts.gui.declarative.core.StatefulWidget
com.ultikits.ultitools.abstracts.gui.declarative.widgets.navigation.Navigator
The Navigator Widget.
Manages a route stack and builds a Widget from the current route.
Use of(BuildContext) to obtain the nearest navigator state and navigate.
- Since:
- 6.2.0
- Version:
- 1.0.0
- Author:
- UltiTools Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NotNull Stringprivate final @NotNull Map<String, RouteBuilder> -
Constructor Summary
ConstructorsConstructorDescriptionNavigator(@NotNull String initialRoute, @NotNull Map<String, RouteBuilder> routes) Creates a new Navigator. -
Method Summary
Modifier and TypeMethodDescriptionCreates the state object associated with this Widget.@NotNull String@NotNull Map<String, RouteBuilder> static @Nullable NavigatorStateof(@NotNull BuildContext context) Gets the nearest NavigatorState.Methods inherited from class com.ultikits.ultitools.abstracts.gui.declarative.core.StatefulWidget
createElement
-
Field Details
-
initialRoute
-
routes
-
-
Constructor Details
-
Navigator
public Navigator(@NotNull @NotNull String initialRoute, @NotNull @NotNull Map<String, RouteBuilder> routes) Creates a new Navigator.- Parameters:
initialRoute- the initial route nameroutes- the route table
-
-
Method Details
-
createState
Description copied from class:StatefulWidgetCreates the state object associated with this Widget.The framework calls this method the first time the Widget is inserted into the tree. The same State object is reused across Widget rebuilds.
- Specified by:
createStatein classStatefulWidget- Returns:
- the new State instance
-
getInitialRoute
-
getRoutes
-
of
Gets the nearest NavigatorState.- Parameters:
context- the BuildContext- Returns:
- the NavigatorState, or null if none is found
-