Label constructor

Label({
  1. String? text,
  2. String? className,
  3. String? style,
  4. Map<String, String>? attrs,
  5. String? htmlFor,
  6. List<BloomNode> children = const [],
  7. Map<String, BloomEventHandler>? on,
})

Creates a <label> element descriptor with htmlFor attribute shorthand.

Implementation

Label({
  super.text,
  super.className,
  super.style,
  Map<String, String>? attrs,
  String? htmlFor,
  super.children = const [],
  super.on,
}) : super(
        'label',
        attrs: _mergeAttrs(attrs, {
          if (htmlFor != null) 'for': htmlFor,
        }),
      );