refactor: Update to Dart 3.10 with . shorthands

This commit is contained in:
Christian Kußowski 2025-11-30 12:54:06 +01:00
commit 1ea649f01e
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
167 changed files with 3351 additions and 3912 deletions

View file

@ -130,8 +130,9 @@ class LoginController extends State<Login> {
final dialogResult = await showOkCancelAlertDialog(
context: context,
useRootNavigator: false,
title: L10n.of(context)
.noMatrixServer(newDomain.toString(), oldHomeserver.toString()),
title: L10n.of(
context,
).noMatrixServer(newDomain.toString(), oldHomeserver.toString()),
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
);
@ -165,8 +166,9 @@ class LoginController extends State<Login> {
message: L10n.of(context).enterAnEmailAddress,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
initialText:
usernameController.text.isEmail ? usernameController.text : '',
initialText: usernameController.text.isEmail
? usernameController.text
: '',
hintText: L10n.of(context).enterAnEmailAddress,
keyboardType: TextInputType.emailAddress,
);
@ -238,8 +240,9 @@ class LoginController extends State<Login> {
}
extension on String {
static final RegExp _phoneRegex =
RegExp(r'^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$');
static final RegExp _phoneRegex = RegExp(
r'^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$',
);
static final RegExp _emailRegex = RegExp(r'(.+)@(.+)\.(.+)');
bool get isEmail => _emailRegex.hasMatch(this);