Add auto fill hints

This commit is contained in:
Hillel Coren 2020-07-12 12:09:21 +03:00
parent ee0d2bdf7e
commit 5257752dd3
2 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class DecoratedFormField extends StatelessWidget {
this.suffixIcon,
this.expands = false,
this.autofocus = false,
this.autofillHints,
}) : super(key: key);
final TextEditingController controller;
@ -41,6 +42,7 @@ class DecoratedFormField extends StatelessWidget {
final ValueChanged<String> onFieldSubmitted;
final ValueChanged<String> onChanged;
final Icon suffixIcon;
final Iterable<String> autofillHints;
@override
Widget build(BuildContext context) {
@ -77,6 +79,7 @@ class DecoratedFormField extends StatelessWidget {
}
},
enabled: enabled,
autofillHints: autofillHints,
);
}
}

View File

@ -416,6 +416,7 @@ class _LoginState extends State<LoginView> {
: null,
onFieldSubmitted: (String value) =>
FocusScope.of(context).nextFocus(),
autofillHints: [AutofillHints.email],
),
if (_emailLogin && !_recoverPassword)
TextFormField(
@ -464,6 +465,11 @@ class _LoginState extends State<LoginView> {
keyboardType: TextInputType.visiblePassword,
onFieldSubmitted: (String value) =>
FocusScope.of(context).nextFocus(),
autofillHints: [
_createAccount
? AutofillHints.newPassword
: AutofillHints.password
],
),
if (_isSelfHosted)
TextFormField(