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

Simple dropdown field with a label.
Properties
Required
The ID of the currently selected item. Use
null
when no item is selected.Callback function called when the selection changes. Receives the ID of the selected item, or
null
if selection is cleared.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
errorText
to provide clear validation feedback when e.g. the field is required - Deselection: Enable
allowDeselect
for optional fields where “no selection” is a valid state. (E.g. filter fields)
Integration Notes
- ID Validation: The widget validates that all item IDs are unique and non-empty. Invalid IDs will trigger errors.