circle function

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

The <circle> SVG element is an SVG basic shape, used to draw circles based on a center point and a radius.

  • cx: The x-axis coordinate of the center of the circle.
  • cy: The y-axis coordinate of the center of the circle.
  • r: The radius of the circle.
  • 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 circle(List<Component> children,
    {String? cx,
    String? cy,
    String? r,
    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: 'circle',
    key: key,
    id: id,
    classes: classes,
    styles: styles,
    attributes: {
      ...attributes ?? {},
      if (cx != null) 'cx': cx,
      if (cy != null) 'cy': cy,
      if (r != null) 'r': r,
      if (fill != null) 'fill': fill.value,
      if (stroke != null) 'stroke': stroke.value,
      if (strokeWidth != null) 'stroke-width': strokeWidth,
    },
    events: events,
    children: children,
  );
}