visual fix for invitations from #379

Merged
tech merged 1 commits from SEND040 into main 2026-01-30 17:58:10 +00:00
2 changed files with 35 additions and 33 deletions
Showing only changes of commit 4064907921 - Show all commits

View File

@@ -11,10 +11,11 @@ class InvitationFormFields extends StatelessWidget {
final TextEditingController firstNameController;
final TextEditingController lastNameController;
final TextEditingController messageController;
final bool canCreateRoles;
final VoidCallback onCreateRole;
final String? selectedRoleRef;
final ValueChanged<String?> onRoleChanged;
static const double _fieldWidth = 250.0;
static const double _rowSpacing = 40.0;
static const double _rowGap = 12.0;
const InvitationFormFields({
super.key,
@@ -23,8 +24,6 @@ class InvitationFormFields extends StatelessWidget {
required this.firstNameController,
required this.lastNameController,
required this.messageController,
required this.canCreateRoles,
required this.onCreateRole,
required this.selectedRoleRef,
required this.onRoleChanged,
});
@@ -34,12 +33,11 @@ class InvitationFormFields extends StatelessWidget {
final loc = AppLocalizations.of(context)!;
return Column(
children: [
Wrap(
spacing: 12,
runSpacing: 12,
Row(
spacing: _rowSpacing,
children: [
SizedBox(
width: 320,
width: _fieldWidth,
child: TextFormField(
controller: emailController,
decoration: InputDecoration(
@@ -53,28 +51,11 @@ class InvitationFormFields extends StatelessWidget {
),
),
SizedBox(
width: 200,
child: TextFormField(
controller: firstNameController,
decoration: InputDecoration(
labelText: loc.firstName,
prefixIcon: const Icon(Icons.person_outline),
),
),
),
SizedBox(
width: 200,
child: TextFormField(
controller: lastNameController,
decoration: InputDecoration(
labelText: loc.lastName,
prefixIcon: const Icon(Icons.person_outline),
),
),
),
SizedBox(
width: 260,
child: DropdownButtonFormField<String>(
width: _fieldWidth,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DropdownButtonFormField<String>(
initialValue: selectedRoleRef,
items: roles.map((role) => DropdownMenuItem(
value: role.storable.id,
@@ -84,17 +65,40 @@ class InvitationFormFields extends StatelessWidget {
decoration: InputDecoration(
labelText: loc.invitationRoleLabel,
prefixIcon: const Icon(Icons.security_outlined),
suffixIcon: IconButton(
onPressed: canCreateRoles ? onCreateRole : null,
icon: const Icon(Icons.add_circle_outline),
tooltip: loc.invitationAddRoleButton,
),
),
],
),
),
],
),
SizedBox(height: _rowGap),
Row(
spacing: _rowSpacing,
children: [
SizedBox(
width: _fieldWidth,
child: TextFormField(
controller: firstNameController,
decoration: InputDecoration(
labelText: loc.firstName,
prefixIcon: const Icon(Icons.person_outline),
),
),
),
SizedBox(
width: _fieldWidth,
child: TextFormField(
controller: lastNameController,
decoration: InputDecoration(
labelText: loc.lastName,
prefixIcon: const Icon(Icons.person_outline),
),
),
),
],
),
const SizedBox(height: 12),
const SizedBox(height: _rowGap),
TextFormField(
controller: messageController,
minLines: 2,

View File

@@ -70,8 +70,6 @@ class InvitationFormView extends StatelessWidget {
firstNameController: firstNameController,
lastNameController: lastNameController,
messageController: messageController,
canCreateRoles: canCreateRoles,
onCreateRole: onCreateRole,
selectedRoleRef: selectedRoleRef,
onRoleChanged: onRoleChanged,
),