Feat: Macht Hintergrund der FloatingCreationButtons leicht geblurrt für bessere Lesbarkeit

This commit is contained in:
2026-01-25 15:56:47 +01:00
parent 1ee4458f6f
commit 68e4481f2e

View File

@@ -1,9 +1,12 @@
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
import '../../Controller/account_controller.dart'; import '../../Controller/account_controller.dart';
import '../../Controller/recurring_transaction_controller.dart'; import '../../Controller/recurring_transaction_controller.dart';
import '../../Controller/transaction_controller.dart'; import '../../Controller/transaction_controller.dart';
import '../../Services/navigation_service.dart';
/// Ein Floating Action Button, der beim Klicken ein expandierendes Menü öffnet, /// Ein Floating Action Button, der beim Klicken ein expandierendes Menü öffnet,
/// um neue Transaktionen oder Konten anzulegen. /// um neue Transaktionen oder Konten anzulegen.
@@ -80,29 +83,47 @@ class _FloatingCreationButtonState extends State<FloatingCreationButton> {
required final String label, required final String label,
required final IconData icon, required final IconData icon,
required final VoidCallback onPressed, required final VoidCallback onPressed,
}) => GestureDetector( }) {
onTap: onPressed, final ThemeData theme = Theme.of(
child: Row( NavigationService.getCurrentBuildContext()!,
children: <Widget>[ );
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 ExpandableFabState? state = _key.currentState; return GestureDetector(
if (state != null && state.isOpen) { onTap: onPressed,
state.close(); child: Row(
} children: <Widget>[
}, ClipRRect(
child: Icon(icon), 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),
),
],
),
);
}
} }