next method

void next()

Moves focus to the next focusable widget.

If a trap is active, only navigates within the trapped subtree.

Implementation

void next() {
  final candidates = _getVisibleCandidates();
  if (candidates.isEmpty) return;

  final index = _focusedId == null ? -1 : candidates.indexOf(_focusedId!);
  final nextIndex = (index + 1) % candidates.length;
  requestFocus(candidates[nextIndex]);
}