avdPictureStringDecoder method
Future<PictureInfo>
avdPictureStringDecoder(
- String raw,
- bool allowDrawingOutsideOfViewBox,
- ColorFilter? colorFilter,
- String key,
Decodes an Android Vector Drawable from a String to a PictureInfo object.
Implementation
Future<PictureInfo> avdPictureStringDecoder(
String raw,
bool allowDrawingOutsideOfViewBox,
ColorFilter? colorFilter,
String key,
) async {
final DrawableRoot avdRoot = fromAvdString(raw, key);
final Picture pic = avdRoot.toPicture(
clipToViewBox: allowDrawingOutsideOfViewBox == true ? false : true,
colorFilter: colorFilter,
);
return PictureInfo(
picture: pic,
viewport: avdRoot.viewport.viewBoxRect,
size: avdRoot.viewport.size,
compatibilityTester: const CacheCompatibilityTester(),
);
}