颤抖的阴影看起来很丑

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

我的卡片装饰阴影看起来不像阴影,而更像是丑陋的边框。我不知道如何使它看起来像自然阴影。

代码:

var boxShadow = BoxDecoration(
      boxShadow: [
        BoxShadow(
          color: Colors.black12,
          spreadRadius: 0,
          blurRadius: 1,
          offset: Offset(3, 10), // changes position of shadow
        ),
      ],
    );

enter image description here

flutter dart flutter-layout
1个回答
0
投票

[尝试使用Material小部件代替Container,并使用其elevation属性代替阴影。

或者如果您想让我解释您的问题,请提供更多代码和更好的描述。最好是Github链接或整个构建功能。

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