updateSearchQuery method
List<CustomMultiSelectDropdownItem<T> >
updateSearchQuery(
- String? val,
- List<
CustomMultiSelectDropdownItem< allItemsT> >
Implementation
List<CustomMultiSelectDropdownItem<T>> updateSearchQuery(
String? val, List<CustomMultiSelectDropdownItem<T>> allItems) {
if (val != null && val.trim().isNotEmpty) {
List<CustomMultiSelectDropdownItem<T>> filteredItems = [];
for (var item in allItems) {
if (item.buttonText.toLowerCase().contains(val.toLowerCase())) {
filteredItems.add(item);
}
}
return filteredItems;
} else {
return allItems;
}
}