Skip to content

Instantly share code, notes, and snippets.

@afonsocraposo
Last active August 14, 2019 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afonsocraposo/98ae56fcd7ef4224c108b149e8a62fcf to your computer and use it in GitHub Desktop.
Save afonsocraposo/98ae56fcd7ef4224c108b149e8a62fcf to your computer and use it in GitHub Desktop.
_handleTabChange
// runs when the displayed tab changes
_handleTabChange() {
// if a button was tapped, change the current index
if (_buttonTap) _setCurrentIndex(_controller.index);
// this resets the button tap
if ((_controller.index == _prevControllerIndex) ||
(_controller.index == _aniValue.round())) _buttonTap = false;
// save the previous controller index
_prevControllerIndex = _controller.index;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment