fullFilterFunction static method

bool fullFilterFunction({
  1. required dynamic searchTerms,
  2. required Iterable searchOnItems,
  3. int levenshteinDistance = 0,
  4. bool ignoreCase = true,
  5. bool ignoreDiacritics = true,
  6. bool ignoreWordSplitters = true,
  7. bool splitCamelCase = true,
  8. bool useWildcards = false,
})

A function that performs a full filter on an item based on search terms.

The fullFilterFunction takes in various parameters including the item to be filtered, the search terms to filter on, the function to extract search terms from the item, and several optional parameters to customize the filtering behavior.

  • The searchTerms parameter contains search terms to filter on. If searchTerms is a Iterable, the function will return true if any of the search terms match the item.
  • The searchOnItems parameter is a function that takes in an item and returns an iterable of search terms extracted from the item.
  • The levenshteinDistance parameter is an optional parameter that specifies the maximum Levenshtein distance allowed for a match.
  • The ignoreCase parameter is an optional parameter that specifies whether to ignore case when performing the filter.
  • The ignoreDiacritics parameter is an optional parameter that specifies whether to ignore diacritics when performing the filter.
  • The ignoreWordSplitters parameter is an optional parameter that specifies whether to ignore word splitters when performing the filter.
  • The splitCamelCase parameter is an optional parameter that specifies whether to split camel case words when performing the filter.
  • The useWildcards parameter is an optional parameter that specifies whether to use wildcards when performing the filter.

The function returns true if the item passes the filter, and false otherwise.

Implementation

static bool fullFilterFunction({
  required dynamic searchTerms,
  required Iterable searchOnItems,
  int levenshteinDistance = 0,
  bool ignoreCase = true,
  bool ignoreDiacritics = true,
  bool ignoreWordSplitters = true,
  bool splitCamelCase = true,
  bool useWildcards = false,
}) =>
    searchFunction(
      searchTerms: searchTerms,
      searchOnItems: searchOnItems,
      ignoreCase: ignoreCase,
      ignoreDiacritics: ignoreDiacritics,
      ignoreWordSplitters: ignoreWordSplitters,
      splitCamelCase: splitCamelCase,
      useWildcards: useWildcards,
    ) ||
    levenshteinFunction(
      searchTerms: searchTerms,
      searchOnItems: searchOnItems,
      levenshteinDistance: levenshteinDistance,
      ignoreCase: ignoreCase,
    );