SearchSelectorExtensions extension
Presents a filterable list with optional multi-select controls.
Controls:
- ↑ / ↓ navigate through items
- / toggles the search field
- Type to filter when search is visible
- Space toggles the focused option when
multiSelectis true - Enter confirms the selection
- Esc / Ctrl+C cancels (returns
[])
Parameters:
options: Items shown in the scrollable list.prompt: Frame title displayed above the list.multiSelect: Enables toggling multiple entries.showSearch: Starts with the search box visible.maxVisible: Maximum rows before scrolling.
Example:
final chosen = terminice.searchSelector(
options: const ['Frogs', 'Dogs', 'Hogs'],
prompt: 'Select animal',
multiSelect: false,
showSearch: true,
);
- on
Methods
-
searchSelector(
{required List< String> options, String prompt = 'Select an option', bool multiSelect = false, bool showSearch = false, int maxVisible = 10}) → List<String> -
Available on Terminice, provided by the SearchSelectorExtensions extension
Renders the searchable list selector and returns the chosen labels.