chore: add always_put_control_body_on_new_line lint (#28352)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2026-05-12 00:47:24 +07:00 committed by GitHub
parent 7837d40f57
commit 12f7b2a005
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
122 changed files with 774 additions and 263 deletions

View file

@ -40,7 +40,9 @@ class LoginForm extends HookConsumerWidget {
final log = Logger('LoginForm');
String? _validateUrl(String? url) {
if (url == null || url.isEmpty) return null;
if (url == null || url.isEmpty) {
return null;
}
final parsedUrl = Uri.tryParse(url);
if (parsedUrl == null || !parsedUrl.isAbsolute || !parsedUrl.scheme.startsWith("http") || parsedUrl.host.isEmpty) {
@ -51,9 +53,15 @@ class LoginForm extends HookConsumerWidget {
}
String? _validateEmail(String? email) {
if (email == null || email == '') return null;
if (email.endsWith(' ')) return 'login_form_err_trailing_whitespace'.tr();
if (email.startsWith(' ')) return 'login_form_err_leading_whitespace'.tr();
if (email == null || email == '') {
return null;
}
if (email.endsWith(' ')) {
return 'login_form_err_trailing_whitespace'.tr();
}
if (email.startsWith(' ')) {
return 'login_form_err_leading_whitespace'.tr();
}
if (email.contains(' ') || !email.contains('@')) {
return 'login_form_err_invalid_email'.tr();
}