public class Navigator extends StatefulWidget
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 Details

    • initialRoute

      @NotNull private final @NotNull String initialRoute
    • routes

      @NotNull private final @NotNull Map<String,RouteBuilder> 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 name
      routes - the route table
  • Method Details

    • createState

      public State<Navigator> createState()
      Description copied from class: StatefulWidget
      Creates 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:
      createState in class StatefulWidget
      Returns:
      the new State instance
    • getInitialRoute

      @NotNull public @NotNull String getInitialRoute()
    • getRoutes

      @NotNull public @NotNull Map<String,RouteBuilder> getRoutes()
    • of

      @Nullable public static @Nullable NavigatorState of(@NotNull @NotNull BuildContext context)
      Gets the nearest NavigatorState.
      Parameters:
      context - the BuildContext
      Returns:
      the NavigatorState, or null if none is found