颤抖地单击抽屉小部件时如何增加底部导航栏的高度?

时间:2020-08-20 09:55:10

标签: flutter dart

我想实现底部的导航栏,以便当您单击抽屉图标时其高度会增加。此后,我隐含了一些应显示更多选项以查看其他图标。我找不到合适的插件在pub.dev中。我已经包含了有关我想要的视频以及到目前为止我尝试过的代码的视频

视频链接:https://youtu.be/dTaV2HawHk4

  class _LiveTvHomePageState extends State<LiveTvHomePage> {
      
      GlobalKey<ScaffoldState> _drawerKey = GlobalKey<ScaffoldState>();
      int _selectedIndex = 0;

       void _onItemTapped(int index) {
        index == 4
            ? _drawerKey.currentState.openDrawer()
            : setState((){
          _selectedIndex = index;
    
        });
      }

 @override
  Widget build(BuildContext context) {
    List<Widget> wdgs_option = [
      HomePageForBottomNavigator(),
      MoviesPageForBottomNavigator(),
      TvSHowsPageForBottomNavigator(),
      NewsForBottomNavigator(),];
      return Scaffold(
      key: _drawerKey,
     bottomNavigationBar: BottomNavigationBar(

        backgroundColor: Colors.black,

        showUnselectedLabels: true,

        currentIndex: _selectedIndex,
        fixedColor: Colors.amber[800],


        onTap: _onItemTapped,
        items: const <BottomNavigationBarItem>[

          BottomNavigationBarItem(
            backgroundColor: Colors.black,
            icon: Icon(Icons.home),
            title: Text('Home'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.video_call),
            title: Text(
              'Movies',

            ),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.live_tv),
            title: Text(
              'Tv shows',

            ),
          ),

          BottomNavigationBarItem(
            icon: Icon(Icons.music_video),
            title: Text(
              'Music',

            ),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.dehaze),
            title: Text(
              'More',

            ),
          ),


        ],

      ),

0 个答案:

没有答案