index property

int get index

The index of the currently selected tab.

When is set to a target index, the tab / page will animated from the current idex to the target index

Implementation

int get index {
  return snapState.state;
  // if (_tabController != null) {
  //   return _tabController!.index;
  // }
  // assert(_pageController != null);
  // if (_pageController!.positions.isNotEmpty) {
  //   return _page!;
  // }
  // return (this as InjectedTabImp).initialIndex;
}
set index (int i)

Implementation

set index(int i) {
  if (i == snapState.data) {
    return;
  }
  if (_tabController != null) {
    _tabController!.animateTo(
      i,
      duration: (this as InjectedPageTabImp).duration,
      curve: (this as InjectedPageTabImp).curve,
    );
  } else {
    assert(_pageController != null);
    _pageController!.animateToPage(
      i,
      duration: (this as InjectedPageTabImp).duration,
      curve: (this as InjectedPageTabImp).curve,
    );
  }
}