DrawableAvdPath.fromXml constructor
DrawableAvdPath.fromXml(
- XmlElement el
Creates a DrawableAvdPath from an XML
Implementation
factory DrawableAvdPath.fromXml(XmlElement el) {
final String d =
getAttribute(el.attributes, 'pathData', def: '', namespace: androidNS)!;
final Path path = parseSvgPathData(d);
assert(path != null); // ignore: unnecessary_null_comparison
path.fillType = parsePathFillType(el.attributes);
final DrawablePaint? stroke = parseStroke(el.attributes, path.getBounds());
final DrawablePaint? fill = parseFill(el.attributes, path.getBounds());
return DrawableAvdPath(
getAttribute(el.attributes, 'id', def: ''),
path,
DrawableStyle(stroke: stroke, fill: fill),
);
}