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_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<FloatingCreationButton> {
required final String label,
required final IconData icon,
required final VoidCallback onPressed,
}) => GestureDetector(
onTap: onPressed,
child: Row(
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 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: <Widget>[
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),
),
],
),
);
}
}