Repository: flutter
Issue: Navigating back from CupertinoPageRoute/MaterialPageRoute prevents tap gestures from getting recognized
Labels: platform-ios,framework,f: routes,f: gestures,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.24,found in release: 3.25

### Steps to reproduce

1. Run following sample on Android or iOS
2. Tap on "Navigate to next page"
3. Swipe back to previous page and quickly tap on the button again
4. The first tap is not recognized
5. Only tap after few hundred ms gets recognized



### Expected results

Tap should be recognized immediately 

### Actual results


https://github.com/user-attachments/assets/f5826d9c-613e-402b-abce-f0b179a893cb



### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/cupertino.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 StatelessWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              child: const Text('Navigate to next page'),
              onPressed: () {
                Navigator.push(
                  context,
                  CupertinoPageRoute(
                    builder: (context) {
                      return const MyHomePage(title: 'Next page');
                    },
                  ),
                );
              },
            ),
          ],
        ),
      ),
    );
  }
}

```

</details>



### Flutter Doctor output

<details open><summary>Doctor output</summary>


```console
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64, locale pl-PL)
    • Flutter version 3.22.3 on channel stable at /Users/dominik/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b0850beeb2 (7 weeks ago), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/dominik/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Android Studio (version 2024.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 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.92.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.96.0

[✓] Connected device (4 available)
    • iPhone SE (3rd generation) (mobile) • C81ADE82-008E-438E-A905-500CE2F8EECA • ios           • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```
</details>


Edit: realized this issue occurs with MaterialPageRoute as well