From 9e4e8ef740cd93dcfef0a3553fcef7f55b6118d2 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 6 Jan 2024 17:45:15 +0530 Subject: [PATCH] remove unused old search related code --- lib/ui/viewer/search/search_widget.dart | 75 ------------------------- 1 file changed, 75 deletions(-) diff --git a/lib/ui/viewer/search/search_widget.dart b/lib/ui/viewer/search/search_widget.dart index 293025ee8..0044697f1 100644 --- a/lib/ui/viewer/search/search_widget.dart +++ b/lib/ui/viewer/search/search_widget.dart @@ -198,81 +198,6 @@ class SearchWidgetState extends State { ); } - Future> getSearchResultsForQuery( - BuildContext context, - String query, - ) async { - final Completer> completer = Completer(); - - _debouncer.run( - () { - return _getSearchResultsFromService(context, query, completer); - }, - ); - - return completer.future; - } - - Future _getSearchResultsFromService( - BuildContext context, - String query, - Completer completer, - ) async { - final List 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> _getSearchResultsStream( BuildContext context, String query,