【问题标题】:Flutter: Set edge color of the BottomAppBar()Flutter:设置 BottomAppBar() 的边缘颜色
【发布时间】:2021-12-04 16:10:44
【问题描述】:

我有一个BottomAppBar() 小部件

BottomAppBar(
      shape: CircularNotchedRectangle(),
      color: Colors.orange,
      notchMargin: 5,
      child:Container(),
    );

而且,我想设置不同的边缘颜色,就像这个问题的答案一样。

How do I change Bottom App Bar Items Color?

我试图设置孩子Container() 的颜色。但是,它会在FloatingAppButton() 处绘制一条没有凹凸的直线。有什么办法可以做到吗?

【问题讨论】:

    标签: flutter


    【解决方案1】:

    你想喜欢这个吗,请检查下面的代码

    源代码

    Scaffold(
            floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
            floatingActionButton: FloatingActionButton(
              child: Icon(Icons.add),
              backgroundColor: Colors.orange,
              onPressed: () {},
            ),
            bottomNavigationBar: BottomAppBar(
              shape: CircularNotchedRectangle(),
              notchMargin: 6,
              elevation: 30,
              child: new Row(
                mainAxisSize: MainAxisSize.max,
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  IconButton(icon: Icon(Icons.menu), onPressed: () {},),
                  IconButton(icon: Icon(Icons.search), onPressed: () {},),
                ],
              ),
            ),
            appBar: AppBar(
              titleSpacing: 0,
              title: Text("Test"),
              backgroundColor: const Color(0xffFA7343),
            ),
            body: Container(
            ),
          )
    

    【讨论】:

      猜你喜欢
      • 2013-09-16
      • 2019-03-08
      • 1970-01-01
      • 1970-01-01
      • 2011-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多