It returns the current index of the page.
int get currentIndex => _index;
set currentIndex(int newIndex) => _index = newIndex;