Swap name/client in edit project and auto-focus

This commit is contained in:
Hillel Coren 2021-03-09 21:34:09 +02:00
parent 17cfc3d478
commit ab95c53f85
1 changed files with 9 additions and 8 deletions

View File

@ -148,6 +148,15 @@ class _ProjectEditState extends State<ProjectEdit> {
children: <Widget>[ children: <Widget>[
FormCard( FormCard(
children: <Widget>[ children: <Widget>[
DecoratedFormField(
controller: _nameController,
validator: (String val) => val.trim().isEmpty
? localization.pleaseEnterAName
: null,
autovalidate: _autoValidate,
autofocus: true,
label: localization.projectName,
),
project.isNew project.isNew
? EntityDropdown( ? EntityDropdown(
key: ValueKey('__client_${project.clientId}__'), key: ValueKey('__client_${project.clientId}__'),
@ -177,14 +186,6 @@ class _ProjectEditState extends State<ProjectEdit> {
label: localization.projectNumber, label: localization.projectNumber,
autocorrect: false, autocorrect: false,
), ),
DecoratedFormField(
controller: _nameController,
validator: (String val) => val.trim().isEmpty
? localization.pleaseEnterAName
: null,
autovalidate: _autoValidate,
label: localization.projectName,
),
UserPicker( UserPicker(
userId: project.assignedUserId, userId: project.assignedUserId,
onChanged: (userId) => viewModel.onChanged( onChanged: (userId) => viewModel.onChanged(