在 flutter 中,有没有一种方法可以在按下活动标签栏按钮时重建当前标签
In flutter is there a way to rebuild the current tab when the active tab bar button is pressed
在 TabBar
中,当按下不同的非活动 Tab
时,所有 Tab
似乎都在重建,但是当按下活动 Tab
时,没有任何反应.是否可以在按下活动 Tab
时让活动 Tab
重建?
您可以使用 TabBar
的 onTap
:
TabBar(
tabs: [...],
onTap: (index) {
},
)
在 TabBar
中,当按下不同的非活动 Tab
时,所有 Tab
似乎都在重建,但是当按下活动 Tab
时,没有任何反应.是否可以在按下活动 Tab
时让活动 Tab
重建?
您可以使用 TabBar
的 onTap
:
TabBar(
tabs: [...],
onTap: (index) {
},
)