Option constructor

Option({
  1. required String value,
  2. String? text,
  3. bool? selected,
  4. bool? disabled,
  5. String? className,
  6. Map<String, String>? attrs,
  7. List<BloomNode> children = const [],
})

Creates an <option> element descriptor with value and state shorthands.

Implementation

Option({
  required String value,
  super.text,
  bool? selected,
  bool? disabled,
  super.className,
  Map<String, String>? attrs,
  super.children = const [],
}) : super(
        'option',
        attrs: _mergeAttrs(attrs, {
          'value': value,
          if (selected == true) 'selected': 'selected',
          if (disabled == true) 'disabled': 'disabled',
        }),
      );