avdPictureDecoder method

Future<PictureInfo> avdPictureDecoder(
  1. Uint8List raw,
  2. bool allowDrawingOutsideOfViewBox,
  3. ColorFilter? colorFilter,
  4. String key,
)

Decodes an Android Vector Drawable from a Uint8List to a PictureInfo object.

Implementation

Future<PictureInfo> avdPictureDecoder(
    Uint8List raw,
    bool allowDrawingOutsideOfViewBox,
    ColorFilter? colorFilter,
    String key) async {
  final DrawableRoot avdRoot = await fromAvdBytes(raw, key);
  final Picture pic = avdRoot.toPicture(
      clipToViewBox: allowDrawingOutsideOfViewBox == true ? false : true,
      colorFilter: colorFilter);
  return PictureInfo(picture: pic, viewport: avdRoot.viewport.viewBoxRect);
}