0

我正面临下一个问题。我想在我的抽屉中添加比在我的bottomAppBar中更多的页面,所以问题基本上在于发生的错误,因为我的应用程序栏正在onPageChanged中设置底部应用程序栏中的当前页面(不存在),我有用这个修复它

onPageChanged: (page) {
          setState(() {
            if(page < 5) currentIndex = page;   // This line helped me to prevent error
            else currentIndex = 0;
          ...
          });
         },

所以,我想要做的是让这个选项卡与 bottomAppBar 选项卡分开,但现在在最后一个底部栏选项卡之后,我可以滚动到这些选项卡。

抽屉 底部应用栏

另外,当我在抽屉页面上时,我想禁用所有底部按钮,因为当我进入抽屉页面时,我的“主页”按钮处于活动else currentIndex = 0;状态

        child: BottomNavigationBar(
          currentIndex: currentIndex,
          type: BottomNavigationBarType.fixed,
          selectedFontSize: 12,
          unselectedFontSize: 12,
          selectedItemColor: Color(0xff8c84e2),
4

0 回答 0