visual fix for invitations from
This commit is contained in:
@@ -11,10 +11,11 @@ class InvitationFormFields extends StatelessWidget {
|
|||||||
final TextEditingController firstNameController;
|
final TextEditingController firstNameController;
|
||||||
final TextEditingController lastNameController;
|
final TextEditingController lastNameController;
|
||||||
final TextEditingController messageController;
|
final TextEditingController messageController;
|
||||||
final bool canCreateRoles;
|
|
||||||
final VoidCallback onCreateRole;
|
|
||||||
final String? selectedRoleRef;
|
final String? selectedRoleRef;
|
||||||
final ValueChanged<String?> onRoleChanged;
|
final ValueChanged<String?> onRoleChanged;
|
||||||
|
static const double _fieldWidth = 250.0;
|
||||||
|
static const double _rowSpacing = 40.0;
|
||||||
|
static const double _rowGap = 12.0;
|
||||||
|
|
||||||
const InvitationFormFields({
|
const InvitationFormFields({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -23,8 +24,6 @@ class InvitationFormFields extends StatelessWidget {
|
|||||||
required this.firstNameController,
|
required this.firstNameController,
|
||||||
required this.lastNameController,
|
required this.lastNameController,
|
||||||
required this.messageController,
|
required this.messageController,
|
||||||
required this.canCreateRoles,
|
|
||||||
required this.onCreateRole,
|
|
||||||
required this.selectedRoleRef,
|
required this.selectedRoleRef,
|
||||||
required this.onRoleChanged,
|
required this.onRoleChanged,
|
||||||
});
|
});
|
||||||
@@ -34,12 +33,11 @@ class InvitationFormFields extends StatelessWidget {
|
|||||||
final loc = AppLocalizations.of(context)!;
|
final loc = AppLocalizations.of(context)!;
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Wrap(
|
Row(
|
||||||
spacing: 12,
|
spacing: _rowSpacing,
|
||||||
runSpacing: 12,
|
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 320,
|
width: _fieldWidth,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: emailController,
|
controller: emailController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -53,28 +51,11 @@ class InvitationFormFields extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 200,
|
width: _fieldWidth,
|
||||||
child: TextFormField(
|
child: Column(
|
||||||
controller: firstNameController,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
decoration: InputDecoration(
|
children: [
|
||||||
labelText: loc.firstName,
|
DropdownButtonFormField<String>(
|
||||||
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>(
|
|
||||||
initialValue: selectedRoleRef,
|
initialValue: selectedRoleRef,
|
||||||
items: roles.map((role) => DropdownMenuItem(
|
items: roles.map((role) => DropdownMenuItem(
|
||||||
value: role.storable.id,
|
value: role.storable.id,
|
||||||
@@ -84,17 +65,40 @@ class InvitationFormFields extends StatelessWidget {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: loc.invitationRoleLabel,
|
labelText: loc.invitationRoleLabel,
|
||||||
prefixIcon: const Icon(Icons.security_outlined),
|
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(
|
TextFormField(
|
||||||
controller: messageController,
|
controller: messageController,
|
||||||
minLines: 2,
|
minLines: 2,
|
||||||
|
|||||||
@@ -70,8 +70,6 @@ class InvitationFormView extends StatelessWidget {
|
|||||||
firstNameController: firstNameController,
|
firstNameController: firstNameController,
|
||||||
lastNameController: lastNameController,
|
lastNameController: lastNameController,
|
||||||
messageController: messageController,
|
messageController: messageController,
|
||||||
canCreateRoles: canCreateRoles,
|
|
||||||
onCreateRole: onCreateRole,
|
|
||||||
selectedRoleRef: selectedRoleRef,
|
selectedRoleRef: selectedRoleRef,
|
||||||
onRoleChanged: onRoleChanged,
|
onRoleChanged: onRoleChanged,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user