[mob][photos] Fix Safe area issues (#2703)

This commit is contained in:
Ashil
2024-08-14 17:33:45 +05:30
committed by GitHub
6 changed files with 113 additions and 99 deletions

View File

@@ -140,6 +140,8 @@ PODS:
- Mantle (2.2.0):
- Mantle/extobjc (= 2.2.0)
- Mantle/extobjc (2.2.0)
- maps_launcher (0.0.1):
- Flutter
- media_extension (0.0.1):
- Flutter
- media_kit_libs_ios_video (1.0.4):
@@ -269,6 +271,7 @@ DEPENDENCIES:
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`)
- maps_launcher (from `.symlinks/plugins/maps_launcher/ios`)
- media_extension (from `.symlinks/plugins/media_extension/ios`)
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
@@ -377,6 +380,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/local_auth_darwin/darwin"
local_auth_ios:
:path: ".symlinks/plugins/local_auth_ios/ios"
maps_launcher:
:path: ".symlinks/plugins/maps_launcher/ios"
media_extension:
:path: ".symlinks/plugins/media_extension/ios"
media_kit_libs_ios_video:
@@ -472,6 +477,7 @@ SPEC CHECKSUMS:
local_auth_darwin: c7e464000a6a89e952235699e32b329457608d98
local_auth_ios: 5046a18c018dd973247a0564496c8898dbb5adf9
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
maps_launcher: 2e5b6a2d664ec6c27f82ffa81b74228d770ab203
media_extension: 6d30dc1431ebaa63f43c397c37917b1a0a597a4c
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a

View File

@@ -73,46 +73,48 @@ class ActionSheetWidget extends StatelessWidget {
title == null && bodyWidget == null && body == null;
final extraWidth = MediaQuery.of(context).size.width - restrictedMaxWidth;
final double? horizontalPadding = extraWidth > 0 ? extraWidth / 2 : null;
return Padding(
padding: EdgeInsets.fromLTRB(
horizontalPadding ?? 12,
12,
horizontalPadding ?? 12,
32,
),
child: Container(
decoration: BoxDecoration(boxShadow: shadowMenuLight),
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: Container(
color: backgroundElevated2Dark,
child: Padding(
padding: EdgeInsets.fromLTRB(
24,
24,
24,
isTitleAndBodyNull ? 24 : 28,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
isTitleAndBodyNull
? const SizedBox.shrink()
: Padding(
padding: const EdgeInsets.only(bottom: 36),
child: ContentContainerWidget(
title: title,
bodyWidget: bodyWidget,
body: body,
bodyHighlight: bodyHighlight,
actionSheetType: actionSheetType,
isCheckIconGreen: isCheckIconGreen,
return SafeArea(
child: Padding(
padding: EdgeInsets.fromLTRB(
horizontalPadding ?? 12,
12,
horizontalPadding ?? 12,
32,
),
child: Container(
decoration: BoxDecoration(boxShadow: shadowMenuLight),
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: Container(
color: backgroundElevated2Dark,
child: Padding(
padding: EdgeInsets.fromLTRB(
24,
24,
24,
isTitleAndBodyNull ? 24 : 28,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
isTitleAndBodyNull
? const SizedBox.shrink()
: Padding(
padding: const EdgeInsets.only(bottom: 36),
child: ContentContainerWidget(
title: title,
bodyWidget: bodyWidget,
body: body,
bodyHighlight: bodyHighlight,
actionSheetType: actionSheetType,
isCheckIconGreen: isCheckIconGreen,
),
),
),
ActionButtons(
actionButtons,
),
],
ActionButtons(
actionButtons,
),
],
),
),
),
),

View File

@@ -71,11 +71,15 @@ class _MapPullUpGalleryState extends State<MapPullUpGallery> {
},
),
DeferPointer(
child: FileSelectionOverlayBar(
GalleryType.searchResults,
_selectedFiles,
backgroundColor:
getEnteColorScheme(context).backgroundElevated2,
//This is to make the FileSelectionOverlayBar respect SafeArea
child: MediaQuery(
data: MediaQueryData.fromView(View.of(context)),
child: FileSelectionOverlayBar(
GalleryType.searchResults,
_selectedFiles,
backgroundColor:
getEnteColorScheme(context).backgroundElevated2,
),
),
),
],

View File

@@ -175,7 +175,9 @@ class SubFaqWidget extends StatelessWidget {
barrierColor: Colors.black87,
context: context,
builder: (context) {
return const BillingQuestionsWidget();
return const SafeArea(
child: BillingQuestionsWidget(),
);
},
);
},

View File

@@ -1,4 +1,3 @@
import 'dart:io';
import 'dart:ui';
import 'package:animated_list_plus/animated_list_plus.dart';
@@ -14,6 +13,7 @@ import 'package:photos/generated/l10n.dart';
import 'package:photos/models/device_collection.dart';
import 'package:photos/models/file/file.dart';
import 'package:photos/services/remote_sync_service.dart';
import "package:photos/theme/ente_theme.dart";
import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/viewer/file/thumbnail_widget.dart';
import 'package:photos/utils/dialog_util.dart';
@@ -148,61 +148,61 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
},
),
Expanded(child: _getFolders()),
Column(
children: [
Container(
width: double.infinity,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Theme.of(context).colorScheme.background,
blurRadius: 24,
offset: const Offset(0, -8),
spreadRadius: 4,
),
],
),
padding: widget.isOnboarding
? const EdgeInsets.only(left: 20, right: 20)
: EdgeInsets.only(
top: 16,
left: 20,
right: 20,
bottom: Platform.isIOS ? 60 : 32,
),
child: OutlinedButton(
onPressed:
widget.isOnboarding && _selectedDevicePathIDs.isEmpty
? null
: () async {
await updateFolderSettings();
},
child: Text(widget.buttonText),
),
),
widget.isOnboarding
? GestureDetector(
key: const ValueKey("skipBackupButton"),
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
},
child: Padding(
padding: EdgeInsets.only(
top: 16,
bottom: Platform.isIOS ? 48 : 32,
SafeArea(
child: Padding(
padding: const EdgeInsets.only(bottom: 12),
child: Column(
children: [
Container(
width: double.infinity,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: getEnteColorScheme(context).backgroundBase,
blurRadius: 24,
offset: const Offset(0, -8),
spreadRadius: 4,
),
child: Text(
S.of(context).skip,
style:
Theme.of(context).textTheme.bodySmall!.copyWith(
],
),
padding: const EdgeInsets.only(left: 20, right: 20),
child: OutlinedButton(
onPressed:
widget.isOnboarding && _selectedDevicePathIDs.isEmpty
? null
: () async {
await updateFolderSettings();
},
child: Text(widget.buttonText),
),
),
widget.isOnboarding
? const SizedBox(height: 20)
: const SizedBox.shrink(),
widget.isOnboarding
? GestureDetector(
key: const ValueKey("skipBackupButton"),
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
},
child: Padding(
padding: const EdgeInsets.only(bottom: 8),
child: Text(
S.of(context).skip,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(
decoration: TextDecoration.underline,
),
),
),
)
: const SizedBox.shrink(),
],
),
),
)
: const SizedBox.shrink(),
],
),
),
),
],
),

View File

@@ -84,7 +84,7 @@ class _SharedCollectionsTabState extends State<SharedCollectionsTab>
(snapshot.data?.outgoing.length ?? 0) == 0) {
return const Center(child: SharedEmptyStateWidget());
}
return _getSharedCollectionsGallery(snapshot.data!);
return SafeArea(child: _getSharedCollectionsGallery(snapshot.data!));
} else if (snapshot.hasError) {
_logger.severe(
"critical: failed to load share gallery",