Add autofillgroup

This commit is contained in:
shilangyu 2021-04-11 20:52:11 +02:00
parent 68cd03e71c
commit 3011890831
1 changed files with 85 additions and 79 deletions

View File

@ -67,7 +67,8 @@ class AddAccountPage extends HookWidget {
leading: const CloseButton(), leading: const CloseButton(),
title: const Text('Add account'), title: const Text('Add account'),
), ),
body: ListView( body: AutofillGroup(
child: ListView(
padding: const EdgeInsets.all(15), padding: const EdgeInsets.all(15),
children: [ children: [
if (icon.value == null) if (icon.value == null)
@ -116,10 +117,13 @@ class AddAccountPage extends HookWidget {
TextField( TextField(
autofocus: true, autofocus: true,
controller: usernameController, controller: usernameController,
autofillHints: const [AutofillHints.email, AutofillHints.username], autofillHints: const [
AutofillHints.email,
AutofillHints.username
],
onSubmitted: (_) => passwordFocusNode.requestFocus(), onSubmitted: (_) => passwordFocusNode.requestFocus(),
decoration: decoration: InputDecoration(
InputDecoration(labelText: L10n.of(context)!.email_or_username), labelText: L10n.of(context)!.email_or_username),
), ),
const SizedBox(height: 5), const SizedBox(height: 5),
TextField( TextField(
@ -129,7 +133,8 @@ class AddAccountPage extends HookWidget {
onSubmitted: (_) => handleSubmit?.call(), onSubmitted: (_) => handleSubmit?.call(),
autofillHints: const [AutofillHints.password], autofillHints: const [AutofillHints.password],
keyboardType: TextInputType.visiblePassword, keyboardType: TextInputType.visiblePassword,
decoration: InputDecoration(labelText: L10n.of(context)!.password), decoration:
InputDecoration(labelText: L10n.of(context)!.password),
), ),
ElevatedButton( ElevatedButton(
onPressed: handleSubmit, onPressed: handleSubmit,
@ -153,6 +158,7 @@ class AddAccountPage extends HookWidget {
), ),
], ],
), ),
),
); );
} }
} }