colorFilter property
If provided, a color filter to apply to the vector graphic when painting.
For example, ColorFilter.mode(Colors.red, BlendMode.srcIn)
to give the vector
graphic a solid red color.
This is more efficient than using a ColorFiltered widget to wrap the vector graphic, since this avoids creating a new composited layer. Composited layers may double memory usage as the image is painted onto an offscreen render target.
Example:
VectorGraphic(loader: _assetLoader, colorFilter: ColorFilter.mode(Colors.red, BlendMode.srcIn));
Implementation
final ColorFilter? colorFilter;