如何在滚动中的抖动中隐藏底部导航栏

时间:2020-04-15 18:36:51

标签: flutter flutter-layout flutter-listview flutter-widget flutter-bloc

我要在另一页中隐藏底部栏底部条在第1页中,并且要在滚动第2页之后将其隐藏

所以我有底部导航栏 上 page1.dart

Stack(
        children: <Widget>[
          IndexedStack(
            index: _currentIndex,
              children: _widgetOptions,
          ),
          Align(
            alignment: Alignment.bottomCenter,
            child: Container(
                margin: EdgeInsets.only(bottom: 30),
                height: 59,
                width: 80 / 100 * MediaQuery.of(context).size.width,
                /*decoration: BoxDecoration(
                    boxShadow: [
                      BoxShadow(
                        color: Colors.black54,
                        blurRadius: 10.0,
                      ),
                    ],
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(30),
                  ),*/
                child: Card(

                  elevation: 10,
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(30),
                  ),
                  child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                    children: <Widget>[
                      _buildItem(FeatherIcons.home, 0),
                      Stack(children: <Widget>[
                        _buildItem(FeatherIcons.bell, 1),
                        notification==0?SizedBox(height: 0,width: 0,):
                        Positioned(
                            top: -1.0,
                            right: -1.0,
                            child: new Stack(
                              children: <Widget>[
                                new Icon(
                                  Icons.brightness_1,
                                  size: 12.0,
                                  color: base,
                                ),
                              ],
                            ))
                      ]),
                      _buildItem(FeatherIcons.plusCircle, 2),


                      /*  Container(
                        width: 50,

                        child: RaisedButton(
                          elevation: 5,
                          child:Icon(FeatherIcons.plusCircle,color: Colors.white,),
                          onPressed: () {},
                          color: Colors.redAccent,
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(20),
                          ),
                        ),
                      ),*/
                      /*  Icon(
                          FeatherIcons.plusCircle,
                          color: Colors.red,
                          size: 30,
                        ),*/
                      _buildItem(FeatherIcons.messageSquare, 3),
                      _buildItem(FeatherIcons.user, 4),
                    ],
                  ),
                )),
          )
        ],
      ),
    ),
  ),

和_widgetOptions

List<Widget> _widgetOptions = <Widget>[
feed(),notific(),postpagee(),Text(
  'Index 2: School',
),
profilee()  ];

如何在滚动listview的另一页上隐藏上面代码中由容器构成的底部导航。 我看过其他例子,他们将所有代码都放在同一页面上以获得均匀的listview,但是当您的应用程序在同一页面上具有多个功能时就无法实现

0 个答案:

没有答案