Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix bottom sheet components

AmanRajSinghMourya541734577a2a
diff --git a/mobile/apps/photos/lib/ui/components/alert_bottom_sheet.dart b/mobile/apps/photos/lib/ui/components/alert_bottom_sheet.dart
index 48cf382b8c..e0672ab05c 100644
--- a/mobile/apps/photos/lib/ui/components/alert_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/components/alert_bottom_sheet.dart
@@ -17,6 +17,7 @@ Future<T?> showAlertBottomSheet<T>(
isScrollControlled: true,
isDismissible: isDismissible,
enableDrag: isDismissible,
+ backgroundColor: Colors.transparent,
builder: (context) => AlertBottomSheet<T>(
title: title,
message: message,
@@ -53,7 +54,7 @@ class AlertBottomSheet<T> extends StatelessWidget {
return Container(
decoration: BoxDecoration(
- color: colorScheme.fill,
+ color: colorScheme.backgroundColour,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
@@ -70,22 +71,21 @@ class AlertBottomSheet<T> extends StatelessWidget {
if (showCloseButton)
Row(
mainAxisAlignment: MainAxisAlignment.end,
- children: [BottomSheetCloseButton(onTap: onClose)],
+ children: [
+ BottomSheetCloseButton(
+ onTap: onClose,
+ backgroundColor: colorScheme.fill,
+ iconSize: 18,
+ ),
+ ],
),
- SizedBox(height: showCloseButton ? 4 : 24),
+ if (showCloseButton) const SizedBox(height: 4),
if (assetPath != null) ...[
Center(
- child: SizedBox(
- width: 180,
- height: 120,
- child: Padding(
- padding: const EdgeInsets.only(bottom: 11),
- child: FittedBox(
- alignment: Alignment.bottomCenter,
- fit: BoxFit.scaleDown,
- child: Image.asset(assetPath!),
- ),
- ),
+ child: FittedBox(
+ alignment: Alignment.bottomCenter,
+ fit: BoxFit.scaleDown,
+ child: Image.asset(assetPath!),
),
),
const SizedBox(height: 16),
diff --git a/mobile/apps/photos/lib/utils/dialog_util.dart b/mobile/apps/photos/lib/utils/dialog_util.dart
index 2e784da89d..09d4564503 100644
--- a/mobile/apps/photos/lib/utils/dialog_util.dart
+++ b/mobile/apps/photos/lib/utils/dialog_util.dart
@@ -216,7 +216,7 @@ Future<void> showGenericErrorBottomSheet({
context,
title: AppLocalizations.of(context).error,
message: errorBody,
- assetPath: 'assets/warning-green.png',
+ assetPath: 'assets/warning-grey.png',
buttons: [
ButtonWidgetV2(
buttonType: ButtonTypeV2.secondary,
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.dart
index 11415437bc..96018bef17 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
@@ -12,7 +12,7 @@ import 'package:hugeicons/hugeicons.dart';
/// Figma: https://www.figma.com/design/BuBNPPytxlVnqfmCUW0mgz/Ente-Visual-Design?node-id=4809-7992&m=dev
/// Section: Bottom sheet / Bottom Sheet Header
/// Specs: H2 title, optional 36px circular close action, and optional centered
-/// illustration slot for warning and error sheets.
+/// illustration for warning and error sheets.
class _BottomSheetHeaderComponent extends StatelessWidget {
const _BottomSheetHeaderComponent({
this.title,
@@ -284,7 +284,7 @@ class _CenteredHeader extends StatelessWidget {
if (showCloseButton && (illustration != null || title != null))
const SizedBox(height: Spacing.xs),
if (illustration != null)
- _BottomSheetIllustrationSlot(child: illustration!),
+ _BottomSheetIllustration(child: illustration!),
if (title != null) ...[
SizedBox(height: illustration == null ? 0 : Spacing.lg),
Text(
@@ -300,24 +300,20 @@ class _CenteredHeader extends StatelessWidget {
}
}
-class _BottomSheetIllustrationSlot extends StatelessWidget {
- const _BottomSheetIllustrationSlot({required this.child});
+class _BottomSheetIllustration extends StatelessWidget {
+ const _BottomSheetIllustration({required this.child});
final Widget child;
@override
Widget build(BuildContext context) {
return Center(
- child: SizedBox(
- width: _illustrationSlotWidth,
- height: _illustrationSlotHeight,
- child: Padding(
- padding: const EdgeInsets.only(bottom: _illustrationSlotBottomInset),
- child: FittedBox(
- alignment: Alignment.bottomCenter,
- fit: BoxFit.scaleDown,
- child: child,
- ),
+ child: Padding(
+ padding: const EdgeInsets.only(bottom: _illustrationSlotBottomInset),
+ child: FittedBox(
+ alignment: Alignment.bottomCenter,
+ fit: BoxFit.scaleDown,
+ child: child,
),
),
);
@@ -384,6 +380,4 @@ class _BottomSheetActions extends StatelessWidget {
}
const double _headerHeight = 38;
-const double _illustrationSlotWidth = 180;
-const double _illustrationSlotHeight = 120;
const double _illustrationSlotBottomInset = 11;