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 Widget Function(BuildContext) builder,
RouteSettings? routeSettings,
Color barrierColor = const Color(0x80000000),
}) async =>
await showGeneralDialog<T>(
context: context,
barrierDismissible: true,
barrierColor: barrierColor,
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
pageBuilder: (ctx, anim1, anim2) => builder(ctx),
transitionDuration: const Duration(milliseconds: 150),

View File

@ -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(

View File

@ -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,

View File

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

View File

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

View File

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