ellipse function

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

The <ellipse> element is an SVG basic shape, used to create ellipses based on a center coordinate, and both their x and y radius.

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