onSearch method
Implementation
void onSearch(String value) {
if (value.isEmpty) {
filteredList.assignAll(list);
} else {
filteredList.assignAll(list.where((element) =>
(element.name ?? '').toLowerCase().contains(value.toLowerCase())));
}
}