[mob][photos] Enable hierarchical search in location screen

This commit is contained in:
ashilkn
2024-10-07 20:14:46 +05:30
parent af8d630060
commit 7504e01bf7
2 changed files with 43 additions and 23 deletions

View File

@@ -163,7 +163,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
),
// actions: _getDefaultActions(context),
bottom: galleryType == GalleryType.searchResults ||
galleryType == GalleryType.ownedCollection
galleryType == GalleryType.ownedCollection ||
galleryType == GalleryType.locationTag
? const PreferredSize(
preferredSize: Size.fromHeight(0),
child: Flexible(child: RecommendedFilters()),

View File

@@ -22,6 +22,7 @@ import "package:photos/ui/common/loading_widget.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/hierarchical_search_gallery.dart";
import "package:photos/ui/viewer/gallery/state/gallery_files_inherited_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";
@@ -190,29 +191,47 @@ class _LocationGalleryWidgetState extends State<LocationGalleryWidget> {
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Gallery(
loadingWidget: Column(
children: [
EnteLoadingWidget(
color: getEnteColorScheme(context).strokeMuted,
),
],
),
asyncLoader: (
creationStartTime,
creationEndTime, {
limit,
asc,
}) async {
return snapshot.data as FileLoadResult;
Builder(
builder: (context) {
return ValueListenableBuilder(
valueListenable: InheritedSearchFilterData.of(context)
.searchFilterDataProvider!
.isSearchingNotifier,
builder: (context, value, _) {
return value
? HierarchicalSearchGallery(
tagPrefix: widget.tagPrefix,
selectedFiles: _selectedFiles,
)
: Gallery(
loadingWidget: Column(
children: [
EnteLoadingWidget(
color: getEnteColorScheme(context)
.strokeMuted,
),
],
),
asyncLoader: (
creationStartTime,
creationEndTime, {
limit,
asc,
}) async {
return snapshot.data as FileLoadResult;
},
reloadEvent:
Bus.instance.on<LocalPhotosUpdatedEvent>(),
removalEventTypes: const {
EventType.deletedFromRemote,
EventType.deletedFromEverywhere,
},
selectedFiles: _selectedFiles,
tagPrefix: widget.tagPrefix,
);
},
);
},
reloadEvent: Bus.instance.on<LocalPhotosUpdatedEvent>(),
removalEventTypes: const {
EventType.deletedFromRemote,
EventType.deletedFromEverywhere,
},
selectedFiles: _selectedFiles,
tagPrefix: widget.tagPrefix,
),
FileSelectionOverlayBar(
GalleryType.locationTag,