FossMultiCombobox<T> class Inputs

FossCombobox, light theme FossCombobox, dark theme

See the combobox documentation ↗ or try it live in the playground ↗.

A combobox that holds several picks at once, shown as removable chips.

The value is the set of selected items (values); rebuild on onChanged. Typing filters items, picking toggles a chip and keeps the popup open, and Backspace on the empty input removes the last chip. A null onChanged (or enabled: false) disables the field.

Customize globally by passing your own FossThemeData, or per instance through the widget's style object. There are no per-instance token props: to change color, radius, or spacing, change the theme.

See also FossSelect for selection without typing.

FossMultiCombobox<String>(
  label: 'Tags',
  hintText: 'Add tags',
  values: tags,
  onChanged: (v) => setState(() => tags = v),
  items: const [
    FossComboboxItem(value: 'design', label: 'Design'),
    FossComboboxItem(value: 'eng', label: 'Engineering'),
  ],
);
Inheritance

Constructors

FossMultiCombobox({required List<FossComboboxItem<T>> items, Set<T> values = const {}, ValueChanged<Set<T>>? onChanged, FocusNode? focusNode, FossTextFieldSize size = FossTextFieldSize.md, String? label, String? hintText, String? errorText, bool enabled = true, Widget? startAddon, bool filter(String label, String query)?, String emptyText = _defaultEmptyText, String removeLabel = 'Remove', FossComboboxStyle? style, Key? key})
FossCombobox, light theme FossCombobox, dark theme
const

Properties

emptyText → String
Caption shown when the query matches no option.
final
enabled → bool
Whether the field accepts input. Disabled when false or onChanged is null.
final
errorText → String?
When non-null, marks the field invalid and recolors its border.
final
filter → bool Function(String label, String query)?
Overrides the default case-insensitive substring match.
final
focusNode → FocusNode?
Manages keyboard focus. Created and disposed internally when null.
final
hashCode → int
The hash code for this object.
no setterinherited
hintText → String?
Placeholder shown while no picks and the input is empty.
final
items → List<FossComboboxItem<T>>
The options to choose from.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label → String?
Optional label rendered above the field.
final
onChanged → ValueChanged<Set<T>>?
Called with the next set when a pick is toggled. A null callback disables the field.
final
removeLabel → String
Accessible label for each chip's remove button.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → FossTextFieldSize
The field height and type scale.
final
startAddon → Widget?
Optional leading widget, typically a search glyph. Icon-agnostic.
final
style → FossComboboxStyle?
Per-instance overrides layered on the theme-resolved style.
final
values → Set<T>
The current picks.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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