Canvas function
A canvas element.
The HTML <canvas> element is used to draw 2D/3D graphics
via the Canvas API or WebGL.
Implementation
Component Canvas({
int? width,
int? height,
String? className,
String? style,
String? id,
Component? child,
List<Component>? children,
Map<String, String>? attributes,
Map<String, EventCallback>? events,
Key? key,
}) {
return Component.element(
tag: 'canvas',
id: id,
classes: className,
styles: parseStyles(style),
attributes: {
if (width != null) 'width': width.toString(),
if (height != null) 'height': height.toString(),
...?attributes,
},
events: events,
children: resolveChildren(child, children),
key: key,
);
}