Use transparent barrier for FsDialogs.

This commit is contained in:
Dain Nilsson 2023-08-16 16:52:49 +02:00
parent 9f3cf07253
commit 9648a1396c
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
6 changed files with 13 additions and 2 deletions

View File

@ -32,10 +32,12 @@ Future<T?> showBlurDialog<T>({
required BuildContext context, required BuildContext context,
required Widget Function(BuildContext) builder, required Widget Function(BuildContext) builder,
RouteSettings? routeSettings, RouteSettings? routeSettings,
Color barrierColor = const Color(0x80000000),
}) async => }) async =>
await showGeneralDialog<T>( await showGeneralDialog<T>(
context: context, context: context,
barrierDismissible: true, barrierDismissible: true,
barrierColor: barrierColor,
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
pageBuilder: (ctx, anim1, anim2) => builder(ctx), pageBuilder: (ctx, anim1, anim2) => builder(ctx),
transitionDuration: const Duration(milliseconds: 150), transitionDuration: const Duration(milliseconds: 150),

View File

@ -224,7 +224,11 @@ class AppPage extends StatelessWidget {
child: IconButton( child: IconButton(
key: actionsIconButtonKey, key: actionsIconButtonKey,
onPressed: () { onPressed: () {
showBlurDialog(context: context, builder: keyActionsBuilder!); showBlurDialog(
context: context,
barrierColor: Colors.transparent,
builder: keyActionsBuilder!,
);
}, },
icon: keyActionsBadge icon: keyActionsBadge
? const Badge( ? const Badge(

View File

@ -26,7 +26,8 @@ class FsDialog extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context)!; final l10n = AppLocalizations.of(context)!;
return Dialog.fullscreen( return Dialog.fullscreen(
backgroundColor: Theme.of(context).colorScheme.background.withAlpha(100), backgroundColor:
Theme.of(context).colorScheme.background.withOpacity(0.7),
child: SafeArea( child: SafeArea(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

@ -59,6 +59,7 @@ class FidoUnlockedPage extends ConsumerWidget {
OpenIntent: CallbackAction<OpenIntent>( OpenIntent: CallbackAction<OpenIntent>(
onInvoke: (_) => showBlurDialog( onInvoke: (_) => showBlurDialog(
context: context, context: context,
barrierColor: Colors.transparent,
builder: (context) => CredentialDialog(cred), builder: (context) => CredentialDialog(cred),
)), )),
DeleteIntent: CallbackAction<DeleteIntent>( DeleteIntent: CallbackAction<DeleteIntent>(
@ -91,6 +92,7 @@ class FidoUnlockedPage extends ConsumerWidget {
OpenIntent: CallbackAction<OpenIntent>( OpenIntent: CallbackAction<OpenIntent>(
onInvoke: (_) => showBlurDialog( onInvoke: (_) => showBlurDialog(
context: context, context: context,
barrierColor: Colors.transparent,
builder: (context) => FingerprintDialog(fp), builder: (context) => FingerprintDialog(fp),
)), )),
EditIntent: CallbackAction<EditIntent>( EditIntent: CallbackAction<EditIntent>(

View File

@ -89,6 +89,7 @@ class _AccountViewState extends ConsumerState<AccountView> {
OpenIntent: CallbackAction<OpenIntent>(onInvoke: (_) async { OpenIntent: CallbackAction<OpenIntent>(onInvoke: (_) async {
await showBlurDialog( await showBlurDialog(
context: context, context: context,
barrierColor: Colors.transparent,
builder: (context) => AccountDialog(credential), builder: (context) => AccountDialog(credential),
); );
return null; return null;

View File

@ -70,6 +70,7 @@ class PivScreen extends ConsumerWidget {
CallbackAction<OpenIntent>(onInvoke: (_) async { CallbackAction<OpenIntent>(onInvoke: (_) async {
await showBlurDialog( await showBlurDialog(
context: context, context: context,
barrierColor: Colors.transparent,
builder: (context) => SlotDialog(e.slot), builder: (context) => SlotDialog(e.slot),
); );
return null; return null;