BottomNavigationBar currentIndex在CustomScaffold中不起作用

时间:2020-06-26 21:12:37

标签: flutter

我使用 custom_navigator 插件。一切正常,但是当我在BottomNavigationBar中使用currentIndex时出现问题,则它不起作用。

CustomScaffold(
    scaffold: Scaffold(
      bottomNavigationBar: BottomNavigationBar(
        items: _items,
        onTap: (index) {
        
          navigatorKey.currentState.maybePop();
          setState(() {
            _currentIndex = index;
          });
        },
        currentIndex: _currentIndex,
      ),
    ),
    children: <Widget>[
      HomeMenu(),
      SettingMenu(),
      NotificationMenu(),
      HelpMenu()
    ],
  ),

0 个答案:

没有答案