search method

dynamic search(
  1. String? text
)

Implementation

search(String? text) {
  if (text == null || text.isEmpty) {
    _listToShow = originalList;
    notifyListeners();
    return;
  }

  _listToShow = originalList
      .where((element) =>
          element.title.toUpperCase().contains(text.toUpperCase()) ||
          element.id.toUpperCase().contains(text.toUpperCase()))
      .toList();
  notifyListeners();
}