Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 底部导航栏透明背景_Dart_Flutter - Fatal编程技术网

Dart 底部导航栏透明背景

Dart 底部导航栏透明背景,dart,flutter,Dart,Flutter,我正在尝试构建一个没有透明背景的BottomNavigationBar,到目前为止,这就是我所做的,但是我仍然有阴影,也应该删除这些阴影: return Scaffold( body: body, bottomNavigationBar: Theme( data: Theme.of(context).copyWith( canvasColor: Colors.transparent, primaryColor: Colors.white,

我正在尝试构建一个没有透明背景的BottomNavigationBar,到目前为止,这就是我所做的,但是我仍然有阴影,也应该删除这些阴影:

return Scaffold(
  body: body,
  bottomNavigationBar: Theme(
    data: Theme.of(context).copyWith(
        canvasColor: Colors.transparent,
        primaryColor: Colors.white,
        textTheme: Theme
            .of(context)
            .textTheme
            .copyWith(caption: TextStyle(color: Colors.deepOrange))),
    child: BottomNavigationBar(
      type: BottomNavigationBarType.fixed,
      currentIndex: 0,
      items: [
        BottomNavigationBarItem(
          icon: Icon(Icons.home),
          title: Text("Home"),
        ),
        BottomNavigationBarItem(
          icon: Icon(Icons.map),
          title: Text("Map"),
        )
      ],
    ),
  ),
);

因为我认为如果你使用透明的背景,那么图标将不是很清晰, 或者,您可以像这样使用自定义小部件。 这可能对你有帮助

return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: new Container(
        child: new Stack(children: <Widget>[
          new Container(
            color: Colors.lightGreen,
            child: new Center(
              child: new Text('Hello'),
            ),
          ),
          new Align(alignment: Alignment.bottomCenter,child: new Container(
            height: 100.0,
            child: new Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
              new Icon(Icons.home),
                new Icon(Icons.map)
            ],),
          ),)
        ],),
      ),
    );

声音similar@GünterZöchbauer说,答案仍然会产生模糊效果,而不是完全透明的底部导航条