简体   繁体   中英

Flutter Web: Autofill password suggestions not triggered in TextFormField

I'm trying to get email and password autofilled using the Google Password Manager. This seems to work on Android, but not for Web.

Example:

Form(
    key: key,
    child: AutofillGroup(
      child: Column(
        children: [
          TextFormField(
            autofillHints: const [AutofillHints.email],
            keyboardType: TextInputType.emailAddress,
            textInputAction: TextInputAction.next,
          ),
          TextFormField(autofillHints: const [AutofillHints.password],),
          ElevatedButton(
            onPressed: (){
              TextInput.finishAutofillContext();
              Navigator.of(context).pushReplacementNamed('/home');
            },
            child: const Text('Login'),
          ),
        ],
      ),
    ),
  ),

When I press the "Login" button, the browser(Google Chrome) shows a pop-up that allows me to save email and password using the password manager, and then go to the Home screen.

The problem is when I try to login again: The email and password are saved, but they aren't autofilled, or not even displayed as suggestions when I click any field. Pop-up

Note: I have already linked the google account and turned on the sync.

Screenshot: Common website with autofill and suggestions behavior This isn't working in my app.

Someone on GitHub has already filed this issue (No Autofill Suggestions) on Flutter Repository

Issue is in Open State on Flutter's Official Repository. You can check for the updates on that here

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM