refactor: Update to Dart 3.10 with . shorthands
This commit is contained in:
parent
75a37f3f7c
commit
1ea649f01e
167 changed files with 3351 additions and 3912 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue