onSearch method

void onSearch(
  1. String value
)

Implementation

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