Repository: flutter
Issue: Bottom sheet gets closed and the `onPopInvoked` callback ise executed with `didPop` set to `true`.
Labels: framework,f: material design,f: routes,has reproducible steps,P2,team-design,triaged-design,found in release: 3.22,found in release: 3.24

### Steps to reproduce

1. Run the sample app added below.
2. Open the modal sheet
3. Close it by swiping it down.

### Expected results

Bottom sheet should not be closed, and instead the `onPopInvoked` callback should be executed with `didPop` set to `false`.

### Actual results

Bottom sheet is closed, and the `onPopInvoked` callback ise executed with `didPop` set to `true`.

### 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(
      debugShowCheckedModeBanner: false,
      home: Builder(builder: (context) {
        return Scaffold(
          body: Center(
            child: ElevatedButton(
                child: Text('Open bottom sheet'),
                onPressed: () {
                  Navigator.of(context).push(
                    ModalBottomSheetRoute(
                      builder: (context) {
                        return PopScope(
                          canPop: false,
                          onPopInvoked: (didPop) {
                            debugPrint('didPop: $didPop');
                          },
                          child: Container(
                            height: 200,
                            color: Colors.red,
                          ),
                        );
                      },
                      isScrollControlled: false,
                    ),
                  );
                }),
          ),
        );
      }),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-arm64, locale en-GB)
    • Flutter version 3.22.1 on channel stable at /Users/yvesdelcoigne/fvm/versions/3.22.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (9 weeks ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/yvesdelcoigne/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/yvesdelcoigne/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode-15.3.0.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.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.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.90.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.92.0

[✓] Connected device (5 available)            
    • sdk gphone64 arm64 (mobile)     • emulator-5554             • android-arm64  • Android 12 (API 31) (emulator)
    • Yves’s iPhone (mobile)          • 00008120-001219A82687C01E • ios            • iOS 17.5.1 21F90
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 14.5 23F79 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 14.5 23F79 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 126.0.6478.62

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>