Repository: flutter
Issue: TextFormField autofill not working for password with obscureText true on iOS 17.5+
Labels: a: text input,c: regression,platform-ios,e: OS-version specific,P2,team-text-input,triaged-text-input

### Steps to reproduce

You need an app with apple associated domain to be able to test iOS autofill password.

1. Launch app.
2. Click on "Login with obscureText".
3. Click on password.
4. Click on the suggested password from your keyboard
![image](https://github.com/user-attachments/assets/6c235428-3855-4d8b-8533-f3040bf02c4a)
5. See that TextFormField is not autofilled
6. Click on the suggested password from your keyboard
![image](https://github.com/user-attachments/assets/6c235428-3855-4d8b-8533-f3040bf02c4a)
7. See that TextFormField is autofilled

8. Go back to home page
9. Click on "Login without obscureText"
10. Click on password.
11. Click on the suggested password from your keyboard
![image](https://github.com/user-attachments/assets/6c235428-3855-4d8b-8533-f3040bf02c4a)
12. See that TextFormField is autofilled


### Expected results

In Step 5, inputs should be autofilled.

### Actual results

In Step 5, inputs are not autofilled

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(
    const MaterialApp(
      home: Home(),
    ),
  );
}

class Home extends StatelessWidget {
  const Home({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Textfield autofill issue'),
      ),
      body: Center(
        child: SingleChildScrollView(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              ElevatedButton(
                onPressed: () {
                  Navigator.of(context).push(
                    MaterialPageRoute<void>(
                      builder: (BuildContext context) {
                        return const Login(obscureText: true);
                      },
                    ),
                  );
                },
                child: const Text('Login with obscureText'),
              ),
              const SizedBox(height: 16),
              ElevatedButton(
                onPressed: () {
                  Navigator.of(context).push(
                    MaterialPageRoute<void>(
                      builder: (BuildContext context) {
                        return const Login(obscureText: false);
                      },
                    ),
                  );
                },
                child: const Text('Login without obscureText'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

class Login extends StatelessWidget {
  const Login({
    required this.obscureText,
    super.key,
  });

  final bool obscureText;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.all(16),
          child: AutofillGroup(
            child: Column(
              children: <Widget>[
                TextFormField(
                  autofillHints: const <String>[
                    // Order is important, username must be first
                    AutofillHints.username,
                    AutofillHints.email,
                  ],
                  keyboardType: TextInputType.emailAddress,
                  decoration: const InputDecoration(
                    hintText: 'Username',
                    contentPadding: EdgeInsets.only(left: 13, right: 7),
                    filled: true,
                    focusedBorder: OutlineInputBorder(
                      borderSide: BorderSide(
                        width: 1,
                        color: Colors.grey,
                      ),
                    ),
                    enabledBorder: OutlineInputBorder(
                      borderSide: BorderSide(
                        width: 1,
                        color: Colors.grey,
                      ),
                    ),
                    border: OutlineInputBorder(
                      borderSide: BorderSide(
                        width: 1,
                        color: Colors.grey,
                      ),
                    ),
                  ),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  autofillHints: const <String>[AutofillHints.password],
                  cursorColor: Theme.of(context).primaryIconTheme.color,
                  obscureText: obscureText,
                  keyboardType: TextInputType.visiblePassword,
                  decoration: const InputDecoration(
                    hintText: 'Password',
                    contentPadding: EdgeInsets.only(left: 13, right: 7),
                    filled: true,
                    focusedBorder: OutlineInputBorder(
                      borderSide: BorderSide(
                        width: 1,
                        color: Colors.grey,
                      ),
                    ),
                    enabledBorder: OutlineInputBorder(
                      borderSide: BorderSide(
                        width: 1,
                        color: Colors.grey,
                      ),
                    ),
                    border: OutlineInputBorder(
                      borderSide: BorderSide(
                        width: 1,
                        color: Colors.grey,
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>


Login & password used are fake :)

https://github.com/user-attachments/assets/0a75ea9e-0e6d-4c6e-a9f8-95b8e7fdd713

</details>


### Logs

<details open><summary>Logs</summary>

```console
No logs
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0.1 24A348 darwin-arm64, locale fr-FR)
    • Flutter version 3.24.3 on channel stable at /Users/earminjon/fvm/versions/3.24.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (5 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/earminjon/Library/Android/Sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /Users/earminjon/Library/Android/Sdk
    • Java binary at: /Users/earminjon/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Users/earminjon/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] Android Studio (version 2023.2)
    • Android Studio at /Users/perso/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.2.3)
    • IntelliJ at /Users/earminjon/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 82.0.3
    • Dart plugin version 242.22855.32

[✓] Connected device (5 available)            
    • iPhone d’Enguerrand (mobile)    • 00008030-0012646A21E3802E • ios            • iOS 18.0.1 22A3370
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 15.0.1 24A348 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 15.0.1 24A348 darwin-arm64

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>