1
0
forked from baron/baron-sso

ci: enforce flutter/biome format checks and fix front lint violations

This commit is contained in:
Lectom C Han
2026-02-20 10:25:45 +09:00
parent 226a236bf2
commit c117e10f48
31 changed files with 472 additions and 709 deletions

View File

@@ -39,9 +39,7 @@ class ErrorScreen extends StatelessWidget {
'msg.userfront.error.title_with_code',
params: {'code': normalizedCode},
)
: tr(
'msg.userfront.error.title_generic',
));
: tr('msg.userfront.error.title_generic'));
final detail = isProd
? (isInternalWhitelisted
? tr(
@@ -51,23 +49,16 @@ class ErrorScreen extends StatelessWidget {
: (isOryBypass
? tr(
'msg.userfront.error.ory.$normalizedCode',
fallback:
(description?.isNotEmpty == true)
? description
: tr('msg.userfront.error.detail_request'),
fallback: (description?.isNotEmpty == true)
? description
: tr('msg.userfront.error.detail_request'),
)
: tr(
'msg.userfront.error.detail_contact',
)))
: tr('msg.userfront.error.detail_contact')))
: ((description?.isNotEmpty == true)
? description!
: (hasCode
? tr(
'msg.userfront.error.detail_generic',
)
: tr(
'msg.userfront.error.detail_request',
)));
? tr('msg.userfront.error.detail_generic')
: tr('msg.userfront.error.detail_request')));
return Scaffold(
backgroundColor: const Color(0xFFF7F8FA),
@@ -104,10 +95,7 @@ class ErrorScreen extends StatelessWidget {
),
const SizedBox(height: 12),
Text(
tr(
'msg.userfront.error.type',
params: {'type': errorType},
),
tr('msg.userfront.error.type', params: {'type': errorType}),
style: theme.textTheme.bodySmall?.copyWith(
color: const Color(0xFF6B7280),
),
@@ -115,10 +103,7 @@ class ErrorScreen extends StatelessWidget {
if (errorId != null && errorId!.isNotEmpty) ...[
const SizedBox(height: 12),
Text(
tr(
'msg.userfront.error.id',
params: {'id': errorId!},
),
tr('msg.userfront.error.id', params: {'id': errorId!}),
style: theme.textTheme.bodySmall?.copyWith(
color: const Color(0xFF6B7280),
),
@@ -142,11 +127,7 @@ class ErrorScreen extends StatelessWidget {
borderRadius: BorderRadius.circular(10),
),
),
child: Text(
tr(
'ui.userfront.error.go_login',
),
),
child: Text(tr('ui.userfront.error.go_login')),
),
OutlinedButton(
onPressed: () => context.go('/'),
@@ -161,9 +142,7 @@ class ErrorScreen extends StatelessWidget {
borderRadius: BorderRadius.circular(10),
),
),
child: Text(
tr('ui.userfront.error.go_home'),
),
child: Text(tr('ui.userfront.error.go_home')),
),
],
),

View File

@@ -25,11 +25,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
Future<void> _handlePasswordReset() async {
final input = _loginIdController.text.trim();
if (input.isEmpty) {
_showError(
tr(
'msg.userfront.forgot.input_required',
),
);
_showError(tr('msg.userfront.forgot.input_required'));
return;
}
@@ -52,11 +48,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
tr(
'msg.userfront.forgot.sent',
),
),
content: Text(tr('msg.userfront.forgot.sent')),
backgroundColor: Colors.green,
),
);
@@ -65,10 +57,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
} catch (e) {
if (mounted) {
_showError(
tr(
'msg.userfront.forgot.error',
params: {'error': e.toString()},
),
tr('msg.userfront.forgot.error', params: {'error': e.toString()}),
);
}
} finally {
@@ -133,9 +122,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
const SizedBox(width: 8),
Expanded(
child: Text(
tr(
'msg.userfront.forgot.dry_send',
),
tr('msg.userfront.forgot.dry_send'),
style: const TextStyle(
color: Color(0xFF8A6D3B),
fontSize: 12,
@@ -148,9 +135,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
],
const SizedBox(height: 16),
Text(
tr(
'msg.userfront.forgot.description',
),
tr('msg.userfront.forgot.description'),
textAlign: TextAlign.center,
style: const TextStyle(color: Colors.grey),
),
@@ -158,9 +143,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
TextField(
controller: _loginIdController,
decoration: InputDecoration(
labelText: tr(
'ui.userfront.forgot.input_label',
),
labelText: tr('ui.userfront.forgot.input_label'),
border: const OutlineInputBorder(),
prefixIcon: const Icon(Icons.person_outline),
),
@@ -181,9 +164,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
color: Colors.white,
),
)
: Text(
tr('ui.userfront.forgot.submit'),
),
: Text(tr('ui.userfront.forgot.submit')),
),
],
),

