search method
Implementation
@override
SearchResult search(SearchQuery<T> query) {
if (searchFilter != null) {
query = SearchQuery(query.query, searchFilter, query.selectedValue);
}
if (query.query.isEmpty) {
bool hasSelectedValue = false;
if (searchFilter != _keepOrderFilter) {
for (var item in children) {
if (item.search(query).hasSelectedValue) {
hasSelectedValue = true;
break;
}
}
}
return SearchResult(0, hasSelectedValue);
}
int score = 0;
bool hasSelectedValue = false;
for (var item in children) {
var result = item.search(query);
score += result.score;
if (searchFilter != _keepOrderFilter && result.hasSelectedValue) {
hasSelectedValue = true;
}
}
return SearchResult(score, hasSelectedValue);
}