mergeStyle method
Creates an instance with merged style information.
Implementation
@override
DrawableRoot mergeStyle(DrawableStyle newStyle) {
assert(newStyle != null); // ignore: unnecessary_null_comparison
final DrawableStyle mergedStyle = DrawableStyle.mergeAndBlend(
style,
fill: newStyle.fill,
stroke: newStyle.stroke,
clipPath: newStyle.clipPath,
mask: newStyle.mask,
dashArray: newStyle.dashArray,
dashOffset: newStyle.dashOffset,
pathFillType: newStyle.pathFillType,
textStyle: newStyle.textStyle,
);
final List<Drawable> mergedChildren =
children.map<Drawable>((Drawable child) {
if (child is DrawableStyleable) {
return child.mergeStyle(mergedStyle);
}
return child;
}).toList();
return DrawableRoot(
id,
viewport,
mergedChildren,
definitions,
mergedStyle,
transform: transform,
);
}