Autofill password field not triggering on (Android devices) for Flutter

2»

Comments

  • I'm glad to hear that. Thanks!

  • rekire
    rekire
    Community Member

    That is a great improvement, but in my app the username field is not detected. However when I click on the password field it is working already. Is there something wrong with my code or your implementation?

    Here is my simplified dart code:

    TextFormField(
      textInputAction: TextInputAction.next,
      keyboardType: TextInputType.emailAddress,
      autofillHints: const [AutofillHints.username, AutofillHints.email],
      // ...
    ),
    TextFormField(
      obscureText: _isObscure,
      textInputAction: TextInputAction.send,
      keyboardType: TextInputType.visiblePassword,
      autofillHints: const [AutofillHints.password],
      // ...
    )
    
  • ricardoboss
    ricardoboss
    Community Member

    Hi @peri!

    Thanks for working on this! I also tested it with my example app (https://github.com/ricardoboss/flutter_password_autofill ) and it now kinda works with the latest beta of 1Password.

    When I first launched the app, my keyboard shows the "Open 1Password" button, so I think it recognized that I put the cursor in a username field.

    I then tried entering some credentials and submitted them. Unfortunately, 1Password didn't receive the event or sth like that because it didn't ask me if I want to save my credentials.

    Anyway, after entering the app with a fresh session, I created a new login from within the 1Password dialog for the app and let it autofill the inputs, which worked as it should. Nice!

    Then, after restarting the app again, 1Password showed the "Open 1Password" button and a button for the credentials I just created above the keyboard, but only autofilled the password field when I tapped on it. Also, focussing the username input now doesn't trigger the 1Password prompt to autofill anymore.

    So, in short:
    1. no prompt to save credentials after form submission
    2. autofill works when creating the login within the app
    3. autofill doesn't work for username after restarting the app
    4. username field doesn't trigger "Open 1Password" bar

    I hope this helps! As I said, I am using the repository I linked above to test the behaviour. Maybe you can tell me how to improve my implementation. Am I missing some tags/labels on the inputs?

  • rekire
    rekire
    Community Member

    @peri I would like to get an update here :-)

  • Sorry for the delay!

    @rekire, we have an issue where filling isn't offered in one of two fields on a page, which should be fixed soon. Can you go to Settings > Autofill and set Display Autofill prompts to Below the fields they relate to? Does that help in this case, or do you still notice the issue?

    @ricardoboss Thanks for reporting! Unfortunately, auto-saving isn't supported in 1Password at the moment, so that's why you're not prompted to save the login here. Instead, from the Autofill interface, you can create a new login and fill to save during sign up or sign in.

    As to the second issue, I'll create a follow up issue to look into it. Thanks again!

  • claudec
    claudec
    Community Member

    I know this thread is about Android primarily, but any word on Autofill working in browser extensions for Flutter web applications? It doesn't seem to work on chrome or safari.

  • Hey @claudec. Sorry I missed your comment!

    I'm not quite sure I understand. Are you referring to the 1Password browser extension filling in Flutter web apps?

  • claudec
    claudec
    Community Member

    Correct. It doesn’t seem to work with flutter apps on web. Is that on your roadmap?

  • Thanks @claudec. This is indeed a different issue. Can you give an example of a Flutter web app that I can share with the right team for testing?

  • claudec
    claudec
    Community Member

    For sure, we have a flutter app with a login on the web https://app.appfit.io/login

  • @claudec

    Thanks! It looks like this site is using shadow roots. Unfortunately we're not yet able to fill in frameworks using shadow DOMs, which is why filling isn't working on this site. Do you happen to know if this is typical of Flutter web apps, or particular to this one?

  • claudec
    claudec
    Community Member

    I don't think we're doing anything special here, it's a standard flutter app.

  • Thanks for the update! I'll share this with the rest of the team so they can look into it!

  • ricardoboss
    ricardoboss
    Community Member

    @peri any news? It seems to have worsened with the latest versions. You can still test this with my example app (in which autofill doesn't work).

    Flutter version 3.13.6 on channel stable
    • Upstream repository https://github.com/flutter/flutter
    • Framework revision ead455963c (2 weeks ago), 2023-09-26 18:28:17 -0700
    • Engine revision a794cf2681
    • Dart version 3.1.3
    • DevTools version 2.25.0

    1Password for Android 8.10.18 (81018010, on BETA channel)

  • Hey @ricardoboss, my sincere apologies in the delay in getting back to you. I've followed up with @peri!