doMiddlewareNavigation method

bool doMiddlewareNavigation(
  1. dynamic underHere(
    1. NavigatorState
    )
)

Implementation

bool doMiddlewareNavigation( Function(NavigatorState) underHere ) {
  navDepth++;
  AFibD.logUIAF?.d("enter navDepth: $navDepth");
  if(navDepth > 1) {
    throw AFException("Unexpected navigation depth greater than 1");
  }
  final navState = AFibF.g.navigatorKey.currentState;
  if(navState != null) {
    underHere(navState);
  }
  navDepth--;
  AFibD.logUIAF?.d("exit navDepth: $navDepth");

  if(navDepth < 0) {
    throw AFException("Unexpected navigation depth less than 0");
  }
  return navState != null;
}