Skip to main content

Combo editor

Use FdcComboEdit<T> when a field should accept one value from a predefined set of value/label pairs.

FdcComboEdit<String>(
dataSet: customers,
fieldName: 'status',
label: 'Status',
options: const [
FdcOption(value: 'active', label: 'Active'),
FdcOption(value: 'on_hold', label: 'On hold'),
FdcOption(value: 'closed', label: 'Closed'),
],
)

The stored value and display label remain separate. In the example above, the dataset stores on_hold while the user sees On hold.

Searchable popup

For larger option sets, enable popup search:

FdcComboEdit<String>(
dataSet: customers,
fieldName: 'state',
options: usStateOptions,
search: const FdcComboSearchOptions(
searchable: true,
searchableInline: true,
mode: FdcComboSearchMode.contains,
),
searchHintText: 'Search states',
)

Search can match labels with startsWith or contains behavior.

Use maxPopupItems to limit how many rows are visible before the popup scrolls:

FdcComboEdit<String>(
dataSet: customers,
fieldName: 'priority',
options: priorityOptions,
maxPopupItems: 6,
)

A combo is best for a known, bounded value list. For dynamic search, external selection screens, or multi-field resolution, use a lookup callback instead.