View File

@@ -900,8 +900,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
_onLoginSuccess(jwt, provider: provider, redirectTo: redirectTo);
} else if (redirectTo != null && redirectTo.isNotEmpty) {
webWindow.redirectTo(redirectTo);
} else {
}
} else {}
} catch (e) {
if (e.toString().contains("User not registered")) {
_showUnregisteredDialog();
@@ -1124,11 +1123,14 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
}
}
Future<void> _onLoginSuccess(String token, {String? provider, String? redirectTo}) async {
Future<void> _onLoginSuccess(
String token, {
String? provider,
String? redirectTo,
}) async {
try {
if (!mounted) {
return;
return;
}
// [Priority 1] Immediate External Redirection
@@ -1139,7 +1141,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
} catch (stErr) {
// ignore
}
webWindow.redirectTo(redirectTo); // Removed await as it's void
return;
}
@@ -1150,24 +1152,19 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
// Save token first, it's needed for acceptance
final providerName = provider ?? AuthTokenStore.getProvider();
AuthTokenStore.setToken(token, provider: providerName);
final res = await AuthProxyService.acceptOidcLogin(
_loginChallenge!,
token: token,
);
final nextRedirectTo = res['redirectTo'] as String?;
if (nextRedirectTo != null && nextRedirectTo.isNotEmpty) {
webWindow.redirectTo(nextRedirectTo); // Removed await
return;
} else {
}
} else {}
} catch (e) {
_showError(
tr(
'msg.userfront.login.oidc_failed',
),
);
_showError(tr('msg.userfront.login.oidc_failed'));
return;
}
}
@@ -1188,7 +1185,8 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
final uri = Uri.base;
final redirectParam =
uri.queryParameters['redirect_uri'] ?? uri.queryParameters['redirect_url'];
uri.queryParameters['redirect_uri'] ??
uri.queryParameters['redirect_url'];
final hasRedirectParam =
redirectParam != null && redirectParam.isNotEmpty;

View File

@@ -26,9 +26,7 @@ class LoginSuccessScreen extends StatelessWidget {
),
const SizedBox(height: 16),
Text(
tr(
'msg.userfront.login_success.subtitle',
),
tr('msg.userfront.login_success.subtitle'),
textAlign: TextAlign.center,
style: const TextStyle(color: Colors.grey, fontSize: 16),
),
@@ -40,11 +38,7 @@ class LoginSuccessScreen extends StatelessWidget {
context.push('/scan');
},
icon: const Icon(Icons.camera_alt, size: 28),
label: Text(
tr(
'ui.userfront.login_success.qr',
),
),
label: Text(tr('ui.userfront.login_success.qr')),
style: FilledButton.styleFrom(
minimumSize: const Size.fromHeight(80), // 버튼 높이를 더 크게
backgroundColor: Colors.blue.shade700,
@@ -63,9 +57,7 @@ class LoginSuccessScreen extends StatelessWidget {
context.go('/');
},
child: Text(
tr(
'ui.userfront.login_success.later',
),
tr('ui.userfront.login_success.later'),
style: const TextStyle(color: Colors.grey),
),
),

View File

@@ -21,7 +21,9 @@ class _QRScanScreenState extends State<QRScanScreen> {
),
),
body: const Center(
child: Text('QR Scanner is temporarily disabled for WASM build stability.'),
child: Text(
'QR Scanner is temporarily disabled for WASM build stability.',
),
),
);
}

View File

