opacity property

Animation<double>? opacity
final

If non-null, the value from the Animation is multiplied with the opacity of each vector graphic pixel before painting onto the canvas.

This is more efficient than using FadeTransition to change the opacity of an image, since this avoids creating a new composited layer. Composited layers may double memory usage as the image is painted onto an offscreen render target.

This value does not apply to the widgets created by a placeholderBuilder.

To provide a fixed opacity value, or to convert from a callback based API that does not use animation objects, consider using an AlwaysStoppedAnimation.

Example:

VectorGraphic(loader: _assetLoader, opacity: const AlwaysStoppedAnimation(0.33));

Implementation

final Animation<double>? opacity;