From 68e4481f2e1825075c7e9206086b56c53ce799fd Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Sun, 25 Jan 2026 15:56:47 +0100 Subject: [PATCH] =?UTF-8?q?Feat:=20Macht=20Hintergrund=20der=20FloatingCre?= =?UTF-8?q?ationButtons=20leicht=20geblurrt=20f=C3=BCr=20bessere=20Lesbark?= =?UTF-8?q?eit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Pages/Misc/floating_creation_button.dart | 69 +++++++++++++------- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/lib/Pages/Misc/floating_creation_button.dart b/lib/Pages/Misc/floating_creation_button.dart index 5fd2c3b..eea29f3 100644 --- a/lib/Pages/Misc/floating_creation_button.dart +++ b/lib/Pages/Misc/floating_creation_button.dart @@ -1,9 +1,12 @@ +import 'dart:ui'; + import 'package:flutter/material.dart'; import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; import '../../Controller/account_controller.dart'; import '../../Controller/recurring_transaction_controller.dart'; import '../../Controller/transaction_controller.dart'; +import '../../Services/navigation_service.dart'; /// Ein Floating Action Button, der beim Klicken ein expandierendes Menü öffnet, /// um neue Transaktionen oder Konten anzulegen. @@ -80,29 +83,47 @@ class _FloatingCreationButtonState extends State { required final String label, required final IconData icon, required final VoidCallback onPressed, - }) => GestureDetector( - onTap: onPressed, - child: Row( - children: [ - Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)), - child: Text(label), - ), - const SizedBox(width: 12), - FloatingActionButton.small( - heroTag: null, - onPressed: () { - onPressed.call(); + }) { + final ThemeData theme = Theme.of( + NavigationService.getCurrentBuildContext()!, + ); - final ExpandableFabState? state = _key.currentState; - if (state != null && state.isOpen) { - state.close(); - } - }, - child: Icon(icon), - ), - ], - ), - ); + return GestureDetector( + onTap: onPressed, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(8), + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 6, sigmaY: 6), + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 8, + ), + decoration: BoxDecoration( + color: theme.colorScheme.onPrimary.withValues(alpha: 0.15), + borderRadius: BorderRadius.circular(8), + ), + child: Text(label), + ), + ), + ), + const SizedBox(width: 12), + FloatingActionButton.small( + heroTag: null, + onPressed: () { + onPressed.call(); + + final ExpandableFabState? state = _key.currentState; + if (state != null && state.isOpen) { + state.close(); + } + }, + child: Icon(icon), + ), + ], + ), + ); + } }