Skip to main content

provide-autofill-hints

effort: 2m
has IDE fix
pro+

Warns when TextField, TextFormField or CupertinoTextField does not pass the autofillHints argument.

Omitting autofillHints in Flutter prevents password managers and assistive system autofill tools from assisting users with motor or cognitive disabilities.

WCAG 2.1 Criterion 1.3.5 requires identifying input purpose programmatically for personal data inputs (email, password, phone, postal address).

Example

❌ Bad:

// LINT: Autofill hints are not specified. Try passing them.
TextField();

// LINT: Autofill hints are not specified. Try passing them.
TextFormField();

✅ Good:

TextField(autofillHints: const []); // correct, does not need a hint
TextField(autofillHints: const [AutofillHints.email]);

Additional Resources