diff --git a/lib/Pages/Misc/floating_creation_button.dart b/lib/Pages/Misc/floating_creation_button.dart index 44d9802..714974f 100644 --- a/lib/Pages/Misc/floating_creation_button.dart +++ b/lib/Pages/Misc/floating_creation_button.dart @@ -15,9 +15,11 @@ class FloatingCreationButton extends StatefulWidget { class _FloatingCreationButtonState extends State { final AccountController _accountController = AccountController(); + final _key = GlobalKey(); @override Widget build(final BuildContext context) => ExpandableFab( + key: _key, openButtonBuilder: RotateFloatingActionButtonBuilder( child: const Icon(Icons.add), ), @@ -54,7 +56,14 @@ class _FloatingCreationButtonState extends State { const SizedBox(width: 12), FloatingActionButton.small( heroTag: null, - onPressed: onPressed, + onPressed: () { + onPressed.call(); + + final ExpandableFabState? state = _key.currentState; + if (state != null && state.isOpen) { + state.close(); + } + }, child: Icon(icon), ), ],