avdPictureStringDecoder method

Future<PictureInfo> avdPictureStringDecoder(
  1. String raw,
  2. bool allowDrawingOutsideOfViewBox,
  3. ColorFilter? colorFilter,
  4. 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 avd = fromAvdString(raw, key);
  return PictureInfo(
    picture: avd.toPicture(
        clipToViewBox: allowDrawingOutsideOfViewBox == true ? false : true,
        colorFilter: colorFilter),
    viewport: avd.viewport.viewBoxRect,
    size: avd.viewport.size,
  );
}