popAndPushNamed method

AFRouteState popAndPushNamed(
  1. AFRouteParam? param,
  2. List<AFRouteParam>? children,
  3. AFCreateDefaultChildParamDelegate? createDefaultChildParam
)

Removes the current leaf from the route, and adds the specified screen and data in its place.

Implementation

AFRouteState popAndPushNamed(AFRouteParam? param, List<AFRouteParam>? children, AFCreateDefaultChildParamDelegate? createDefaultChildParam) {
  assert(param != null);
  if(param != null) {
    final screen = param.screenId;
    AFibD.logRouteAF?.d("popAndPushNamed: $screen / $param");
    final revisedScreen = screenHierarchy.popAndPushNamed(screen, param, children, createDefaultChildParam);
    return _reviseScreen(revisedScreen);
  }
  return this;
}