持久导航栏不会刷新不同选项卡切换的屏幕,它应该在每个开关上重建小部件树,但它没有这样做 请帮助我....
Scaffold(
key: _key,
drawerEnableOpenDragGesture: true,
body: Builder(
builder: (context) {
return PersistentTabView(
navBarHeight: 60,
decoration: NavBarDecoration(
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2), // Shadow color
offset: const Offset(0, -3), // Changes position of shadow
blurRadius: 6, // Changes size of shadow
spreadRadius: 2, // Changes intensity of shadow
),
],
),
backgroundColor: Colors.white,
context,
screens: screens(),
items: navBarItems(),
controller: controller,
navBarStyle: NavBarStyle.style9,
popAllScreensOnTapOfSelectedTab: true,
stateManagement: false,
);
}
),
);
我试图在每次切换时进行重建,但它不起作用,它保持在原来的状态。我也尝试将 statemanagent 设置为 false,但它仍然相同..
在文档中有一个注释,不需要脚手架。您是否尝试过移除脚手架?
您能否提供有关您创建的小部件的更多背景信息?