1
0
forked from baron/baron-sso

dev 반영 code-check 오류 수정

This commit is contained in:
2026-03-31 13:03:16 +09:00
parent 98bb6be549
commit e927fa8ea0
8 changed files with 304 additions and 110 deletions

View File

@@ -768,6 +768,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
}) {
final isEditing = _editingField == field;
final displayValue = value.isEmpty ? '-' : value;
final isCompact = MediaQuery.of(context).size.width < 640;
if (!isEditing) {
return ListTile(
@@ -784,57 +785,64 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
final hasChanged = _hasFieldChanged(profile, field);
final inputField = TextField(
key: Key('profile-$field-input'),
controller: controller,
focusNode: field == 'name' ? _nameFocus : _departmentFocus,
textInputAction: TextInputAction.done,
onSubmitted: (_) => _saveField(profile),
onChanged: (_) {
setState(() {
_fieldSaveError = null;
});
},
decoration: InputDecoration(
border: const OutlineInputBorder(),
hintText: label,
errorText: _fieldSaveError,
),
);
final saveButton = ElevatedButton(
key: Key('profile-$field-save-button'),
onPressed: isUpdating || !hasChanged || _isSavingField
? null
: () => _saveField(profile),
child: _isSavingField
? const SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(strokeWidth: 2),
)
: Text(tr('ui.common.save')),
);
final cancelButton = OutlinedButton(
key: Key('profile-$field-cancel-button'),
onPressed: isUpdating || _isSavingField
? null
: () => _cancelEditing(profile),
child: Text(tr('ui.common.cancel')),
);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label, style: const TextStyle(fontWeight: FontWeight.w600)),
const SizedBox(height: 8),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: TextField(
key: Key('profile-$field-input'),
controller: controller,
focusNode: field == 'name' ? _nameFocus : _departmentFocus,
textInputAction: TextInputAction.done,
onSubmitted: (_) => _saveField(profile),
onChanged: (_) {
setState(() {
_fieldSaveError = null;
});
},
decoration: InputDecoration(
border: const OutlineInputBorder(),
hintText: label,
errorText: _fieldSaveError,
),
),
),
const SizedBox(width: 12),
ElevatedButton(
key: Key('profile-$field-save-button'),
onPressed: isUpdating || !hasChanged || _isSavingField
? null
: () => _saveField(profile),
child: _isSavingField
? const SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(strokeWidth: 2),
)
: Text(tr('ui.common.save')),
),
const SizedBox(width: 8),
OutlinedButton(
key: Key('profile-$field-cancel-button'),
onPressed: isUpdating || _isSavingField
? null
: () => _cancelEditing(profile),
child: Text(tr('ui.common.cancel')),
),
],
),
if (isCompact) ...[
inputField,
const SizedBox(height: 12),
Wrap(spacing: 8, runSpacing: 8, children: [saveButton, cancelButton]),
] else
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: inputField),
const SizedBox(width: 12),
saveButton,
const SizedBox(width: 8),
cancelButton,
],
),
],
);
}