在下图中,我在单击“底部导航栏”项目时添加了 showModalBottomSheet,但 BottomNavigationBar 被模式表隐藏,所以我想让它即使存在底部表也可见。任何人都可以请任何人帮助我吗?
这是我的底部导航代码:
Widget _bottomNavigationBar() {
return BottomNavigationBar(
type: BottomNavigationBarType.fixed,
key: scaffoldState,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.branding_watermark_outlined),
label: 'Brands',
),
BottomNavigationBarItem(
icon: Icon(Icons.category),
label: 'Category',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profile',
)
],
currentIndex: _selectedIndex,
selectedItemColor: AppColors.blue,
onTap: (newIndex) => {
if (newIndex == 1)
{showBrandsBottomSheet(context)}
else if (newIndex == 2)
{showCategoryBottomSheet(context)}
else
{
setState(() {
_selectedIndex = newIndex;
})
}
});
}
Run Code Online (Sandbox Code Playgroud)
这是我的底部模型表代码:
showBrandsBottomSheet(BuildContext context) {
return showModalBottomSheet<void>(
shape: const …Run Code Online (Sandbox Code Playgroud) flutter bottom-sheet bottomnavigationview flutter-showmodalbottomsheet