@@ -69,11 +69,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
if (_formKey.currentState?.validate() != true) return;
if ((_loginId == null || _loginId!.isEmpty) &&
(_token == null || _token!.isEmpty)) {
_showError(
tr(
'msg.userfront.reset.invalid_link',
),
);
_showError(tr('msg.userfront.reset.invalid_link'));
return;
}
@@ -89,11 +85,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
tr(
'msg.userfront.reset.success',
),
),
content: Text(tr('msg.userfront.reset.success')),
backgroundColor: Colors.green,
),
);
@@ -123,9 +115,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
String _buildPolicyDescription() {
if (_isPolicyLoading) {
return tr(
'msg.userfront.reset.policy_loading',
);
return tr('msg.userfront.reset.policy_loading');
}
final minLength = (_policy?['minLength'] as int?) ?? 12;
final minTypes = (_policy?['minCharacterTypes'] as int?) ?? 0;
@@ -149,22 +139,16 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
);
}
if (requiresLower) {
parts.add(
tr('msg.userfront.reset.policy.lowercase'),
);
parts.add(tr('msg.userfront.reset.policy.lowercase'));
}
if (requiresUpper) {
parts.add(
tr('msg.userfront.reset.policy.uppercase'),
);
parts.add(tr('msg.userfront.reset.policy.uppercase'));
}
if (requiresNumber) {
parts.add(tr('msg.userfront.reset.policy.number'));
}
if (requiresSymbol) {
parts.add(
tr('msg.userfront.reset.policy.symbol'),
);
parts.add(tr('msg.userfront.reset.policy.symbol'));
}
return parts.join(", ");
@@ -192,9 +176,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
tr(
'ui.userfront.reset.subtitle',
),
tr('ui.userfront.reset.subtitle'),
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
@@ -212,9 +194,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
controller: _passwordController,
obscureText: _isPasswordObscured,
decoration: InputDecoration(
labelText: tr(
'ui.userfront.reset.new_password',
),
labelText: tr('ui.userfront.reset.new_password'),
border: const OutlineInputBorder(),
prefixIcon: const Icon(Icons.lock_outline),
suffixIcon: IconButton(
@@ -265,25 +245,17 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
}
if ((_policy?['lowercase'] ?? true) && !hasLower) {
return tr(
'msg.userfront.reset.error.lowercase',
);
return tr('msg.userfront.reset.error.lowercase');
}
if ((_policy?['uppercase'] ?? false) && !hasUpper) {
return tr(
'msg.userfront.reset.error.uppercase',
);
return tr('msg.userfront.reset.error.uppercase');
}
if ((_policy?['number'] ?? true) && !hasNumber) {
return tr(
'msg.userfront.reset.error.number',
);
return tr('msg.userfront.reset.error.number');
}
if ((_policy?['nonAlphanumeric'] ?? true) &&
!hasSymbol) {
return tr(
'msg.userfront.reset.error.symbol',
);
return tr('msg.userfront.reset.error.symbol');
}
return null;
},
@@ -293,9 +265,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
controller: _confirmPasswordController,
obscureText: _isConfirmPasswordObscured,
decoration: InputDecoration(
labelText: tr(
'ui.userfront.reset.confirm_password',
),
labelText: tr('ui.userfront.reset.confirm_password'),
border: const OutlineInputBorder(),
prefixIcon: const Icon(Icons.lock_outline),
suffixIcon: IconButton(
@@ -314,9 +284,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
),
validator: (value) {
if (value != _passwordController.text) {
return tr(
'msg.userfront.reset.error.mismatch',
);
return tr('msg.userfront.reset.error.mismatch');
}
return null;
},
@@ -336,11 +304,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
color: Colors.white,
),
)
: Text(
tr(
'ui.userfront.reset.submit',
),
),
: Text(tr('ui.userfront.reset.submit')),
),
],
),
@@ -364,9 +328,7 @@ class _ResetPasswordScreenState extends State<ResetPasswordScreen> {
),
const SizedBox(height: 8),
Text(
tr(
'msg.userfront.reset.invalid_body',
),
tr('msg.userfront.reset.invalid_body'),
textAlign: TextAlign.center,
),
],

View File

