【问题标题】:I want to create a curve bottom appbar in flutter?我想在颤动中创建一个曲线底部的应用栏?
【发布时间】:2021-12-06 13:19:30
【问题描述】:

返回脚手架( 背景颜色:颜色.白色, 底部导航栏:底部应用栏( 孩子:容器( 身高:155, 孩子:中心(孩子:文本('Powered By')), 颜色:颜色。绿色, )) );

【问题讨论】:

  • 您可以通过 CustomPainter 小部件来实现这一点。

标签: flutter


【解决方案1】:

您可以使用以下代码创建一个弯曲的底部应用栏。

  return Scaffold(
      backgroundColor: Colors.white,
      bottomNavigationBar: BottomAppBar(
        child: Container(
          height: 155,
          child: Center(
            child: Container(
              margin: const EdgeInsets.only(top: 50),
              height: 100,
              width: 150,
              decoration: const BoxDecoration(
                borderRadius: BorderRadius.only(topLeft: Radius.circular(75), topRight: Radius.circular(75)),
                color: Colors.grey,
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: const [
                  Text("Powered By"),
                  Text("Logo Here"),
                ],
              ),
            ),
          ),
          color: Colors.green,
        ),
      ),
    );

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-29
    • 2021-10-13
    • 1970-01-01
    • 2013-06-07
    • 2020-08-20
    • 2022-06-14
    • 1970-01-01
    • 2021-12-29
    相关资源
    最近更新 更多