clearSearch method

  1. @action
Future<void> clearSearch()

Implementation

@action
Future<void> clearSearch() async {
  setSearchedBy(SearchedBy.none);
  setQueryString('');
  _categories.clear();

  _categories.addAll(categories.map((f) => CategoryWeebi(
      title: f.title,
      calibresIds: f.calibresIds,
      creationDate: f.creationDate,
      color: f.color)));
  // only way dart can clone a list
  _calibres.clear();
  _calibres.addAll(
      calibresFull.notQuickspend.map((e) => CalibreWeebi.copy(e)).toList());
}