Fix type error in ModernGlassButton onPressed: provide always non-null callback with permission check inside
This commit is contained in:
@@ -517,15 +517,28 @@ class _OrganizationSettingsDialogState
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
ModernGlassButton(
|
ModernGlassButton(
|
||||||
onPressed: _canManage ? () {
|
onPressed: () {
|
||||||
|
if (_canManage) {
|
||||||
final username = usernameController.text.trim();
|
final username = usernameController.text.trim();
|
||||||
if (username.isNotEmpty) {
|
if (username.isNotEmpty) {
|
||||||
_inviteUser(username, selectedRole);
|
_inviteUser(username, selectedRole);
|
||||||
usernameController.clear();
|
usernameController.clear();
|
||||||
}
|
}
|
||||||
} : null,
|
} else {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text(
|
||||||
|
'You do not have permission to send invitations',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
child: const Text('Send Invitation'),
|
child: const Text('Send Invitation'),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Invite link section
|
||||||
|
if (_inviteLink != null) ...[
|
||||||
const Divider(),
|
const Divider(),
|
||||||
Text(
|
Text(
|
||||||
'Invite Link',
|
'Invite Link',
|
||||||
|
|||||||
Reference in New Issue
Block a user