refactor: Added and applied require_trailing_commas linter rule
This commit is contained in:
parent
adb3f766e5
commit
ec7acc5385
112 changed files with 3466 additions and 2855 deletions
|
|
@ -19,125 +19,131 @@ class LoginView extends StatelessWidget {
|
|||
automaticallyImplyLeading: !controller.loading,
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
L10n.of(context)!.logInTo(Matrix.of(context)
|
||||
.getLoginClient()
|
||||
.homeserver
|
||||
.toString()
|
||||
.replaceFirst('https://', '')),
|
||||
L10n.of(context)!.logInTo(
|
||||
Matrix.of(context)
|
||||
.getLoginClient()
|
||||
.homeserver
|
||||
.toString()
|
||||
.replaceFirst('https://', ''),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Builder(builder: (context) {
|
||||
return AutofillGroup(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: TextField(
|
||||
readOnly: controller.loading,
|
||||
autocorrect: false,
|
||||
autofocus: true,
|
||||
onChanged: controller.checkWellKnownWithCoolDown,
|
||||
controller: controller.usernameController,
|
||||
textInputAction: TextInputAction.next,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
autofillHints:
|
||||
controller.loading ? null : [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.account_box_outlined),
|
||||
errorText: controller.usernameError,
|
||||
errorStyle: const TextStyle(color: Colors.orange),
|
||||
hintText: L10n.of(context)!.emailOrUsername,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: TextField(
|
||||
readOnly: controller.loading,
|
||||
autocorrect: false,
|
||||
autofillHints:
|
||||
controller.loading ? null : [AutofillHints.password],
|
||||
controller: controller.passwordController,
|
||||
textInputAction: TextInputAction.go,
|
||||
obscureText: !controller.showPassword,
|
||||
onSubmitted: (_) => controller.login(),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.lock_outlined),
|
||||
errorText: controller.passwordError,
|
||||
errorStyle: const TextStyle(color: Colors.orange),
|
||||
suffixIcon: IconButton(
|
||||
onPressed: controller.toggleShowPassword,
|
||||
icon: Icon(
|
||||
controller.showPassword
|
||||
? Icons.visibility_off_outlined
|
||||
: Icons.visibility_outlined,
|
||||
color: Colors.black,
|
||||
),
|
||||
body: Builder(
|
||||
builder: (context) {
|
||||
return AutofillGroup(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: TextField(
|
||||
readOnly: controller.loading,
|
||||
autocorrect: false,
|
||||
autofocus: true,
|
||||
onChanged: controller.checkWellKnownWithCoolDown,
|
||||
controller: controller.usernameController,
|
||||
textInputAction: TextInputAction.next,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
autofillHints:
|
||||
controller.loading ? null : [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.account_box_outlined),
|
||||
errorText: controller.usernameError,
|
||||
errorStyle: const TextStyle(color: Colors.orange),
|
||||
hintText: L10n.of(context)!.emailOrUsername,
|
||||
),
|
||||
hintText: L10n.of(context)!.password,
|
||||
),
|
||||
),
|
||||
),
|
||||
Hero(
|
||||
tag: 'signinButton',
|
||||
child: Padding(
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: TextField(
|
||||
readOnly: controller.loading,
|
||||
autocorrect: false,
|
||||
autofillHints:
|
||||
controller.loading ? null : [AutofillHints.password],
|
||||
controller: controller.passwordController,
|
||||
textInputAction: TextInputAction.go,
|
||||
obscureText: !controller.showPassword,
|
||||
onSubmitted: (_) => controller.login(),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.lock_outlined),
|
||||
errorText: controller.passwordError,
|
||||
errorStyle: const TextStyle(color: Colors.orange),
|
||||
suffixIcon: IconButton(
|
||||
onPressed: controller.toggleShowPassword,
|
||||
icon: Icon(
|
||||
controller.showPassword
|
||||
? Icons.visibility_off_outlined
|
||||
: Icons.visibility_outlined,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
hintText: L10n.of(context)!.password,
|
||||
),
|
||||
),
|
||||
),
|
||||
Hero(
|
||||
tag: 'signinButton',
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: ElevatedButton.icon(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
foregroundColor:
|
||||
Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
onPressed: controller.loading ? null : controller.login,
|
||||
icon: const Icon(Icons.login_outlined),
|
||||
label: controller.loading
|
||||
? const LinearProgressIndicator()
|
||||
: Text(L10n.of(context)!.login),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Text(
|
||||
L10n.of(context)!.or,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: controller.loading
|
||||
? () {}
|
||||
: controller.passwordForgotten,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
foregroundColor: Theme.of(context).colorScheme.onPrimary,
|
||||
foregroundColor: Theme.of(context).colorScheme.error,
|
||||
backgroundColor: Theme.of(context).colorScheme.onError,
|
||||
),
|
||||
onPressed: controller.loading ? null : controller.login,
|
||||
icon: const Icon(Icons.login_outlined),
|
||||
label: controller.loading
|
||||
? const LinearProgressIndicator()
|
||||
: Text(L10n.of(context)!.login),
|
||||
icon: const Icon(Icons.safety_check_outlined),
|
||||
label: Text(L10n.of(context)!.passwordForgotten),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Text(
|
||||
L10n.of(context)!.or,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: ElevatedButton.icon(
|
||||
onPressed:
|
||||
controller.loading ? () {} : controller.passwordForgotten,
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Theme.of(context).colorScheme.error,
|
||||
backgroundColor: Theme.of(context).colorScheme.onError,
|
||||
),
|
||||
icon: const Icon(Icons.safety_check_outlined),
|
||||
label: Text(L10n.of(context)!.passwordForgotten),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue