π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Respect explicit bottom sheet action spacing
ashilknc5de20cf261b
diff --git a/mobile/packages/ente_components/lib/components/bottom_sheet/bottom_sheet_component.dart b/mobile/packages/ente_components/lib/components/bottom_sheet/bottom_sheet_component.dartindex 2011583989..4061b920cb 100644--- a/mobile/packages/ente_components/lib/components/bottom_sheet/bottom_sheet_component.dart+++ b/mobile/packages/ente_components/lib/components/bottom_sheet/bottom_sheet_component.dart@@ -114,7 +114,7 @@ class BottomSheetComponent extends StatelessWidget {this.crossAxisAlignment = CrossAxisAlignment.start,this.padding = const EdgeInsets.all(Spacing.xl),this.contentSpacing = Spacing.lg,- this.actionsTopSpacing = Spacing.lg,+ this.actionsTopSpacing,this.backgroundColor,this.isKeyboardAware = false,});@@ -137,7 +137,7 @@ class BottomSheetComponent extends StatelessWidget {final CrossAxisAlignment crossAxisAlignment;final EdgeInsets padding;final double contentSpacing;- final double actionsTopSpacing;+ final double? actionsTopSpacing;final Color? backgroundColor;final bool isKeyboardAware;@@ -178,9 +178,8 @@ class BottomSheetComponent extends StatelessWidget {final effectiveContentSpacing = usesCenteredLayout? Spacing.lg: contentSpacing;- final effectiveActionsTopSpacing = usesCenteredLayout- ? Spacing.xxl- : actionsTopSpacing;+ final effectiveActionsTopSpacing =+ actionsTopSpacing ?? (usesCenteredLayout ? Spacing.xxl : Spacing.lg);return AnimatedPadding(duration: const Duration(milliseconds: 200),diff --git a/mobile/packages/ente_components/test/components/bottom_sheet_component_test.dart b/mobile/packages/ente_components/test/components/bottom_sheet_component_test.dartindex 18a69f185f..6cf726b87f 100644--- a/mobile/packages/ente_components/test/components/bottom_sheet_component_test.dart+++ b/mobile/packages/ente_components/test/components/bottom_sheet_component_test.dart@@ -89,6 +89,32 @@ void main() {expect(message.textAlign, TextAlign.center);});+ testWidgets('BottomSheetComponent respects explicit action spacing', (+ tester,+ ) async {+ await tester.pumpWidget(+ _wrap(+ const BottomSheetComponent(+ title: 'Title',+ message: 'Centered message',+ actionsTopSpacing: 7,+ actions: [+ ButtonComponent(key: ValueKey('action-button'), label: 'Action'),+ ],+ ),+ ),+ );++ final messageBottom = tester+ .getBottomLeft(find.text('Centered message'))+ .dy;+ final actionTop = tester+ .getTopLeft(find.byKey(const ValueKey('action-button')))+ .dy;++ expect(actionTop - messageBottom, 7);+ });+testWidgets('BottomSheetComponent dismisses from close button by default', (tester,) async {