Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
remove unused old search related code (#1637)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnukvmd authored Jan 6, 2024
2 parents cb95b6b + 8b64bd6 commit ab1b3ec
Showing 1 changed file with 0 additions and 75 deletions.
75 changes: 0 additions & 75 deletions lib/ui/viewer/search/search_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,81 +198,6 @@ class SearchWidgetState extends State<SearchWidget> {
);
}

Future<List<SearchResult>> getSearchResultsForQuery(
BuildContext context,
String query,
) async {
final Completer<List<SearchResult>> completer = Completer();

_debouncer.run(
() {
return _getSearchResultsFromService(context, query, completer);
},
);

return completer.future;
}

Future<void> _getSearchResultsFromService(
BuildContext context,
String query,
Completer completer,
) async {
final List<SearchResult> allResults = [];
if (query.isEmpty) {
completer.complete(allResults);
return;
}
try {
if (_isYearValid(query)) {
final yearResults = await _searchService.getYearSearchResults(query);
allResults.addAll(yearResults);
}

final holidayResults =
await _searchService.getHolidaySearchResults(context, query);
allResults.addAll(holidayResults);

final fileTypeSearchResults =
await _searchService.getFileTypeResults(context, query);
allResults.addAll(fileTypeSearchResults);

final captionAndDisplayNameResult =
await _searchService.getCaptionAndNameResults(query);
allResults.addAll(captionAndDisplayNameResult);

final fileExtnResult =
await _searchService.getFileExtensionResults(query);
allResults.addAll(fileExtnResult);

final locationResult = await _searchService.getLocationResults(query);
allResults.addAll(locationResult);

final collectionResults =
await _searchService.getCollectionSearchResults(query);
allResults.addAll(collectionResults);

final monthResults =
await _searchService.getMonthSearchResults(context, query);
allResults.addAll(monthResults);

final possibleEvents =
await _searchService.getDateResults(context, query);
allResults.addAll(possibleEvents);

final magicResults =
await _searchService.getMagicSearchResults(context, query);
allResults.addAll(magicResults);

final contactResults =
await _searchService.getContactSearchResults(query);
allResults.addAll(contactResults);
} catch (e, s) {
_logger.severe("error during search", e, s);
}
completer.complete(allResults);
}

Stream<List<SearchResult>> _getSearchResultsStream(
BuildContext context,
String query,
Expand Down

0 comments on commit ab1b3ec

Please sign in to comment.