updateRouteStack static method

dynamic updateRouteStack(
  1. List<String> routes, {
  2. bool replace = true,
  3. bool deepLink = false,
  4. Map<String, dynamic>? dataForRoute,
})

Update the stack on the router. routes is a list of routes to navigate to. E.g. HomePage.path, SettingPage.path replace is a boolean that determines if the current route should be replaced. dataForRoute is a map of data to pass to the route. E.g. {HomePage.path: {"name": "John Doe"}} Example:

Nylo.updateStack([
 HomePage.path,
 SettingPage.path
 ], replace: true, dataForRoute: {
 HomePage.path: {"name": "John Doe"}
 });

This will navigate to the HomePage and SettingPage with the data passed to the HomePage.

Implementation

static updateRouteStack(List<String> routes,
    {bool replace = true,
    bool deepLink = false,
    Map<String, dynamic>? dataForRoute}) {
  if (deepLink == true) {
    routes.removeLast();
  }
  NyNavigator.updateStack(routes,
      replace: replace, dataForRoute: dataForRoute);
}