容器上的颤动叠加圆

问题描述 投票:0回答:2

正在尝试实施此设计

enter image description here

我尝试放入另一个容器,但结果不同。enter image description here这是代码

        child: Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: <Widget>[
        SizedBox(height: 10),
        Container(
          padding: EdgeInsets.all(20),
          width: ScreenUtil().setWidth(800),
          height: ScreenUtil().setHeight(600),
          decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(30.0),
              boxShadow: [
                BoxShadow(
                    color: Color(0xFF6078ea).withOpacity(.3),
                    offset: Offset(0.0, 4.0),
                    blurRadius: 4.0)
              ]),
          child: Column(
            children: <Widget>[
              Text(
                'Login',
                textAlign: TextAlign.center,
                style: TextStyle(fontWeight: FontWeight.bold),
                textScaleFactor: 2,
              ),
            ],
          ),
        ),
        Container(
            child: SizedBox(
              height: 100,
              width: 100,
            ),
            decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(180.0),
                boxShadow: [
                  BoxShadow(
                      color: Color(0xFF6078ea).withOpacity(.3),
                      offset: Offset(0.0, 4.0),
                      blurRadius: 4.0)
                ])),
      ],
    ),

这就是我正在考虑实现此设计的想法。有没有更好的方法呢?

flutter flutter-layout
2个回答
2
投票

您需要使用ClipPath小部件来获得该形状。创建自己的类以获取自定义形状。

这里是您入门的链接Custom ClipPath Example您只需要了解设备上的x和y轴Check this for more details


0
投票

使用Stack覆盖圆圈按钮。

© www.soinside.com 2019 - 2024. All rights reserved.