SvgRect constructor

SvgRect({
  1. num? x,
  2. num? y,
  3. required num width,
  4. required num height,
  5. num? rx,
  6. String? fill,
  7. String? stroke,
  8. String? className,
  9. Map<String, String>? attrs,
  10. Map<String, BloomEventHandler>? on,
})

Creates an SVG <rect> rectangle shape descriptor.

Implementation

SvgRect({
  num? x,
  num? y,
  required num width,
  required num height,
  num? rx,
  String? fill,
  String? stroke,
  super.className,
  Map<String, String>? attrs,
  super.on,
}) : super('rect',
          attrs: _mergeAttrs(attrs, {
            if (x != null) 'x': '$x',
            if (y != null) 'y': '$y',
            'width': '$width',
            'height': '$height',
            if (rx != null) 'rx': '$rx',
            if (fill != null) 'fill': fill,
            if (stroke != null) 'stroke': stroke,
          }));