TypeAheadField(
textFieldConfiguration: TextFieldConfiguration(
decoration: InputDecoration(labelText: 'Select Items'),
),
suggestionsCallback: (pattern) {
// Implement a function to provide suggestions based on the search pattern.
// You can fetch suggestions from your data source (e.g., a list or API).
// Return a list of suggestions that match the pattern.
},
itemBuilder: (context, suggestion) {
// Build the suggestion item UI based on the suggestion.
return ListTile(
title: Text(suggestion),
);
},
onSuggestionSelected: (suggestion) {
// Handle the selection of a suggestion.
// Add the selected value to your list of selected items.
},
keepSuggestionsOnLoading: false,
),
3条答案
按热度按时间aij0ehis1#
我发现了这个multiple_select包,里面有一个搜索器。希望对社区有所帮助。
bq8i3lrv2#
你可以使用flutter_typeahead
3pmvbmvn3#
您可以使用autocomplete_textfield package
source to how to actually implement one。