【发布时间】:2022-12-12 12:41:55
【问题描述】:
我想让 BottomNavBar 在我的应用程序中始终保持打开状态。 当我编译我的代码时,我得到这个错误: RenderBox 未布局:RenderIgnorePointer#59187 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE DETACHED
我正在尝试通过以下方式进行操作:
bottomNavigationBar: CupertinoTabScaffold(
tabBar: CupertinoTabBar(
iconSize: 30,
currentIndex: currentIndex,
onTap: (index) => setState(() => currentIndex = index),
items: [
BottomNavigationBarItem(icon: Icon(Icons.home, size: 25)),
BottomNavigationBarItem(
icon: Icon(
Icons.store,
size: 25,
)),
BottomNavigationBarItem(
icon: Icon(Icons.shopping_bag, size: 25)),
BottomNavigationBarItem(icon: Icon(Icons.person, size: 25)),
],
),
tabBuilder: (BuildContext context, int index) {
return CupertinoTabView(
builder: (BuildContext context) {
return SafeArea(
top: false,
bottom: false,
child: MaterialApp(
home: CupertinoPageScaffold(
resizeToAvoidBottomInset: false,
child: MainScreen(
currentIndex: currentIndex,
),
),
),
);
},
);
}));
请告诉我如何让它工作,这样做有多正确?
【问题讨论】:
标签: flutter dart bottomnavigationview