'How to change tab on button click from another tab in Flutter App

After the form was filled, the tab did not change and it was expected to automatically switch back to the home page.



Solution 1:[1]

Did you use setState? Changing a variable does not cause a rebuild. SetState needs to be called in order to have your StatefulWidget's build method re-run, with the changed variables taken into account.

https://api.flutter.dev/flutter/widgets/State/setState.html

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Inf0rmatix