From 7b2f98a433351bd8f02e86324c2c3b9ba51730fc Mon Sep 17 00:00:00 2001 From: Lauritz Tieste <84938977+Lauritz-Tieste@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:53:44 +0200 Subject: [PATCH] feat(mobile): Add dismiss action on app_bar_dialog (#12511) Add dismiss action on app_bar_dialog --- .../common/app_bar_dialog/app_bar_dialog.dart | 63 ++++++++++--------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/mobile/lib/widgets/common/app_bar_dialog/app_bar_dialog.dart b/mobile/lib/widgets/common/app_bar_dialog/app_bar_dialog.dart index 1c9713f4d7..cd694336bc 100644 --- a/mobile/lib/widgets/common/app_bar_dialog/app_bar_dialog.dart +++ b/mobile/lib/widgets/common/app_bar_dialog/app_bar_dialog.dart @@ -237,35 +237,40 @@ class ImmichAppBarDialog extends HookConsumerWidget { ); } - return Dialog( - clipBehavior: Clip.hardEdge, - alignment: Alignment.topCenter, - insetPadding: EdgeInsets.only( - top: isHorizontal ? 20 : 40, - left: horizontalPadding, - right: horizontalPadding, - bottom: isHorizontal ? 20 : 100, - ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20), - ), - child: SizedBox( - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - padding: const EdgeInsets.all(20), - child: buildTopRow(), - ), - const AppBarProfileInfoBox(), - buildStorageInformation(), - const AppBarServerInfo(), - buildAppLogButton(), - buildSettingButton(), - buildSignOutButton(), - buildFooter(), - ], + return Dismissible( + direction: DismissDirection.down, + onDismissed: (_) => Navigator.of(context).pop(), + key: const Key('app_bar_dialog'), + child: Dialog( + clipBehavior: Clip.hardEdge, + alignment: Alignment.topCenter, + insetPadding: EdgeInsets.only( + top: isHorizontal ? 20 : 40, + left: horizontalPadding, + right: horizontalPadding, + bottom: isHorizontal ? 20 : 100, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + ), + child: SizedBox( + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: const EdgeInsets.all(20), + child: buildTopRow(), + ), + const AppBarProfileInfoBox(), + buildStorageInformation(), + const AppBarServerInfo(), + buildAppLogButton(), + buildSettingButton(), + buildSignOutButton(), + buildFooter(), + ], + ), ), ), ),