如果购物车是空的,则隐藏底部导航栏

时间:2019-10-31 07:51:23

标签: flutter bottomnavigationview flutter-widget

我将产品添加到购物车并在底部导航栏中显示总金额,如果购物车为空,我想在同一页面中显示另一个屏幕,即

enter image description here

如果购物车不为空,我想显示

enter image description here

    body: _getitemCon.get_cart_item == null
          ?
      Center(
              child:_canShowButton?emptycart(): SizedBox(),
            )
          : new ListView(),
bottomNavigationBar: Container()

这就是我试图在同一页面上显示屏幕的方式

1 个答案:

答案 0 :(得分:0)

您可以将# Ofcourse, I know you are working on MacOS, the value for Linux is just a sample. import os os.environ["PYSPARK_PYTHON"]="<the path of Python 3.5 runtime, such as /usr/bin/python3.5 on Linux>" bottomNavigationBar小部件一起包装,如下所示:

Visibility

然后,在您的情况下显示bottomNavigationBar: Visibility(visible: condition, child: Container()) 的条件似乎是bottomNavigationBar。只要确保在更新条件时致电_getitemCon.get_cart_item != null

相关问题