Repository: flutter
Issue: Strange scroll behavior of ListView which has TextFormField with maxLines 2
Labels: a: text input,framework,f: material design,f: scrolling,P2,team-design,triaged-design

### Is there an existing issue for this?

- [x] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

1. Run the sample code below
2. Tap TextFormField and check the keyboard is shown
3. Keep your finger on the TextFormField and scroll outside TextFormField with another finger, then take your finger off which is used for scrolling

### Expected results

Be able to enter text or scroll smoothly when scrolling outside TextFormField while keeping the tap on TextFormField.

### Actual results

Cannot tap TextFormField again and scrolling is not smooth unless I have to restart the app.

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.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: false,
      ),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => HomePageState();
}

class HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        padding: const EdgeInsets.all(16),
        keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
        children: [
          TextFormField(
            maxLines: 2,
            decoration: const InputDecoration(hintText: "Input text with maxLines more than 2"),
          ),
        ],
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

https://github.com/flutter/flutter/assets/125345277/b2b9ebd3-9fa6-49cf-8c54-3e2ba25acaac

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[!] Flutter (Channel stable, 3.13.2, on macOS 13.4.1 22F770820d darwin-x64, locale ja-JP)
    • Flutter version 3.13.2 on channel stable at /Users/shohei/development/flutter
    ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.18.6/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/shohei/development/flutter. Consider adding
      /Users/shohei/development/flutter/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ff5b5b5fa6 (7 days ago), 2023-08-24 08:12:28 -0500
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/shohei/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /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 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.70.0

[✓] Connected device (4 available)
    • Pixel 4a 5G (mobile) • 16051JECB02445            • android-arm64  • Android 12 (API 32)
    • Shmia (mobile)       • 00008020-000E31680243002E • ios            • iOS 16.6 20G75
    • macOS (desktop)      • macos                     • darwin-x64     • macOS 13.4.1 22F770820d darwin-x64
    • Chrome (web)         • chrome                    • web-javascript • Google Chrome 116.0.5845.140

[✓] Network resources
    • All expected network resources are available.
```

</details>