reset method

void reset({
  1. int initialIndex = 0,
})

Resets navigation to initial state (first item, no scroll).

Implementation

void reset({int initialIndex = 0}) {
  if (_itemCount == 0) {
    _selectedIndex = 0;
    _scrollOffset = 0;
  } else {
    _selectedIndex = initialIndex.clamp(0, _itemCount - 1);
    _scrollOffset = 0;
    _adjustScroll();
  }
}