line function
The <line> element is an SVG basic shape used to create a line connecting two points.
x1
: Defines the x-axis coordinate of the line starting point.y1
: Defines the y-axis coordinate of the line starting point.x2
: Defines the x-axis coordinate of the line ending point.y2
: Defines the y-axis coordinate of the line ending point.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 line(List<Component> children,
{String? x1,
String? y1,
String? x2,
String? y2,
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: 'line',
key: key,
id: id,
classes: classes,
styles: styles,
attributes: {
...attributes ?? {},
if (x1 != null) 'x1': x1,
if (y1 != null) 'y1': y1,
if (x2 != null) 'x2': x2,
if (y2 != null) 'y2': y2,
if (fill != null) 'fill': fill.value,
if (stroke != null) 'stroke': stroke.value,
if (strokeWidth != null) 'stroke-width': strokeWidth,
},
events: events,
children: children,
);
}