Neeraj Gupta 2 yıl önce
ebeveyn
işleme
ab4be2d01a

+ 4 - 4
lib/ui/viewer/gallery/component/gallery_file_widget.dart

@@ -21,7 +21,7 @@ class GalleryFileWidget extends StatelessWidget {
   final String tag;
   final int photoGridSize;
   final int? currentUserID;
-  final List<File> filesInDay;
+  final List<File> filesInGroup;
   final GalleryLoader asyncLoader;
   const GalleryFileWidget({
     required this.file,
@@ -30,7 +30,7 @@ class GalleryFileWidget extends StatelessWidget {
     required this.tag,
     required this.photoGridSize,
     required this.currentUserID,
-    required this.filesInDay,
+    required this.filesInGroup,
     required this.asyncLoader,
     super.key,
   });
@@ -167,9 +167,9 @@ class GalleryFileWidget extends StatelessWidget {
   void _routeToDetailPage(File file, BuildContext context) {
     final page = DetailPage(
       DetailPageConfiguration(
-        List.unmodifiable(filesInDay),
+        List.unmodifiable(filesInGroup),
         asyncLoader,
-        filesInDay.indexOf(file),
+        filesInGroup.indexOf(file),
         tag,
       ),
     );

+ 5 - 5
lib/ui/viewer/gallery/component/grid/gallery_grid_vew_widget.dart

@@ -6,7 +6,7 @@ import "package:photos/ui/viewer/gallery/component/gallery_file_widget.dart";
 import "package:photos/ui/viewer/gallery/gallery.dart";
 
 class GalleryGridViewWidget extends StatelessWidget {
-  final List<File> filesInDay;
+  final List<File> filesInGroup;
   final int photoGridSize;
   final SelectedFiles? selectedFiles;
   final bool limitSelectionToOne;
@@ -14,7 +14,7 @@ class GalleryGridViewWidget extends StatelessWidget {
   final int? currentUserID;
   final GalleryLoader asyncLoader;
   const GalleryGridViewWidget({
-    required this.filesInDay,
+    required this.filesInGroup,
     required this.photoGridSize,
     this.selectedFiles,
     required this.limitSelectionToOne,
@@ -32,17 +32,17 @@ class GalleryGridViewWidget extends StatelessWidget {
       // to disable GridView's scrolling
       itemBuilder: (context, index) {
         return GalleryFileWidget(
-          file: filesInDay[index],
+          file: filesInGroup[index],
           selectedFiles: selectedFiles,
           limitSelectionToOne: limitSelectionToOne,
           tag: tag,
           photoGridSize: photoGridSize,
           currentUserID: currentUserID,
-          filesInDay: filesInDay,
+          filesInGroup: filesInGroup,
           asyncLoader: asyncLoader,
         );
       },
-      itemCount: filesInDay.length,
+      itemCount: filesInGroup.length,
       gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
         crossAxisSpacing: 2,
         mainAxisSpacing: 2,

+ 10 - 10
lib/ui/viewer/gallery/component/grid/lazy_grid_view.dart

@@ -13,7 +13,7 @@ import "package:photos/ui/viewer/gallery/gallery.dart";
 
 class LazyGridView extends StatefulWidget {
   final String tag;
-  final List<File> filesInDay;
+  final List<File> filesInGroup;
   final GalleryLoader asyncLoader;
   final SelectedFiles? selectedFiles;
   final bool shouldRender;
@@ -25,7 +25,7 @@ class LazyGridView extends StatefulWidget {
 
   LazyGridView(
     this.tag,
-    this.filesInDay,
+    this.filesInGroup,
     this.asyncLoader,
     this.selectedFiles,
     this.shouldRender,
@@ -73,7 +73,7 @@ class _LazyGridViewState extends State<LazyGridView> {
   @override
   void didUpdateWidget(LazyGridView oldWidget) {
     super.didUpdateWidget(oldWidget);
-    if (!listEquals(widget.filesInDay, oldWidget.filesInDay)) {
+    if (!listEquals(widget.filesInGroup, oldWidget.filesInGroup)) {
       _shouldRender = widget.shouldRender;
     }
   }
@@ -83,7 +83,7 @@ class _LazyGridViewState extends State<LazyGridView> {
     if (widget.shouldRecycle) {
       return RecyclableGridViewWidget(
         shouldRender: _shouldRender,
-        filesInDay: widget.filesInDay,
+        filesInGroup: widget.filesInGroup,
         photoGridSize: widget.photoGridSize!,
         limitSelectionToOne: widget.limitSelectionToOne,
         tag: widget.tag,
@@ -94,7 +94,7 @@ class _LazyGridViewState extends State<LazyGridView> {
     } else {
       return NonRecyclableGridViewWidget(
         shouldRender: _shouldRender,
-        filesInDay: widget.filesInDay,
+        filesInGroup: widget.filesInGroup,
         photoGridSize: widget.photoGridSize!,
         limitSelectionToOne: widget.limitSelectionToOne,
         tag: widget.tag,
@@ -108,13 +108,13 @@ class _LazyGridViewState extends State<LazyGridView> {
   void _selectedFilesListener() {
     if (widget.selectedFiles!.files
         .toSet()
-        .containsAll(widget.filesInDay.toSet())) {
+        .containsAll(widget.filesInGroup.toSet())) {
       widget.areAllFilesSelected.value = true;
     } else {
       widget.areAllFilesSelected.value = false;
     }
     bool shouldRefresh = false;
-    for (final file in widget.filesInDay) {
+    for (final file in widget.filesInGroup) {
       if (widget.selectedFiles!.isPartOfLastSelected(file)) {
         shouldRefresh = true;
       }
@@ -127,12 +127,12 @@ class _LazyGridViewState extends State<LazyGridView> {
   void _toggleSelectAllFromDayListener() {
     if (widget.selectedFiles!.files
         .toSet()
-        .containsAll(widget.filesInDay.toSet())) {
+        .containsAll(widget.filesInGroup.toSet())) {
       setState(() {
-        widget.selectedFiles!.unSelectAll(widget.filesInDay.toSet());
+        widget.selectedFiles!.unSelectAll(widget.filesInGroup.toSet());
       });
     } else {
-      widget.selectedFiles!.selectAll(widget.filesInDay.toSet());
+      widget.selectedFiles!.selectAll(widget.filesInGroup.toSet());
     }
   }
 }

+ 5 - 5
lib/ui/viewer/gallery/component/grid/non_recyclable_grid_view_widget.dart

@@ -8,7 +8,7 @@ import "package:visibility_detector/visibility_detector.dart";
 
 class NonRecyclableGridViewWidget extends StatefulWidget {
   final bool shouldRender;
-  final List<File> filesInDay;
+  final List<File> filesInGroup;
   final int photoGridSize;
   final bool limitSelectionToOne;
   final String tag;
@@ -17,7 +17,7 @@ class NonRecyclableGridViewWidget extends StatefulWidget {
   final SelectedFiles? selectedFiles;
   const NonRecyclableGridViewWidget({
     required this.shouldRender,
-    required this.filesInDay,
+    required this.filesInGroup,
     required this.photoGridSize,
     required this.limitSelectionToOne,
     required this.tag,
@@ -45,7 +45,7 @@ class _NonRecyclableGridViewWidgetState
   Widget build(BuildContext context) {
     if (!_shouldRender) {
       return VisibilityDetector(
-        key: Key("gallery" + widget.filesInDay.first.tag),
+        key: Key("gallery" + widget.filesInGroup.first.tag),
         onVisibilityChanged: (visibility) {
           if (mounted && visibility.visibleFraction > 0 && !_shouldRender) {
             setState(() {
@@ -54,13 +54,13 @@ class _NonRecyclableGridViewWidgetState
           }
         },
         child: PlaceHolderGridViewWidget(
-          widget.filesInDay.length,
+          widget.filesInGroup.length,
           widget.photoGridSize,
         ),
       );
     } else {
       return GalleryGridViewWidget(
-        filesInDay: widget.filesInDay,
+        filesInGroup: widget.filesInGroup,
         photoGridSize: widget.photoGridSize,
         limitSelectionToOne: widget.limitSelectionToOne,
         tag: widget.tag,

+ 5 - 5
lib/ui/viewer/gallery/component/grid/recyclable_grid_view_widget.dart

@@ -8,7 +8,7 @@ import "package:visibility_detector/visibility_detector.dart";
 
 class RecyclableGridViewWidget extends StatefulWidget {
   final bool shouldRender;
-  final List<File> filesInDay;
+  final List<File> filesInGroup;
   final int photoGridSize;
   final bool limitSelectionToOne;
   final String tag;
@@ -17,7 +17,7 @@ class RecyclableGridViewWidget extends StatefulWidget {
   final SelectedFiles? selectedFiles;
   const RecyclableGridViewWidget({
     required this.shouldRender,
-    required this.filesInDay,
+    required this.filesInGroup,
     required this.photoGridSize,
     required this.limitSelectionToOne,
     required this.tag,
@@ -43,7 +43,7 @@ class _RecyclableGridViewWidgetState extends State<RecyclableGridViewWidget> {
   @override
   Widget build(BuildContext context) {
     return VisibilityDetector(
-      key: Key("gallery" + widget.filesInDay.first.tag),
+      key: Key("gallery" + widget.filesInGroup.first.tag),
       onVisibilityChanged: (visibility) {
         final shouldRender = visibility.visibleFraction > 0;
         if (mounted && shouldRender != _shouldRender) {
@@ -54,7 +54,7 @@ class _RecyclableGridViewWidgetState extends State<RecyclableGridViewWidget> {
       },
       child: _shouldRender
           ? GalleryGridViewWidget(
-              filesInDay: widget.filesInDay,
+              filesInGroup: widget.filesInGroup,
               photoGridSize: widget.photoGridSize,
               limitSelectionToOne: widget.limitSelectionToOne,
               tag: widget.tag,
@@ -63,7 +63,7 @@ class _RecyclableGridViewWidgetState extends State<RecyclableGridViewWidget> {
               currentUserID: widget.currentUserID,
             )
           : PlaceHolderGridViewWidget(
-              widget.filesInDay.length,
+              widget.filesInGroup.length,
               widget.photoGridSize,
             ),
     );