π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Curate album filters for search result page (just getting the data without showing it on UI)
ashilkne8b2adb199e8
diff --git a/mobile/lib/ui/viewer/gallery/gallery.dart b/mobile/lib/ui/viewer/gallery/gallery.dartindex be41f11ff2..e72b83db58 100644--- a/mobile/lib/ui/viewer/gallery/gallery.dart+++ b/mobile/lib/ui/viewer/gallery/gallery.dart@@ -16,8 +16,10 @@ import "package:photos/ui/viewer/gallery/component/group/type.dart";import "package:photos/ui/viewer/gallery/component/multiple_groups_gallery_view.dart";import 'package:photos/ui/viewer/gallery/empty_state.dart';import "package:photos/ui/viewer/gallery/state/gallery_context_state.dart";+import "package:photos/ui/viewer/gallery/state/inherited_search_filter_data.dart";import "package:photos/ui/viewer/gallery/state/selection_state.dart";import "package:photos/utils/debouncer.dart";+import "package:photos/utils/hierarchical_search_util.dart";import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';typedef GalleryLoader = Future<FileLoadResult> Function(@@ -205,6 +207,17 @@ class GalleryState extends State<Gallery> {duration.inMilliseconds.toString() +"ms",);++ if (!result.hasMore) {+ //There is a possility that this won't work if hasMore is never true.+ final searchFilterDataProvider =+ InheritedSearchFilterData.maybeOf(context)+ ?.searchFilterDataProvider;+ if (searchFilterDataProvider != null) {+ curateAlbumFilters(searchFilterDataProvider, result.files);+ }+ }+return result;} catch (e, s) {_logger.severe("failed to load files", e, s);diff --git a/mobile/lib/ui/viewer/search/result/search_result_page.dart b/mobile/lib/ui/viewer/search/result/search_result_page.dartindex 218f069860..93f93b0d6d 100644--- a/mobile/lib/ui/viewer/search/result/search_result_page.dart+++ b/mobile/lib/ui/viewer/search/result/search_result_page.dart@@ -12,6 +12,8 @@ import 'package:photos/models/selected_files.dart';import 'package:photos/ui/viewer/actions/file_selection_overlay_bar.dart';import 'package:photos/ui/viewer/gallery/gallery.dart';import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';+import "package:photos/ui/viewer/gallery/state/inherited_search_filter_data.dart";+import "package:photos/ui/viewer/gallery/state/search_filter_data_provider.dart";import "package:photos/ui/viewer/gallery/state/selection_state.dart";class SearchResultPage extends StatefulWidget {@@ -91,26 +93,29 @@ class _SearchResultPageState extends State<SearchResultPage> {enableFileGrouping: widget.enableGrouping,initialFiles: [widget.searchResult.resultFiles().first],);- return Scaffold(- appBar: PreferredSize(- preferredSize: const Size.fromHeight(50.0),- child: GalleryAppBarWidget(- SearchResultPage.appBarType,- widget.searchResult.name(),- _selectedFiles,+ return InheritedSearchFilterData(+ searchFilterDataProvider: SearchFilterDataProvider(),+ child: Scaffold(+ appBar: PreferredSize(+ preferredSize: const Size.fromHeight(50.0),+ child: GalleryAppBarWidget(+ SearchResultPage.appBarType,+ widget.searchResult.name(),+ _selectedFiles,+ ),),- ),- body: SelectionState(- selectedFiles: _selectedFiles,- child: Stack(- alignment: Alignment.bottomCenter,- children: [- gallery,- FileSelectionOverlayBar(- SearchResultPage.overlayType,- _selectedFiles,- ),- ],+ body: SelectionState(+ selectedFiles: _selectedFiles,+ child: Stack(+ alignment: Alignment.bottomCenter,+ children: [+ gallery,+ FileSelectionOverlayBar(+ SearchResultPage.overlayType,+ _selectedFiles,+ ),+ ],+ ),),),);