flutteractionsbot ef0cd00091
[CP-stable]Revert #160653 Fix view removal process for AutofillContextAction.cancel (#172676)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

#172250

### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples

Fixes a bug where `TextInput.hide` call incorrect clears the text in the active text field.

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

If an app calls `TextInput.hide` to hide the software keyboard, the user input in the current active text field will also be erased. It impacts the production app.
The framework itself doesn't seem to call `TextInput.hide` in a way that would affect the user.

### Workaround:
Is there a workaround for this issue?

Yes, in theory, developers can store and restore the `TextEditingValue`, when they need to call `TextInput.hide`, to undo the clear. However I suspect the reverted PR may also [break voiceover](https://github.com/flutter/flutter/issues/145681#issuecomment-3110985123).

### Risk:
What is the risk level of this cherry-pick?

This is a revert of #160653. The reverted PR was merged in February, and the previous implementation was [introduced in 2021](https://github.com/flutter/engine/pull/23776).

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

  - [] No

This change is a revert so the added test will also get reverted.

### Validation Steps:
What are the steps to validate that this fix works?

To verify the fix on master (it has already landed on master), run this app:
```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',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: SizedBox(
          child: ListView(
            children: [
              TextButton(
                child: Text('hide keyboard'),
                onPressed: () =>
                    SystemChannels.textInput.invokeListMethod("TextInput.hide"),
              ),
              TextField(
                controller: TextEditingController(text: '️a' * 20),
                maxLines: 1,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```
focus the text field and then click the hide keyboard button. The text "aaaaaa..." should remain after the button is clicked.
2025-07-24 19:23:50 +00:00
..

Flutter Engine

Setting up the Engine development environment

See here

gclient bootstrap

Flutter engine uses gclient to manage dependencies.

If you've already cloned the flutter repository:

  1. Copy one of the engine/scripts/*.gclient to the root folder as .gclient:
    1. Googlers: copy rbe.gclient to enable faster builds with RBE
    2. Everyone else: copy standard.gclient
  2. run gclient sync from the root folder