fromAvdAsset static method
Future<ScalableImage>
fromAvdAsset(
- AssetBundle b,
- String key, {
- bool compact = false,
- bool bigFloats = false,
- @Deprecated("[warn] has been superseded by [warnF].") bool warn = true,
- void warnF()?,
Load a string asset containing an Android Vector Drawable in XML format
from b
and parse it into 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 Future<ScalableImage> fromAvdAsset(
AssetBundle b,
String key, {
bool compact = false,
bool bigFloats = false,
@Deprecated("[warn] has been superseded by [warnF].") bool warn = true,
void Function(String)? warnF,
}) async {
final warnArg = warnF ?? (warn ? defaultWarn : nullWarn);
final src = await b.loadString(key, cache: false);
return fromAvdString(src,
compact: compact, bigFloats: bigFloats, warnF: warnArg);
}