@@ -164,11 +164,7 @@ class _SignupScreenState extends State<SignupScreen> {
final email = _emailController.text.trim();
final emailRegex = RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
if (!emailRegex.hasMatch(email)) {
setState(
() => _emailError = tr(
'msg.userfront.signup.email.invalid',
),
);
setState(() => _emailError = tr('msg.userfront.signup.email.invalid'));
return;
}
setState(() {
@@ -179,9 +175,7 @@ class _SignupScreenState extends State<SignupScreen> {
final available = await AuthProxyService.checkEmailAvailability(email);
if (!available) {
setState(
() => _emailError = tr(
'msg.userfront.signup.email.duplicate',
),
() => _emailError = tr('msg.userfront.signup.email.duplicate'),
);
return;
}
@@ -217,9 +211,7 @@ class _SignupScreenState extends State<SignupScreen> {
});
} else {
setState(
() => _emailError = tr(
'msg.userfront.signup.email.code_mismatch',
),
() => _emailError = tr('msg.userfront.signup.email.code_mismatch'),
);
}
} catch (e) {
@@ -272,9 +264,7 @@ class _SignupScreenState extends State<SignupScreen> {
});
} else {
setState(
() => _phoneError = tr(
'msg.userfront.signup.phone.code_mismatch',
),
() => _phoneError = tr('msg.userfront.signup.phone.code_mismatch'),
);
}
} catch (e) {
@@ -329,17 +319,11 @@ class _SignupScreenState extends State<SignupScreen> {
'msg.userfront.signup.password.lowercase_required',
);
} else if (eStr.contains('digit') || eStr.contains('number')) {
_passwordError = tr(
'msg.userfront.signup.password.number_required',
);
_passwordError = tr('msg.userfront.signup.password.number_required');
} else if (eStr.contains('symbol') || eStr.contains('special')) {
_passwordError = tr(
'msg.userfront.signup.password.symbol_required',
);
_passwordError = tr('msg.userfront.signup.password.symbol_required');
} else if (eStr.contains('length') || eStr.contains('12 characters')) {
_passwordError = tr(
'msg.userfront.signup.password.length_required',
);
_passwordError = tr('msg.userfront.signup.password.length_required');
} else {
_passwordError = tr(
'msg.userfront.signup.failed',
@@ -357,18 +341,12 @@ class _SignupScreenState extends State<SignupScreen> {
context: context,
barrierDismissible: false,
builder: (context) => AlertDialog(
title: Text(
tr('msg.userfront.signup.success.title'),
),
content: Text(
tr('msg.userfront.signup.success.body'),
),
title: Text(tr('msg.userfront.signup.success.title')),
content: Text(tr('msg.userfront.signup.success.body')),
actions: [
TextButton(
onPressed: () => context.go('/signin'),
child: Text(
tr('ui.userfront.signup.success.action'),
),
child: Text(tr('ui.userfront.signup.success.action')),
),
],
),
@@ -382,25 +360,13 @@ class _SignupScreenState extends State<SignupScreen> {
padding: const EdgeInsets.symmetric(vertical: 20),
child: Row(
children: [
_stepCircle(
1,
tr('ui.userfront.signup.steps.agreement'),
),
_stepCircle(1, tr('ui.userfront.signup.steps.agreement')),
_stepLine(1),
_stepCircle(
2,
tr('ui.userfront.signup.steps.verify'),
),
_stepCircle(2, tr('ui.userfront.signup.steps.verify')),
_stepLine(2),
_stepCircle(
3,
tr('ui.userfront.signup.steps.profile'),
),
_stepCircle(3, tr('ui.userfront.signup.steps.profile')),
_stepLine(3),
_stepCircle(
4,
tr('ui.userfront.signup.steps.password'),
),
_stepCircle(4, tr('ui.userfront.signup.steps.password')),
],
),
);
@@ -454,9 +420,7 @@ class _SignupScreenState extends State<SignupScreen> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
tr(
'msg.userfront.signup.agreement.title',
),
tr('msg.userfront.signup.agreement.title'),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
@@ -489,18 +453,14 @@ class _SignupScreenState extends State<SignupScreen> {
),
const SizedBox(height: 16),
_agreementSection(
title: tr(
'ui.userfront.signup.agreement.tos_title',
),
title: tr('ui.userfront.signup.agreement.tos_title'),
content: _tosText,
value: _termsAccepted,
onChanged: (val) => setState(() => _termsAccepted = val!),
),
const SizedBox(height: 16),
_agreementSection(
title: tr(
'ui.userfront.signup.agreement.privacy_title',
),
title: tr('ui.userfront.signup.agreement.privacy_title'),
content: _privacyText,
value: _privacyAccepted,
onChanged: (val) => setState(() => _privacyAccepted = val!),
@@ -745,9 +705,7 @@ class _SignupScreenState extends State<SignupScreen> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
tr(
'msg.userfront.signup.auth.title',
),
tr('msg.userfront.signup.auth.title'),
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 16),
@@ -764,9 +722,7 @@ class _SignupScreenState extends State<SignupScreen> {
const SizedBox(width: 8),
Expanded(
child: Text(
tr(
'msg.userfront.signup.auth.affiliate_notice',
),
tr('msg.userfront.signup.auth.affiliate_notice'),
style: const TextStyle(
fontSize: 12,
color: Colors.blue,
@@ -790,9 +746,7 @@ class _SignupScreenState extends State<SignupScreen> {
controller: _emailController,
onChanged: _checkEmailAffiliation, // 도메인 실시간 체크
decoration: InputDecoration(
labelText: tr(
'ui.userfront.signup.auth.email.label',
),
labelText: tr('ui.userfront.signup.auth.email.label'),
border: const OutlineInputBorder(),
errorText: _emailError,
hintText: 'example@hanmaceng.co.kr',
@@ -815,9 +769,7 @@ class _SignupScreenState extends State<SignupScreen> {
child: Text(
_emailSeconds > 0
? tr('ui.common.resend')
: tr(
'ui.userfront.signup.auth.request_code',
),
: tr('ui.userfront.signup.auth.request_code'),
),
),
),
@@ -828,9 +780,7 @@ class _SignupScreenState extends State<SignupScreen> {
TextFormField(
controller: _emailCodeController,
decoration: InputDecoration(
labelText: tr(
'ui.userfront.signup.auth.code_label',
),
labelText: tr('ui.userfront.signup.auth.code_label'),
suffixText: _formatTime(_emailSeconds),
border: const OutlineInputBorder(),
),
@@ -848,9 +798,7 @@ class _SignupScreenState extends State<SignupScreen> {
Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
tr(
'msg.userfront.signup.email.verified',
),
tr('msg.userfront.signup.email.verified'),
style: const TextStyle(
color: Colors.green,
fontSize: 13,
@@ -870,9 +818,7 @@ class _SignupScreenState extends State<SignupScreen> {
child: TextFormField(
controller: _phoneController,
decoration: InputDecoration(
labelText: tr(
'ui.userfront.signup.phone.label',
),
labelText: tr('ui.userfront.signup.phone.label'),
border: const OutlineInputBorder(),
errorText: _phoneError,
),
@@ -895,9 +841,7 @@ class _SignupScreenState extends State<SignupScreen> {
child: Text(
_phoneSeconds > 0
? tr('ui.common.resend')
: tr(
'ui.userfront.signup.auth.request_code',
),
: tr('ui.userfront.signup.auth.request_code'),
),
),
),
@@ -908,9 +852,7 @@ class _SignupScreenState extends State<SignupScreen> {
TextFormField(
controller: _phoneCodeController,
decoration: InputDecoration(
labelText: tr(
'ui.userfront.signup.auth.code_label',
),
labelText: tr('ui.userfront.signup.auth.code_label'),
suffixText: _formatTime(_phoneSeconds),
border: const OutlineInputBorder(),
),
@@ -928,9 +870,7 @@ class _SignupScreenState extends State<SignupScreen> {
Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
tr(
'msg.userfront.signup.phone.verified',
),
tr('msg.userfront.signup.phone.verified'),
style: const TextStyle(
color: Colors.green,
fontSize: 13,
@@ -947,9 +887,7 @@ class _SignupScreenState extends State<SignupScreen> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
tr(
'msg.userfront.signup.profile.title',
),
tr('msg.userfront.signup.profile.title'),
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 24),
@@ -971,28 +909,20 @@ class _SignupScreenState extends State<SignupScreen> {
key: ValueKey(_affiliationType),
initialValue: _affiliationType,
decoration: InputDecoration(
labelText: tr(
'ui.userfront.signup.profile.affiliation_type',
),
labelText: tr('ui.userfront.signup.profile.affiliation_type'),
border: const OutlineInputBorder(),
helperText: _isAffiliateEmail
? tr(
'msg.userfront.signup.profile.affiliate_hint',
)
? tr('msg.userfront.signup.profile.affiliate_hint')
: null,
),
items: [
DropdownMenuItem(
value: 'GENERAL',
child: Text(
tr('domain.affiliation.general'),
),
child: Text(tr('domain.affiliation.general')),
),
DropdownMenuItem(
value: 'AFFILIATE',
child: Text(
tr('domain.affiliation.affiliate'),
),
child: Text(tr('domain.affiliation.affiliate')),
),
],
onChanged: _isAffiliateEmail
@@ -1019,9 +949,7 @@ class _SignupScreenState extends State<SignupScreen> {
key: ValueKey(_companyCode ?? 'none'),
initialValue: _companyCode,
decoration: InputDecoration(
labelText: tr(
'ui.userfront.signup.profile.company',
),
labelText: tr('ui.userfront.signup.profile.company'),
border: const OutlineInputBorder(),
),
items: [
@@ -1064,9 +992,7 @@ class _SignupScreenState extends State<SignupScreen> {
decoration: InputDecoration(
labelText: _affiliationType == 'AFFILIATE'
? tr('ui.userfront.signup.profile.department')
: tr(
'ui.userfront.signup.profile.department_optional',
),
: tr('ui.userfront.signup.profile.department_optional'),
border: const OutlineInputBorder(),
),
),
@@ -1076,9 +1002,7 @@ class _SignupScreenState extends State<SignupScreen> {
String _buildPolicyDescription() {
if (_isPolicyLoading) {
return tr(
'msg.userfront.signup.policy.loading',
);
return tr('msg.userfront.signup.policy.loading');
}
final minLength = (_policy?['minLength'] as int?) ?? 12;
final minTypes = (_policy?['minCharacterTypes'] as int?) ?? 0;
@@ -1147,9 +1071,7 @@ class _SignupScreenState extends State<SignupScreen> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
tr(
'msg.userfront.signup.password.title',
),
tr('msg.userfront.signup.password.title'),
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 16),
@@ -1183,9 +1105,7 @@ class _SignupScreenState extends State<SignupScreen> {
obscureText: true,
onChanged: (_) => setState(() {}),
decoration: InputDecoration(
labelText: tr(
'ui.userfront.signup.password.label',
),
labelText: tr('ui.userfront.signup.password.label'),
border: const OutlineInputBorder(),
errorText: _passwordError,
),
@@ -1211,16 +1131,12 @@ class _SignupScreenState extends State<SignupScreen> {
),
if (requiresUpper)
_cryptoCheck(
tr(
'msg.userfront.signup.password.rule.uppercase',
),
tr('msg.userfront.signup.password.rule.uppercase'),
hasUpper,
),
if (requiresLower)
_cryptoCheck(
tr(
'msg.userfront.signup.password.rule.lowercase',
),
tr('msg.userfront.signup.password.rule.lowercase'),
hasLower,
),
if (requiresNumber)
@@ -1230,9 +1146,7 @@ class _SignupScreenState extends State<SignupScreen> {
),
if (requiresSymbol)
_cryptoCheck(
tr(
'msg.userfront.signup.password.rule.symbol',
),
tr('msg.userfront.signup.password.rule.symbol'),
hasSpecial,
),
],
@@ -1244,16 +1158,12 @@ class _SignupScreenState extends State<SignupScreen> {
onChanged: (val) {
setState(() {
_confirmPasswordError = (val != _passwordController.text)
? tr(
'msg.userfront.signup.password.mismatch',
)
? tr('msg.userfront.signup.password.mismatch')
: null;
});
},
decoration: InputDecoration(
labelText: tr(
'ui.userfront.signup.password.confirm_label',
),
labelText: tr('ui.userfront.signup.password.confirm_label'),
border: const OutlineInputBorder(),
errorText: _confirmPasswordError,
),
@@ -1379,12 +1289,8 @@ class _SignupScreenState extends State<SignupScreen> {
)
: Text(
_currentStep < 4
? tr(
'ui.userfront.signup.next_step',
)
: tr(
'ui.userfront.signup.complete',
),
? tr('ui.userfront.signup.next_step')
: tr('ui.userfront.signup.complete'),
),
),
),