polygon function
The <polygon> element defines a closed shape consisting of a set of connected straight line segments. The last point is connected to the first point.
points
: This attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon.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 polygon(List<Component> children,
{String? points,
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: 'polygon',
key: key,
id: id,
classes: classes,
styles: styles,
attributes: {
...attributes ?? {},
if (points != null) 'points': points,
if (fill != null) 'fill': fill.value,
if (stroke != null) 'stroke': stroke.value,
if (strokeWidth != null) 'stroke-width': strokeWidth,
},
events: events,
children: children,
);
}