rect function
The <rect> element is a basic SVG shape that draws rectangles, defined by their position, width, and height. The rectangles may have their corners rounded.
x
: The x coordinate of the rect.y
: The y coordinate of the rect.width
: The width of the rect.height
: The height of the rect.fill
: The color (or gradient or pattern) used to paint the shape.stroke
: The color (or gradient or pattern) used to paint the outline of the shape.strokeWidth
: The width of the stroke to be applied to the shape.
Implementation
Component rect(List<Component> children,
{String? x,
String? y,
String? width,
String? height,
Color? fill,
Color? stroke,
String? strokeWidth,
Key? key,
String? id,
String? classes,
Styles? styles,
Map<String, String>? attributes,
Map<String, EventCallback>? events}) {
return DomComponent(
tag: 'rect',
key: key,
id: id,
classes: classes,
styles: styles,
attributes: {
...attributes ?? {},
if (x != null) 'x': x,
if (y != null) 'y': y,
if (width != null) 'width': width,
if (height != null) 'height': height,
if (fill != null) 'fill': fill.value,
if (stroke != null) 'stroke': stroke.value,
if (strokeWidth != null) 'stroke-width': strokeWidth,
},
events: events,
children: children,
);
}