resolveNavigateViewGroupTabIndex function

  1. @visibleForTesting
int resolveNavigateViewGroupTabIndex(
  1. int viewIndex,
  2. int menuLen
)

Resolves the tab index for NavigateViewGroupAction before PageController.jumpToPage. Clamps when the menu has items; otherwise preserves viewIndex (the PageGroup ancestor may not be mounted yet).

Implementation

@visibleForTesting
int resolveNavigateViewGroupTabIndex(int viewIndex, int menuLen) =>
    menuLen > 0 ? safeViewGroupPayloadIndex(viewIndex, menuLen) : viewIndex;