toDeeply method

void toDeeply(
  1. String routeName, {
  2. Object? arguments,
  3. Map<String, String>? queryParams,
  4. bool fullscreenDialog = false,
  5. bool maintainState = true,
})

Deeply navigate to the given routeName. Deep navigation means that the root stack is cleaned and pages corresponding to sub paths are added to the stack.

Example: Suppose our navigator is :

 final myNavigator = RM.injectNavigator(
   routes: {
     '/': (RouteData data) => HomePage(),
     '/page1': (RouteData data) => Page1(),
     '/page1/page11': (RouteData data) => Page11(),
     '/page1/page11/page111': (RouteData data) => Page111(),
   },
 );

On app start up, the route stack is ['/'].

If we call myNavigator.to('/page1/page11/page111'), the route stack is ['/', '/page1/page11/page111'].

In contrast, if we invoke myNavigator.toDeeply('/page1/page11/page111'), the route stack is ['/', '/page1', '/page1/page11', '/page1/page11/page111'].

Implementation

void toDeeply(
  String routeName, {
  Object? arguments,
  Map<String, String>? queryParams,
  bool fullscreenDialog = false,
  bool maintainState = true,
}) {
  return _navigationBuilder.toDeeply(
    routeName,
    arguments: arguments,
    queryParams: queryParams,
    fullscreenDialog: fullscreenDialog,
    maintainState: maintainState,
  );
}