我怎样才能在颤振中添加这种消失的阴影或小插图

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

我一直在尝试在颤振中实现这种消失的阴影或晕影效果,但我不能使用投影,但它不会像这样出现。

我的尝试:

BoxDecoration(
       gradient:LinearGradient(colors: [Colors.black26, Colors.black])),
flutter dart user-interface flutter-dependencies
1个回答
0
投票

您可以使用以下两个选项:

  • 线性渐变颜色
  • 盒子阴影

结果如下,图像包含超过 1k 个单词:

我认为,线性渐变就可以了,但要小心,如果你打算在容器上方放置一些具有 LG 颜色的小部件,它们会受到影响。

所以,我建议使用 LG,但用堆栈包裹它,将按钮放在 LG 容器上,而不影响按钮的颜色。

结构:

Stack->
   Container(LG)
   Row(White Buttons) // they will not be affected by the color of the container 

希望对您有帮助。

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