matchesSearch static method

bool matchesSearch(
  1. String searchText,
  2. String targetText
)

Checks if search text matches target text using normalized comparison

Implementation

static bool matchesSearch(String searchText, String targetText) {
  if (searchText.isEmpty) return true;
  if (targetText.isEmpty) return false;

  final normalizedSearch = normalizeForSearch(searchText);
  final normalizedTarget = normalizeForSearch(targetText);

  return normalizedTarget.contains(normalizedSearch);
}