Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Image.asset opacity using opacity parameter in Image widget

I have a simple image that I want to put semi transparent. I have seen some methods to do it, but none of them was talking about the parameter opacity of the own Image.asset that accepts a widget of type Animation. Is it possible to change the opacity permanently with this parameter?

Image.asset(
  "assets/images/triangles_small.png",
  height: 380,
),

enter image description here

like image 741
JAgüero Avatar asked Nov 25 '25 11:11

JAgüero


1 Answers

Actually, the question point is using opacity on Image.asset. You can use AlwaysStoppedAnimation.

Image.asset(
  "image/link",
  opacity: const AlwaysStoppedAnimation(.5),

To have animation, you can pass animation here.

like image 120
Yeasin Sheikh Avatar answered Nov 27 '25 00:11

Yeasin Sheikh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!