fullFilterFunction static method
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
searchTermsparameter contains search terms to filter on. IfsearchTermsis a Iterable, the function will returntrueif any of the search terms match the item. - The
searchOnItemsparameter is a function that takes in an item and returns an iterable of search terms extracted from the item. - The
levenshteinDistanceparameter is an optional parameter that specifies the maximum Levenshtein distance allowed for a match. - The
ignoreCaseparameter is an optional parameter that specifies whether to ignore case when performing the filter. - The
ignoreDiacriticsparameter is an optional parameter that specifies whether to ignore diacritics when performing the filter. - The
ignoreWordSplittersparameter is an optional parameter that specifies whether to ignore word splitters when performing the filter. - The
splitCamelCaseparameter is an optional parameter that specifies whether to split camel case words when performing the filter. - The
useWildcardsparameter 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,
);