代码之家  ›  专栏  ›  技术社区  ›  chichi

颤振:设置底部AppBar()的边缘颜色

  •  -1
  • chichi  · 技术社区  · 3 年前

    我有一个 BottomAppBar() 小装置

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

    How do I change Bottom App Bar Items Color?

    我试着给孩子定颜色 Container() . 但是,它会绘制一条直线,而不会在顶点处出现凹凸 FloatingAppButton() . 我有什么办法可以做到这一点吗?

    1 回复  |  直到 3 年前
        1
  •  1
  •   Jahidul Islam    3 年前

    你想这样做,请检查下面的代码

    enter image description here

    源代码

    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(
            ),
          )