简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM