setActiveIndex method

void setActiveIndex(
  1. int index, {
  2. bool notify = true,
})

Implementation

void setActiveIndex(int index, {bool notify = true}) {
  assert(index >= 0 && index < _pages.length);
  if (_activeIndex != index) {
    _previousIndex = _activeIndex;
    _activeIndex = index;
    if (notify) {
      notifyAll();
    }
  }
}