Skip to content

AutoFill unexpected behavior; TextInput.finishAutofillContext() doing nothing; Cannot save user input #69111

@hawkinsjb1

Description

@hawkinsjb1

I am attempting to use an Autofill service for my login screen and the behaviour has been inconsistent, especially across services.

I wanted to use the Google Autofill service primarily for testing, but when I do, TextInput.finishAutofillContext() never prompts the user. Instead when I use LastPass, TextInput.finishAutofillContext() usually prompts the user (though sometimes it doesn't) however LastPass doesn't recognize the (email, username) hints and instead only the password.

I realize each Autofill service may behave differently, but I have yet to find a fully working (save + grouped email/password) implementation.

This is a simplified version of what I'm trying to do:

  return AutofillGroup(
    child: Column(
      children: [
        TextField(
          autofillHints: [
            AutofillHints.email,
            // AutofillHints.username,
          ],
          keyboardType: TextInputType.emailAddress,
          textInputAction: TextInputAction.next,
        ),
        TextField(
          autofillHints: [
            AutofillHints.password,
          ],
          keyboardType: TextInputType.visiblePassword,
          textInputAction: TextInputAction.done,
          obscureText: true,
          onSubmitted: (_) =>
              TextInput.finishAutofillContext(shouldSave: true),
        ),
      ],
    ),
  );

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.24.0-4.0.pre.64, on Microsoft Windows [Version 10.0.19041.572], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.50.0)
[√] Connected device (4 available)

@LongCatIsLooong keying you in, as I've seen you across multiple related threads

Metadata

Metadata

Labels

a: text inputEntering text in a text field or keyboard related problemsfound in release: 1.24Found to occur in 1.24frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions