瀏覽代碼

Add shadow to selection sheet on it's first child

ashilkn 1 年之前
父節點
當前提交
f633652f16

+ 0 - 2
lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart

@@ -3,7 +3,6 @@ import 'package:photos/core/constants.dart';
 import "package:photos/models/collection.dart";
 import "package:photos/models/gallery_type.dart";
 import 'package:photos/models/selected_files.dart';
-import "package:photos/theme/effects.dart";
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/components/bottom_action_bar/action_bar_widget.dart';
 import "package:photos/ui/components/divider_widget.dart";
@@ -36,7 +35,6 @@ class BottomActionBarWidget extends StatelessWidget {
     return Container(
       decoration: BoxDecoration(
         color: backgroundColor ?? colorScheme.backgroundElevated2,
-        boxShadow: shadowFloatFaintLight,
         borderRadius: const BorderRadius.only(
           topLeft: Radius.circular(8),
           topRight: Radius.circular(8),

+ 31 - 25
lib/ui/viewer/actions/file_selection_overlay_bar.dart

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:photos/models/collection.dart';
 import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/selected_files.dart';
+import "package:photos/theme/effects.dart";
 import 'package:photos/ui/components/bottom_action_bar/bottom_action_bar_widget.dart';
 
 class FileSelectionOverlayBar extends StatefulWidget {
@@ -45,31 +46,36 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
       '$runtimeType building with ${widget.selectedFiles.files.length}',
     );
 
-    return ValueListenableBuilder(
-      valueListenable: _hasSelectedFilesNotifier,
-      builder: (context, value, child) {
-        return AnimatedCrossFade(
-          firstCurve: Curves.easeInOutExpo,
-          secondCurve: Curves.easeInOutExpo,
-          sizeCurve: Curves.easeInOutExpo,
-          crossFadeState: _hasSelectedFilesNotifier.value
-              ? CrossFadeState.showFirst
-              : CrossFadeState.showSecond,
-          duration: const Duration(milliseconds: 400),
-          firstChild: BottomActionBarWidget(
-            selectedFiles: widget.selectedFiles,
-            galleryType: widget.galleryType,
-            collection: widget.collection,
-            onCancel: () {
-              if (widget.selectedFiles.files.isNotEmpty) {
-                widget.selectedFiles.clearAll();
-              }
-            },
-            backgroundColor: widget.backgroundColor,
-          ),
-          secondChild: const SizedBox(width: double.infinity),
-        );
-      },
+    return Container(
+      decoration: BoxDecoration(
+        boxShadow: shadowFloatFaintLight,
+      ),
+      child: ValueListenableBuilder(
+        valueListenable: _hasSelectedFilesNotifier,
+        builder: (context, value, child) {
+          return AnimatedCrossFade(
+            firstCurve: Curves.easeInOutExpo,
+            secondCurve: Curves.easeInOutExpo,
+            sizeCurve: Curves.easeInOutExpo,
+            crossFadeState: _hasSelectedFilesNotifier.value
+                ? CrossFadeState.showFirst
+                : CrossFadeState.showSecond,
+            duration: const Duration(milliseconds: 400),
+            firstChild: BottomActionBarWidget(
+              selectedFiles: widget.selectedFiles,
+              galleryType: widget.galleryType,
+              collection: widget.collection,
+              onCancel: () {
+                if (widget.selectedFiles.files.isNotEmpty) {
+                  widget.selectedFiles.clearAll();
+                }
+              },
+              backgroundColor: widget.backgroundColor,
+            ),
+            secondChild: const SizedBox(width: double.infinity),
+          );
+        },
+      ),
     );
   }