From 9648a1396cc4e972591356970ed37510db914fca Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Wed, 16 Aug 2023 16:52:49 +0200 Subject: [PATCH] Use transparent barrier for FsDialogs. --- lib/app/message.dart | 2 ++ lib/app/views/app_page.dart | 6 +++++- lib/app/views/fs_dialog.dart | 3 ++- lib/fido/views/unlocked_page.dart | 2 ++ lib/oath/views/account_view.dart | 1 + lib/piv/views/piv_screen.dart | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/app/message.dart b/lib/app/message.dart index db7fcda8..2b2f2b41 100755 --- a/lib/app/message.dart +++ b/lib/app/message.dart @@ -32,10 +32,12 @@ Future showBlurDialog({ required BuildContext context, required Widget Function(BuildContext) builder, RouteSettings? routeSettings, + Color barrierColor = const Color(0x80000000), }) async => await showGeneralDialog( context: context, barrierDismissible: true, + barrierColor: barrierColor, barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, pageBuilder: (ctx, anim1, anim2) => builder(ctx), transitionDuration: const Duration(milliseconds: 150), diff --git a/lib/app/views/app_page.dart b/lib/app/views/app_page.dart index b8ad31f8..f4e14ecd 100755 --- a/lib/app/views/app_page.dart +++ b/lib/app/views/app_page.dart @@ -224,7 +224,11 @@ class AppPage extends StatelessWidget { child: IconButton( key: actionsIconButtonKey, onPressed: () { - showBlurDialog(context: context, builder: keyActionsBuilder!); + showBlurDialog( + context: context, + barrierColor: Colors.transparent, + builder: keyActionsBuilder!, + ); }, icon: keyActionsBadge ? const Badge( diff --git a/lib/app/views/fs_dialog.dart b/lib/app/views/fs_dialog.dart index d76fa7de..029538f5 100644 --- a/lib/app/views/fs_dialog.dart +++ b/lib/app/views/fs_dialog.dart @@ -26,7 +26,8 @@ class FsDialog extends StatelessWidget { Widget build(BuildContext context) { final l10n = AppLocalizations.of(context)!; return Dialog.fullscreen( - backgroundColor: Theme.of(context).colorScheme.background.withAlpha(100), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.7), child: SafeArea( child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/fido/views/unlocked_page.dart b/lib/fido/views/unlocked_page.dart index bf796e31..05395b53 100755 --- a/lib/fido/views/unlocked_page.dart +++ b/lib/fido/views/unlocked_page.dart @@ -59,6 +59,7 @@ class FidoUnlockedPage extends ConsumerWidget { OpenIntent: CallbackAction( onInvoke: (_) => showBlurDialog( context: context, + barrierColor: Colors.transparent, builder: (context) => CredentialDialog(cred), )), DeleteIntent: CallbackAction( @@ -91,6 +92,7 @@ class FidoUnlockedPage extends ConsumerWidget { OpenIntent: CallbackAction( onInvoke: (_) => showBlurDialog( context: context, + barrierColor: Colors.transparent, builder: (context) => FingerprintDialog(fp), )), EditIntent: CallbackAction( diff --git a/lib/oath/views/account_view.dart b/lib/oath/views/account_view.dart index 8beed7dc..09222c47 100755 --- a/lib/oath/views/account_view.dart +++ b/lib/oath/views/account_view.dart @@ -89,6 +89,7 @@ class _AccountViewState extends ConsumerState { OpenIntent: CallbackAction(onInvoke: (_) async { await showBlurDialog( context: context, + barrierColor: Colors.transparent, builder: (context) => AccountDialog(credential), ); return null; diff --git a/lib/piv/views/piv_screen.dart b/lib/piv/views/piv_screen.dart index 57b0f8ff..e54b879b 100644 --- a/lib/piv/views/piv_screen.dart +++ b/lib/piv/views/piv_screen.dart @@ -70,6 +70,7 @@ class PivScreen extends ConsumerWidget { CallbackAction(onInvoke: (_) async { await showBlurDialog( context: context, + barrierColor: Colors.transparent, builder: (context) => SlotDialog(e.slot), ); return null;