如何设置渐变滤镜

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

图像列表的渐变过滤器 (https://i.stack.imgur.com/3Agi7.jpg)](https://i.stack.imgur.com/3Agi7.jpg)

我正在使用颤振。现在我面临一个问题,屏幕中显示的图像列表具有渐变过滤器。我只想在我的列表中实现可以放置在屏幕上的效果 我怎样才能用这个过滤器做到这一点?

flutter list gradient
1个回答
0
投票

如果我明白你的意思 您将照片包裹在柜台内 接下来使用属性 foregroundDecoration 并将该渐变放在您的照片上 像这样

Container(
height: size.height * 0.25,
width: double.infinity,
foregroundDecoration: BoxDecoration(
  gradient: LinearGradient(
  colors: [
    Colors.blue.withOpacity(0.5),
    Colors.white
  ]
)

), 装饰:BoxDecoration( 图像:装饰图像( 图片:AssetImage("assets/images/flowers-276014_640.jpg"), 适合:BoxFit.cover ) ) )

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