Repository: flutter
Issue: Button taps have vertical offset on a emulator/simulator
Labels: framework,f: gestures,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.27,found in release: 3.28

### Steps to reproduce

1. Run the example app
2. Scroll until you see the button "inside scroll"
3. Try tapping the top half of the button. Taps are not detected. Now try tapping right under the button, but outside the box. Taps go through. It seems like there is a vertical offset in its hitbox. Images attached

I'm running the demo on an Android emulator, so that we have the precision of the mouse to tap near the bounding of the button.

### Expected results

No vertical offset when tapping, just like the button outside the scroll in the demo 

### Actual results

There is a vertical offset when tapping

### Code sample

<details open><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: 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> {
  int numTaps = 0;

  @override
  Widget build(BuildContext context) {
    final Widget body = Column(
      children: [
        Text("Button outside scroll has the correct hit box"),
        FilledButton.icon(
          icon: Icon(Icons.add),
          onPressed: () {
            setState(() {
              numTaps++;
            });
          },
          label: Text("outside scroll"),
        ),
        Expanded(
          child: Scrollbar(
            child: CustomScrollView(
              slivers: <Widget>[
                for (int i = 0; i < 10; i++) ...[
                  SliverToBoxAdapter(
                      child: Placeholder(
                    fallbackHeight: 100,
                  )),
                ],
                SliverToBoxAdapter(
                  child: FilledButton.icon(
                    icon: Icon(Icons.add),
                    onPressed: () {
                      setState(() {
                        numTaps++;
                      });
                    },
                    label: Text("inside scroll"),
                  ),
                ),
                SliverToBoxAdapter(
                    child: Placeholder(
                  fallbackHeight: 100,
                )),
              ],
            ),
          ),
        )
      ],
    );

    return Scaffold(
      appBar: AppBar(
        title: Text("Num taps: $numTaps"),
      ),
      body: body,
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

#### Above mouse works:
![above mouse works](https://github.com/user-attachments/assets/9109cddc-2b36-4255-83a8-68ca2a2e0522)

#### Above mouse doesn't work:
![above mouse won't work](https://github.com/user-attachments/assets/41a3dd18-1bd6-451f-a9e0-2af5e6c5481d)



</details>


### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.27.1, on Fedora Linux 41 (Workstation Edition) 6.11.10-300.fc41.x86_64, locale en_US.UTF-8)
    • Flutter version 3.27.1 on channel stable at /home/david/.local/share/mise/installs/flutter/3.27.1-stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 17025dd882 (2 days ago), 2024-12-17 03:23:09 +0900
    • Engine revision cb4b5fff73
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/david/Android/Sdk/
    • Platform android-35, build-tools 34.0.0
    • Java binary at: /home/david/opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 19.1.5 (Fedora 19.1.5-1.fc41)
    • cmake version 3.30.5
    • ninja version 1.12.1
    • pkg-config version 2.3.0

[✓] Android Studio (version 2024.2)
    • Android Studio at /home/david/opt/android-studio/
    • 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
    • android-studio-dir = /home/david/opt/android-studio/
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)

[✓] VS Code (version 1.96.0)
    • VS Code at /usr/share/code
    • Flutter extension version 3.102.0

[✓] Connected device (3 available)
    • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Linux (desktop)            • linux         • linux-x64      • Fedora Linux 41 (Workstation Edition) 6.11.10-300.fc41.x86_64
    • Chrome (web)               • chrome        • web-javascript • Google Chrome 131.0.6778.108

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>