如何在Flutter中的底部导航栏之间添加边距

时间:2020-01-12 05:15:49

标签: flutter

我想为底部导航栏项设置位置或边距,我的代码在这里:

 Scaffold(
  floatingActionButtonLocation:
  FloatingActionButtonLocation.centerDocked,
  floatingActionButton: FloatingActionButton(backgroundColor: Colors.amber,
    child: const Icon(Icons.shopping_cart,), onPressed: () {},),
  bottomNavigationBar: BottomAppBar(
    shape: CircularNotchedRectangle(),
    notchMargin: 10.0,
    child: BottomNavigationBar(
      type: BottomNavigationBarType.fixed,
      items: [
        new BottomNavigationBarItem(
          icon: new Icon(Icons.home),
          title: new Text("Home"),
        ),
        new BottomNavigationBarItem(
          icon: new Icon(Icons.star),
          title: new Text("Resurants"),
        ),
        new BottomNavigationBarItem(
          icon: new Icon(Icons.location_on),
          title: new Text("Account"),
        ),
        new BottomNavigationBarItem(
          icon: new Icon(Icons.person),
          title: new Text("More"),
        ),
      ],
    ),
  ),

结果在图像中 enter image description here

如何使底部元素具有边距?

0 个答案:

没有答案