From 01d3ef8a4622a5bd73c07193cd776d1161bb6ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Sat, 24 Jan 2026 03:51:51 +0100 Subject: [PATCH] Fix type error in ModernGlassButton onPressed: provide always non-null callback with permission check inside --- .../widgets/organization_settings_dialog.dart | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/b0esche_cloud/lib/widgets/organization_settings_dialog.dart b/b0esche_cloud/lib/widgets/organization_settings_dialog.dart index 61a335e..0280540 100644 --- a/b0esche_cloud/lib/widgets/organization_settings_dialog.dart +++ b/b0esche_cloud/lib/widgets/organization_settings_dialog.dart @@ -517,15 +517,28 @@ class _OrganizationSettingsDialogState ), const SizedBox(height: 16), ModernGlassButton( - onPressed: _canManage ? () { - final username = usernameController.text.trim(); - if (username.isNotEmpty) { - _inviteUser(username, selectedRole); - usernameController.clear(); + onPressed: () { + if (_canManage) { + final username = usernameController.text.trim(); + if (username.isNotEmpty) { + _inviteUser(username, selectedRole); + usernameController.clear(); + } + } else { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text( + 'You do not have permission to send invitations', + ), + ), + ); } - } : null, + }, child: const Text('Send Invitation'), ), + + // Invite link section + if (_inviteLink != null) ...[ const Divider(), Text( 'Invite Link',