Repository: flutter
Issue: [android] Using Gboard, cursor positioning via "cursor dot" is not consistent and the drag gets lost
Labels: a: text input,platform-android,has reproducible steps,P2,found in release: 2.10,found in release: 2.11,team-android,triaged-android

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Have a `TextField` or `TextFormField` in the app
2. Tap the field and enter some text
3. Tap somewhere in the text and drag the cursor around via the "cursor dot"

**Expected results:**

- The cursor dot always gets visible on the first tap
- It's possible to continuously drag the cursor around in the field until the tap / drag is lifted

**Actual results:** 

- Some times the cursor dot appears after the first try, sometime two or three are needed
- If a cursor dot is there and the user starts to drag the cursor around, the tap / drag just randomly ends without lifting the finger
- Warnings are shown in the debugging console (see logs)

**Information:**
- This does happen on a real device (tested on OnePlus 8T with Android 11) and also in the emulator (mentioning this as there were emulator specific issues in regards to this problem field, but this problem is a general one)
- It doesn't matter if a `controller` is used or not
- If I perform a long press and start selecting text instead of moving the cursor, everything works just fine
- If I limit the input to only numbers via `keyboardType: TextInputType.number, inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],` everything works fine again
- Please see the attached video (OnePlus 8T with the same code as shown below)


<details>
<summary>Code</summary>

I just added a `TextField` to the default counter app.

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            const TextField(),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
```

</details>

<details>
  <summary>Logs</summary>

```
2022-02-11 17:21:48.446 31917-31917/com.example.untitled I/TextInputPlugin: Composing region changed by the framework. Restarting the input method.
2022-02-11 17:21:48.455 31917-31917/com.example.untitled W/IInputConnectionWrapper: beginBatchEdit on inactive InputConnection
2022-02-11 17:21:48.455 31917-31917/com.example.untitled W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
2022-02-11 17:21:48.456 31917-31917/com.example.untitled W/IInputConnectionWrapper: getTextAfterCursor on inactive InputConnection
2022-02-11 17:21:48.457 31917-31917/com.example.untitled W/IInputConnectionWrapper: getSelectedText on inactive InputConnection
2022-02-11 17:21:48.458 31917-31917/com.example.untitled W/IInputConnectionWrapper: endBatchEdit on inactive InputConnection
2022-02-11 17:21:48.462 31917-31917/com.example.untitled W/IInputConnectionWrapper: beginBatchEdit on inactive InputConnection
2022-02-11 17:21:48.462 31917-31917/com.example.untitled W/IInputConnectionWrapper: endBatchEdit on inactive InputConnection
```

```
flutter analyze
Analyzing untitled...
No issues found! (ran in 1.4s)
```

```
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.1, on Microsoft Windows [Version 10.0.22000.493], locale de-DE)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.4)
[√] Android Studio (version 2020.3)
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.64.2)
[√] Connected device (5 available)
[√] HTTP Host Availability

• No issues found!

```
</details>

https://user-images.githubusercontent.com/7944013/153634247-c13c9b52-2444-4b26-a6e1-81f76b823b57.mp4