How to change the current tab in tab bar view using a button in Flutter?

Posted by Rohit Kumar | Updated on

Want to change the current tab in tab bar view using a button in Flutter? You need to get the TabBar controller and call its animateTo() method from the button onPressed() handle.

If you use a GlobalKey for the MyTabbedPageState you can get the controller from any place, so you can call the animateTo() from any button.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers