matchesAnySearch static method

bool matchesAnySearch(
  1. String searchText,
  2. List<String> targetTexts
)

Checks if search text matches any of the provided target texts

Implementation

static bool matchesAnySearch(String searchText, List<String> targetTexts) {
  if (searchText.isEmpty) return true;
  if (targetTexts.isEmpty) return false;

  final normalizedSearch = normalizeForSearch(searchText);

  return targetTexts.any((target) =>
      normalizeForSearch(target).contains(normalizedSearch)
  );
}