forked from baron/baron-sso
ci: enforce flutter/biome format checks and fix front lint violations
This commit is contained in:
@@ -232,13 +232,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
});
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr(
|
||||
'msg.userfront.profile.phone.code_sent',
|
||||
),
|
||||
),
|
||||
),
|
||||
SnackBar(content: Text(tr('msg.userfront.profile.phone.code_sent'))),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -272,11 +266,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
});
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr('msg.userfront.profile.phone.verified'),
|
||||
),
|
||||
),
|
||||
SnackBar(content: Text(tr('msg.userfront.profile.phone.verified'))),
|
||||
);
|
||||
}
|
||||
if (_editingField == 'phone') {
|
||||
@@ -315,17 +305,14 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
}
|
||||
if (newPassword.isEmpty) {
|
||||
setState(
|
||||
() => _passwordError = tr(
|
||||
'msg.userfront.profile.password.new_required',
|
||||
),
|
||||
() =>
|
||||
_passwordError = tr('msg.userfront.profile.password.new_required'),
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (newPassword != confirmPassword) {
|
||||
setState(
|
||||
() => _passwordError = tr(
|
||||
'msg.userfront.profile.password.mismatch',
|
||||
),
|
||||
() => _passwordError = tr('msg.userfront.profile.password.mismatch'),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -347,9 +334,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
_newPasswordController?.clear();
|
||||
_confirmPasswordController?.clear();
|
||||
setState(() {
|
||||
_passwordSuccess = tr(
|
||||
'msg.userfront.profile.password.changed',
|
||||
);
|
||||
_passwordSuccess = tr('msg.userfront.profile.password.changed');
|
||||
});
|
||||
} catch (e) {
|
||||
final message = e.toString().replaceFirst('Exception: ', '');
|
||||
@@ -431,22 +416,14 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
|
||||
if (_editingField == 'name' && nextName.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr('msg.userfront.profile.name_required'),
|
||||
),
|
||||
),
|
||||
SnackBar(content: Text(tr('msg.userfront.profile.name_required'))),
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (_editingField == 'department' && nextDepartment.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr(
|
||||
'msg.userfront.profile.department_required',
|
||||
),
|
||||
),
|
||||
content: Text(tr('msg.userfront.profile.department_required')),
|
||||
),
|
||||
);
|
||||
return;
|
||||
@@ -454,24 +431,14 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
if (_editingField == 'phone') {
|
||||
if (nextPhone.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr(
|
||||
'msg.userfront.profile.phone_required',
|
||||
),
|
||||
),
|
||||
),
|
||||
SnackBar(content: Text(tr('msg.userfront.profile.phone_required'))),
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (_isPhoneChanged && !_isPhoneVerified) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr(
|
||||
'msg.userfront.profile.phone_verify_required',
|
||||
),
|
||||
),
|
||||
content: Text(tr('msg.userfront.profile.phone_verify_required')),
|
||||
),
|
||||
);
|
||||
return;
|
||||
@@ -511,13 +478,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
_departmentTouched = false;
|
||||
});
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr(
|
||||
'msg.userfront.profile.update_success',
|
||||
),
|
||||
),
|
||||
),
|
||||
SnackBar(content: Text(tr('msg.userfront.profile.update_success'))),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -657,10 +618,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
tr(
|
||||
'msg.userfront.profile.greeting',
|
||||
params: {'name': name},
|
||||
),
|
||||
tr('msg.userfront.profile.greeting', params: {'name': name}),
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -833,9 +791,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
child: Text(
|
||||
_isCodeSent
|
||||
? tr('ui.common.resend')
|
||||
: tr(
|
||||
'ui.userfront.profile.phone.request_code',
|
||||
),
|
||||
: tr('ui.userfront.profile.phone.request_code'),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
@@ -859,9 +815,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
onSubmitted: (_) => _verifyCode(profile),
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: tr(
|
||||
'ui.userfront.profile.phone.code_hint',
|
||||
),
|
||||
hintText: tr('ui.userfront.profile.phone.code_hint'),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -877,9 +831,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Text(
|
||||
tr(
|
||||
'msg.userfront.profile.phone.verify_notice',
|
||||
),
|
||||
tr('msg.userfront.profile.phone.verify_notice'),
|
||||
style: const TextStyle(color: Colors.orange, fontSize: 12),
|
||||
),
|
||||
),
|
||||
@@ -898,9 +850,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
tr(
|
||||
'msg.userfront.profile.password.subtitle',
|
||||
),
|
||||
tr('msg.userfront.profile.password.subtitle'),
|
||||
style: const TextStyle(color: Color(0xFF6B7280)),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
@@ -908,9 +858,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
controller: _currentPasswordController,
|
||||
obscureText: !_showCurrentPassword,
|
||||
decoration: InputDecoration(
|
||||
labelText: tr(
|
||||
'ui.userfront.profile.password.current',
|
||||
),
|
||||
labelText: tr('ui.userfront.profile.password.current'),
|
||||
border: const OutlineInputBorder(),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
@@ -929,9 +877,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
controller: _newPasswordController,
|
||||
obscureText: !_showNewPassword,
|
||||
decoration: InputDecoration(
|
||||
labelText: tr(
|
||||
'ui.userfront.profile.password.new',
|
||||
),
|
||||
labelText: tr('ui.userfront.profile.password.new'),
|
||||
border: const OutlineInputBorder(),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
@@ -948,9 +894,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
controller: _confirmPasswordController,
|
||||
obscureText: !_showConfirmPassword,
|
||||
decoration: InputDecoration(
|
||||
labelText: tr(
|
||||
'ui.userfront.profile.password.confirm',
|
||||
),
|
||||
labelText: tr('ui.userfront.profile.password.confirm'),
|
||||
border: const OutlineInputBorder(),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
@@ -986,20 +930,12 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
height: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: Text(
|
||||
tr(
|
||||
'ui.userfront.profile.password.change',
|
||||
),
|
||||
),
|
||||
: Text(tr('ui.userfront.profile.password.change')),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
TextButton(
|
||||
onPressed: () => context.go('/recovery'),
|
||||
child: Text(
|
||||
tr(
|
||||
'ui.userfront.profile.password.forgot',
|
||||
),
|
||||
),
|
||||
child: Text(tr('ui.userfront.profile.password.forgot')),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -1024,9 +960,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
const SizedBox(height: 28),
|
||||
_buildSectionTitle(
|
||||
tr('ui.userfront.profile.section.basic'),
|
||||
tr(
|
||||
'msg.userfront.profile.section.basic',
|
||||
),
|
||||
tr('msg.userfront.profile.section.basic'),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildCard(
|
||||
@@ -1034,9 +968,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
children: [
|
||||
_buildEditableTile(
|
||||
field: 'name',
|
||||
label: tr(
|
||||
'ui.userfront.profile.field.name',
|
||||
),
|
||||
label: tr('ui.userfront.profile.field.name'),
|
||||
value: profile.name,
|
||||
profile: profile,
|
||||
isUpdating: isUpdating,
|
||||
@@ -1044,9 +976,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
),
|
||||
const Divider(height: 24),
|
||||
_buildReadOnlyTile(
|
||||
tr(
|
||||
'ui.userfront.profile.field.email',
|
||||
),
|
||||
tr('ui.userfront.profile.field.email'),
|
||||
profile.email,
|
||||
),
|
||||
const Divider(height: 24),
|
||||
@@ -1056,12 +986,8 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
),
|
||||
const SizedBox(height: 28),
|
||||
_buildSectionTitle(
|
||||
tr(
|
||||
'ui.userfront.profile.section.organization',
|
||||
),
|
||||
tr(
|
||||
'msg.userfront.profile.section.organization',
|
||||
),
|
||||
tr('ui.userfront.profile.section.organization'),
|
||||
tr('msg.userfront.profile.section.organization'),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildCard(
|
||||
@@ -1069,9 +995,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
children: [
|
||||
_buildEditableTile(
|
||||
field: 'department',
|
||||
label: tr(
|
||||
'ui.userfront.profile.field.department',
|
||||
),
|
||||
label: tr('ui.userfront.profile.field.department'),
|
||||
value: profile.department,
|
||||
profile: profile,
|
||||
isUpdating: isUpdating,
|
||||
@@ -1079,26 +1003,20 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
),
|
||||
const Divider(height: 24),
|
||||
_buildReadOnlyTile(
|
||||
tr(
|
||||
'ui.userfront.profile.field.affiliation',
|
||||
),
|
||||
tr('ui.userfront.profile.field.affiliation'),
|
||||
profile.affiliationType,
|
||||
),
|
||||
if (profile.tenant != null) ...[
|
||||
const Divider(height: 24),
|
||||
_buildReadOnlyTile(
|
||||
tr(
|
||||
'ui.userfront.profile.field.tenant',
|
||||
),
|
||||
tr('ui.userfront.profile.field.tenant'),
|
||||
profile.tenant!.name,
|
||||
),
|
||||
],
|
||||
if (profile.companyCode.isNotEmpty) ...[
|
||||
const Divider(height: 24),
|
||||
_buildReadOnlyTile(
|
||||
tr(
|
||||
'ui.userfront.profile.field.company_code',
|
||||
),
|
||||
tr('ui.userfront.profile.field.company_code'),
|
||||
profile.companyCode,
|
||||
),
|
||||
],
|
||||
@@ -1108,9 +1026,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
const SizedBox(height: 28),
|
||||
_buildSectionTitle(
|
||||
tr('ui.userfront.profile.section.security'),
|
||||
tr(
|
||||
'msg.userfront.profile.section.security',
|
||||
),
|
||||
tr('msg.userfront.profile.section.security'),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildPasswordSection(),
|
||||
@@ -1137,20 +1053,14 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
final profile = profileState.value ?? _cachedProfile;
|
||||
if (profile == null) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(tr('ui.userfront.nav.profile')),
|
||||
),
|
||||
appBar: AppBar(title: Text(tr('ui.userfront.nav.profile'))),
|
||||
body: profileState.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
tr(
|
||||
'msg.userfront.profile.load_failed',
|
||||
),
|
||||
),
|
||||
Text(tr('msg.userfront.profile.load_failed')),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
onPressed: () =>
|
||||
|
||||
Reference in New Issue
Block a user