fromAvdString static method
Parse an Android Vector Drawable XML string to a scalable image.
If compact
is true, the internal representation will occupy
significantly less memory, at the expense of rendering time. See
toDag for a discussion of the two representations.
If bigFloats
is true, the compact representation
will use 8 byte double-precision float values, rather than 4 byte
single-precision values.
If warnF
is non-null, it will be called if the AVD asset contains
unrecognized tags and/or tag attributes. If it is null, the default
behavior is to print warnings.
Implementation
static ScalableImage fromAvdString(
String src, {
bool compact = false,
bool bigFloats = false,
@Deprecated("[warn] has been superseded by [warnF].") bool warn = true,
void Function(String)? warnF,
}) {
final warnArg = warnF ?? (warn ? defaultWarn : nullWarn);
if (compact) {
final b = SICompactBuilder(warn: warnArg, bigFloats: bigFloats);
StringAvdParser(src, b).parse();
return b.si;
} else {
final b = SIDagBuilder(warn: warnArg);
StringAvdParser(src, b).parse();
return b.si;
}
}