focus method

void focus(
  1. int? index
)

Implementation

void focus(int? index) {
  if (_length == 0) return;
  int newIndex;
  if (loop) {
    newIndex = index! % _length;
  } else {
    newIndex = index!.clamp(0, _length - 1);
  }
  _children[newIndex].focus();
  setTabbable(newIndex);
}