Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.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
Flutter 在底部导航栏的顶部添加分隔符?_Flutter_User Interface_Dart - Fatal编程技术网

Flutter 在底部导航栏的顶部添加分隔符?

Flutter 在底部导航栏的顶部添加分隔符?,flutter,user-interface,dart,Flutter,User Interface,Dart,有没有办法在BottomNavigationBar()的顶部添加这样的分隔符?我为AppBar()获得了它,如下所示: appBar: AppBar( elevation: 0, title: Text( _views[_index]['title'], ), bottom: PreferredSize( preferredSize: Size.fromHeight(10),

有没有办法在
BottomNavigationBar()
的顶部添加这样的分隔符?我为
AppBar()
获得了它,如下所示:

appBar: AppBar(
        elevation: 0,
        title: Text(
          _views[_index]['title'],
        ),
        bottom: PreferredSize(
          preferredSize: Size.fromHeight(10),
          child: Divider(
            thickness: 2,
            height: 0,
          ),
        ),
      ),

但是我想知道是否有一种方法可以对
BottomNavigationBar()
执行同样的操作

最后应该是这样的:


AppBar
具有
前导属性

使用
PreferredSize
小部件中的彩色容器作为
AppBar
小部件的顶部

AppBar(
  title: Text("Title"),
  leading: PreferredSize(
    child: Container(color: colors.Black, height: 5.0),
    preferredSize: Size.fromHeight(5.0),
  ),
),

我就是这样解决的:

body: Column(
        children: [
          _views[_index]['view'],
          Spacer(),
          Divider(
            thickness: 2,
          ),
        ],
      ),

我刚刚在
Scaffold()
的实际内容下的
body
属性中添加了一个
Divider()
,并用
Spacer()
将其向下推,您可以在Scaffold body内容的开头使用
Divider()
小部件。是的,我在应用程序栏中这样解决了它,但如何在底部导航栏中执行相同操作?@devAcronym使用leading属性