reset method

void reset({
  1. int initialIndex = 0,
  2. bool clearErrors = true,
})

Resets focus to initial state (first item, clears all errors).

Implementation

void reset({int initialIndex = 0, bool clearErrors = true}) {
  if (_itemCount == 0) {
    _focusedIndex = 0;
  } else {
    _focusedIndex = initialIndex.clamp(0, _itemCount - 1);
  }
  if (clearErrors) clearAllErrors();
}