Examples
- Basic Usage
- With Icons
- Searchable
- With Descriptions
- Error State
- Multi-Select

Simple dropdown field with a label.
Properties
Required
The currently selected value(s). For single-select, use
String? (e.g., selected: "item-id" or selected: null). For multi-select, use Set<String> (e.g., selected: {"item1", "item2"}). The generic type T determines the selection mode.Callback function called when the selection changes. Receives the selected value(s) matching the generic type
T. For single-select, receives String?. For multi-select, receives Set<String>.A list of sections containing the dropdown options. Each section groups related items together.
Content
The label text displayed above the dropdown field.
The placeholder text shown when no item is selected.
Layout
Whether the dropdown should have a fixed height or expand to fit content. When true, provides a scrollable area for long lists.
Search
Whether to enable search functionality within the dropdown. When true, adds a sticky search field at the top of the dropdown.
The placeholder text for the search field. Only relevant when
isSearchable is true.When
isSearchable is true, automatically focuses the search field when opening the dropdown.State
Whether users can deselect the currently selected item by clicking it again. When true, clicking the selected item calls
onChanged with null.Controls whether the dropdown is interactive. When
false, the field dims, ignores input and focus, and shows a forbidden cursor.Validation
Error message to display below the dropdown field. When provided, the field shows an error state with red styling.
Section Properties
TheNeoDropdownFieldSection class represents grouped sections within the dropdown:
Required
A list of items within this section.
Content
The section header text. If not provided, the section will not display a header.
Item Properties
TheNeoDropdownFieldItem class represents individual selectable options:
Required
A unique identifier for the item. This value is passed to the
onChanged callback when selected. Must be unique across all items.The display text for the item.
Content
Additional descriptive text displayed below the label for extra context.
An optional icon to display before the label.
Whether to display the description inline with the label instead of below it.
Best Practices
- Width Constraints: Always provide width constraints to prevent layout issues by wrapping in
ConstrainedBox,SizedBox,Expanded, etc. - Unique IDs: Ensure all item IDs are unique across all sections to prevent errors
- Error Handling: Use
errorTextto provide clear validation feedback when e.g. the field is required - Deselection: Enable
allowDeselectfor optional fields where “no selection” is a valid state. (E.g. filter fields) - Multi-Select: Use
NeoDropdownField<Set<String>>for multi-select scenarios. The dropdown stays open after selection, allowing multiple items to be selected.
Integration Notes
- Generic Type: The widget is generic and supports two modes:
- Single-select:
NeoDropdownField<String?>orNeoDropdownField<String>(use nullable for optional fields) - Multi-select:
NeoDropdownField<Set<String>>(automatically enables multi-select behavior)
- Single-select:
- ID Validation: The widget validates that all item IDs are unique and non-empty. Invalid IDs will trigger errors.












