matchSearch static method
Implementation
static int matchSearch({required String keyword, required List<String> criterias}){
if(keyword.isNullOrEmpty() || isNullOrEmpty(criterias)) return 0;
int matchWeight = 0;
List<String> splittedKeywords = keyword.toLowerCase().trim().split(RegExp(" "));
criterias.forEach((element) {
splittedKeywords.forEach((key) {
if(!key.isNullOrEmpty() && contains(element, key)){
matchWeight++;
}
});
});
return matchWeight;
}