UiSelectOption<T> class

Single item in a UiSelect.

value and label are always required: value is the typed identity of the option, and label is the string form used for the trigger's collapsed display, accessibility, and screen-reader announcements. Everything else is presentation.

For richer rows that still sit inside the default row chrome, supply either:

  • leading — a leading widget (avatar, swatch, icon) painted to the left of the label;
  • subtitle — a secondary line of text under the label;
  • labelBuilder — a full override for the label widget. The builder receives the selected state so it can tweak weight/colour/etc.

When labelBuilder is set the default label Text is replaced, but the surrounding row (padding, hover highlight, check glyph, leading, subtitle) is preserved. Use UiSelect.optionBuilder when you need to swap out the whole row, not just the label slot.

Annotations

Constructors

UiSelectOption({required T value, required String label, Widget? leading, String? subtitle, UiSelectOptionLabelBuilder<T>? labelBuilder})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
label String
Plain-text label. Used by the collapsed trigger, the default row label, and accessibility announcements.
final
labelBuilder UiSelectOptionLabelBuilder<T>?
Optional widget builder that replaces only the label slot. Prefer this over UiSelect.optionBuilder when you want custom label rendering but still want the default row chrome around it.
final
leading Widget?
Optional widget drawn to the left of the label inside the row. Typical uses: country flag, colour swatch, status dot.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subtitle String?
Optional second line rendered beneath the label.
final
value → T
Typed identity; this is what UiSelect.onChanged emits and what UiSelect.value compares against.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited