Canvas constructor

Canvas({
  1. int? width,
  2. int? height,
  3. String? className,
  4. String? style,
  5. Map<String, String>? attrs,
  6. Map<String, BloomEventHandler>? on,
})

Creates a <canvas> element descriptor with width and height dimension shorthands.

Implementation

Canvas(
    {int? width,
    int? height,
    super.className,
    super.style,
    Map<String, String>? attrs,
    super.on})
    : super('canvas',
          attrs: _mergeAttrs(attrs, {
            if (width != null) 'width': '$width',
            if (height != null) 'height': '$height'
          }));