Repository: flutter
Issue: Samsung Pass unfocuses TextField
Labels: a: text input,e: device-specific,platform-android,framework,f: material design,f: focus,P2,e: samsung,team-text-input

### Steps to reproduce

1. Write a Flutter app that uses an `AutofillGroup` with one ore more `TextField`s.
2. Make sure Samsung Pass is set up on your device. If it is not installed, here is the link: https://apps.samsung.com/appquery/appDetail.as?appId=com.samsung.android.samsungpass&cId=000005295090
Follow these instructions to set up the Samsung Pass (see the How to set up Samsung Pass section): https://www.samsung.com/latin_en/support/mobile-devices/how-to-set-up-and-use-samsung-pass-on-your-galaxy-phone/
3. Run the app on a Samsung device with Samsung Pass on
4. Fill the `TextField`s

### Expected results

Samsung Pass popup is shown, but does not unfocus the TextField

### Actual results

After the very first letter in the TextField is entered, Samsung Pass popup is shown, the TextField is unfocused, so user should tap the TextField again to continue filling the form.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final _formKey = GlobalKey<FormState>();
  final _usernameController = TextEditingController();
  final _passwordController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Samsung Pass'),
      ),
      body: Form(
        key: _formKey,
        child: AutofillGroup(
          child: Column(
            children: [
              TextField(
                controller: _usernameController,
                autofillHints: const [AutofillHints.email],
                keyboardType: TextInputType.emailAddress,
                decoration: const InputDecoration(
                  labelText: 'Email',
                ),
              ),
              TextField(
                controller: _passwordController,
                autofillHints: const [AutofillHints.password],
                obscureText: true,
                decoration: const InputDecoration(
                  labelText: 'Password',
                ),
              ),
              ElevatedButton(
                onPressed: () {
                  TextInput.finishAutofillContext();
                },
                child: const Text('Test Send'),
              )
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Samsung Galaxy S24 Plus, Android 14 (Samsung Pass)</summary>


https://github.com/flutter/flutter/assets/47378937/39d0bc21-6a9b-4048-b53c-9baeec7deac1



</details>


<details open>
<summary>Google Pixel 7 Pro, Android 14 (Google Password Manager)</summary>


https://github.com/flutter/flutter/assets/47378937/2d727c91-2e96-4e54-9380-76f6a7f0118e



</details>


### Logs

<details open><summary>Logs</summary>

```console
N/A
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
sergey@Sergeys-MacBook-Pro mpc % flutter doctor                   
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.1, on macOS 14.3.1 23D60 darwin-arm64, locale en-LV)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] Connected device (2 available)
    ! Error: Browsing on the local area network for Sergey Protchenko’s iPad. Ensure the device is unlocked and attached with a cable or associated
      with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

```

</details>