polyline function

Component polyline(
  1. List<Component> children, {
  2. String? points,
  3. Color? fill,
  4. Color? stroke,
  5. String? strokeWidth,
  6. Key? key,
  7. String? id,
  8. String? classes,
  9. Styles? styles,
  10. Map<String, String>? attributes,
  11. Map<String, EventCallback>? events,
})

The <polyline> SVG element is an SVG basic shape that creates straight lines connecting several points. Typically a polyline is used to create open shapes as the last point doesn't have to be connected to the first point.

  • points: This attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polyline.
  • 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 polyline(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: 'polyline',
    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,
  );
}