π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Add select all feature to galleries (1)
ashilkn9f4ce085c167
diff --git a/mobile/lib/ui/map/map_pull_up_gallery.dart b/mobile/lib/ui/map/map_pull_up_gallery.dartindex c88d4f81ce..f52439759e 100644--- a/mobile/lib/ui/map/map_pull_up_gallery.dart+++ b/mobile/lib/ui/map/map_pull_up_gallery.dart@@ -15,6 +15,7 @@ import "package:photos/theme/ente_theme.dart";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/state/selection_state.dart";class MapPullUpGallery extends StatefulWidget {final StreamController<List<EnteFile>> visibleImages;@@ -48,33 +49,37 @@ class _MapPullUpGalleryState extends State<MapPullUpGallery> {Widget? cachedScrollableContent;return DeferredPointerHandler(- child: Stack(- alignment: Alignment.bottomCenter,- clipBehavior: Clip.none,- children: [- DraggableScrollableSheet(- expand: false,- initialChildSize: initialChildSize,- minChildSize: initialChildSize,- maxChildSize: 0.8,- snap: true,- snapSizes: const [0.5],- builder: (context, scrollController) {- //Must use cached widget here to avoid rebuilds when DraggableScrollableSheet- //is snapped to it's initialChildSize- cachedScrollableContent ??=- cacheScrollableContent(scrollController, context, logger);- return cachedScrollableContent!;- },- ),- DeferPointer(- child: FileSelectionOverlayBar(- GalleryType.searchResults,- _selectedFiles,- backgroundColor: getEnteColorScheme(context).backgroundElevated2,+ child: SelectionState(+ selectedFiles: _selectedFiles,+ child: Stack(+ alignment: Alignment.bottomCenter,+ clipBehavior: Clip.none,+ children: [+ DraggableScrollableSheet(+ expand: false,+ initialChildSize: initialChildSize,+ minChildSize: initialChildSize,+ maxChildSize: 0.8,+ snap: true,+ snapSizes: const [0.5],+ builder: (context, scrollController) {+ //Must use cached widget here to avoid rebuilds when DraggableScrollableSheet+ //is snapped to it's initialChildSize+ cachedScrollableContent ??=+ cacheScrollableContent(scrollController, context, logger);+ return cachedScrollableContent!;+ },),- ),- ],+ DeferPointer(+ child: FileSelectionOverlayBar(+ GalleryType.searchResults,+ _selectedFiles,+ backgroundColor:+ getEnteColorScheme(context).backgroundElevated2,+ ),+ ),+ ],+ ),),);}diff --git a/mobile/lib/ui/viewer/gallery/archive_page.dart b/mobile/lib/ui/viewer/gallery/archive_page.dartindex 1d6f544def..4f0a9502f6 100644--- a/mobile/lib/ui/viewer/gallery/archive_page.dart+++ b/mobile/lib/ui/viewer/gallery/archive_page.dart@@ -15,6 +15,7 @@ import 'package:photos/ui/viewer/actions/file_selection_overlay_bar.dart';import "package:photos/ui/viewer/gallery/empty_state.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/selection_state.dart";class ArchivePage extends StatelessWidget {final String tagPrefix;@@ -86,15 +87,18 @@ class ArchivePage extends StatelessWidget {_selectedFiles,),),- body: Stack(- alignment: Alignment.bottomCenter,- children: [- gallery,- FileSelectionOverlayBar(- overlayType,- _selectedFiles,- ),- ],+ body: SelectionState(+ selectedFiles: _selectedFiles,+ child: Stack(+ alignment: Alignment.bottomCenter,+ children: [+ gallery,+ FileSelectionOverlayBar(+ overlayType,+ _selectedFiles,+ ),+ ],+ ),),);}diff --git a/mobile/lib/ui/viewer/gallery/collection_page.dart b/mobile/lib/ui/viewer/gallery/collection_page.dartindex 97183282b6..e0288f238b 100644--- a/mobile/lib/ui/viewer/gallery/collection_page.dart+++ b/mobile/lib/ui/viewer/gallery/collection_page.dart@@ -16,6 +16,7 @@ import "package:photos/ui/viewer/gallery/empty_album_state.dart";import 'package:photos/ui/viewer/gallery/empty_state.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/selection_state.dart";class CollectionPage extends StatelessWidget {final CollectionWithThumbnail c;@@ -98,16 +99,19 @@ class CollectionPage extends StatelessWidget {collection: c.collection,),),- body: Stack(- alignment: Alignment.bottomCenter,- children: [- gallery,- FileSelectionOverlayBar(- galleryType,- _selectedFiles,- collection: c.collection,- ),- ],+ body: SelectionState(+ selectedFiles: _selectedFiles,+ child: Stack(+ alignment: Alignment.bottomCenter,+ children: [+ gallery,+ FileSelectionOverlayBar(+ galleryType,+ _selectedFiles,+ collection: c.collection,+ ),+ ],+ ),),);}diff --git a/mobile/lib/ui/viewer/gallery/device_folder_page.dart b/mobile/lib/ui/viewer/gallery/device_folder_page.dartindex 42d7b80a61..b1a604ed02 100644--- a/mobile/lib/ui/viewer/gallery/device_folder_page.dart+++ b/mobile/lib/ui/viewer/gallery/device_folder_page.dart@@ -22,6 +22,7 @@ import 'package:photos/ui/components/toggle_switch_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/state/selection_state.dart";class DeviceFolderPage extends StatelessWidget {final DeviceCollection deviceCollection;@@ -66,15 +67,18 @@ class DeviceFolderPage extends StatelessWidget {deviceCollection: deviceCollection,),),- body: Stack(- alignment: Alignment.bottomCenter,- children: [- gallery,- FileSelectionOverlayBar(- GalleryType.localFolder,- _selectedFiles,- ),- ],+ body: SelectionState(+ selectedFiles: _selectedFiles,+ child: Stack(+ alignment: Alignment.bottomCenter,+ children: [+ gallery,+ FileSelectionOverlayBar(+ GalleryType.localFolder,+ _selectedFiles,+ ),+ ],+ ),),);}diff --git a/mobile/lib/ui/viewer/gallery/hidden_page.dart b/mobile/lib/ui/viewer/gallery/hidden_page.dartindex f9e3525fda..1517b07460 100644--- a/mobile/lib/ui/viewer/gallery/hidden_page.dart+++ b/mobile/lib/ui/viewer/gallery/hidden_page.dart@@ -19,6 +19,7 @@ import 'package:photos/ui/viewer/actions/file_selection_overlay_bar.dart';import 'package:photos/ui/viewer/gallery/empty_hidden_widget.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/selection_state.dart";class HiddenPage extends StatefulWidget {final String tagPrefix;@@ -139,15 +140,18 @@ class _HiddenPageState extends State<HiddenPage> {_selectedFiles,),),- body: Stack(- alignment: Alignment.bottomCenter,- children: [- gallery,- FileSelectionOverlayBar(- widget.overlayType,- _selectedFiles,- ),- ],+ body: SelectionState(+ selectedFiles: _selectedFiles,+ child: Stack(+ alignment: Alignment.bottomCenter,+ children: [+ gallery,+ FileSelectionOverlayBar(+ widget.overlayType,+ _selectedFiles,+ ),+ ],+ ),),);}