Repository: flutter
Issue: CupertinoSheetRoute reacts to touch events while opening and closing
Labels: waiting for customer response,in triage

The sheet reacts to touches (dragging up or down) when it's animating to open or close, which isn't the correct behaviour on native iOS, and in this case its causing unexpected behaviour when dragging the sheet which is the inability to close the sheet, if you drag it becomes sticky, it stoping wherever the drag ends, and if you drag it while its opening it cause some visual stutters, I provided videos that visualize the problem.

 Both recording are from Flutter.


This video shows what happens when trying to drag the sheet while its closing:

https://github.com/user-attachments/assets/af1a30a9-d955-4a88-b314-cf6c59cc736d


This one shows what happens when trying to drag the sheet while its opening:

https://github.com/user-attachments/assets/7745c40f-a858-43cc-8d43-07e1cf30fe60


<details>
<summary>Flutter doctor -v output:</summary>

```
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.2 24C101 darwin-arm64, locale
    en-PS)
    • Flutter version 3.27.1 on channel stable at /Users/maherr/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 17025dd882 (6 weeks 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 35.0.0)
    • Android SDK at /Users/maherr/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /Users/maherr/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16B40
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • 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 21.0.4+-12422083-b607.1)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • 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

[✓] VS Code (version 1.96.4)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.102.0

[✓] Connected device (6 available)
    • sdk gphone64 arm64 (mobile)     • emulator-5554             •
      android-arm64  • Android 15 (API 35) (emulator)
    • iPhone (mobile)                 • 00008110-0011384834E2401E • ios
      • iOS 18.0.1 22A3370
    • iPhone (mobile)                 • 00008110-000208513621801E • ios
      • iOS 18.2 22C152
    • macOS (desktop)                 • macos                     • darwin-arm64
      • macOS 15.2 24C101 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin
      • macOS 15.2 24C101 darwin-arm64
    • Chrome (web)                    • chrome                    •
      web-javascript • Google Chrome 131.0.6778.265
    ! Error: Browsing on the local area network for Dalia’s iPhone. Ensure the
      device is unlocked and attached with a cable or associated with the same
      local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code
      -27)
    ! Error: Browsing on the local area network for iPhone. Ensure the device is
      unlocked and attached with a cable or associated with the same local area
      network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code
      -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>


<details>
<summary>Reproducible code</summary>

```dart
import 'package:cupertino_onboarding/cupertino_onboarding.dart';
import 'package:flutter/cupertino.dart';

import '../Widgets/cupertino_sheet.dart';

void main() {
  runApp(CupertinoApp(
    home: CupertinoOnboardingPage(),
  ));
}

class CupertinoOnboardingPage extends StatefulWidget {
  const CupertinoOnboardingPage({super.key});

  @override
  State<CupertinoOnboardingPage> createState() => _CupertinoOnboardingPageState();
}

class _CupertinoOnboardingPageState extends State<CupertinoOnboardingPage> {
  @override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      child: CustomScrollView(
        slivers: [
          CupertinoSliverNavigationBar(
            previousPageTitle: 'Back',
            // transitionBetweenRoutes: false,
            stretch: true,
            largeTitle: Text('Onboarding'),
          ),
          SliverFillRemaining(
            fillOverscroll: false,
            hasScrollBody: false,
            child: Center(
              child: Column(
                spacing: 20,
                mainAxisSize: MainAxisSize.min,
                children: [
                  CupertinoButton(
                    onPressed: () {
                      showCupertinoSheet(
                        context: context,
                        pageBuilder: (context) {
                          return CalendarOnboarding();
                        },
                      );
                    },
                    child: Text('Show onboarding'),
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}

class CalendarOnboarding extends StatelessWidget {
  const CalendarOnboarding({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return CupertinoOnboarding(
      widgetAboveBottomButton: CupertinoButton(
        onPressed: () {},
        child: Text(
          'About Privacy & Policy',
          style: TextStyle(
            color: CupertinoColors.systemRed.resolveFrom(context),
          ),
        ),
      ),
      bottomButtonPadding: EdgeInsets.only(left: 30, right: 30, bottom: 70),
      bottomButtonColor: CupertinoColors.systemRed.resolveFrom(context),
      onPressedOnLastPage: () => Navigator.pop(context),
      pages: [
        WhatsNewPage(
          titleTopIndent: 40,
          titleFlex: 4,
          title: const Text("What's New in Calendar"),
          features: [
            WhatsNewFeature(
              icon: Icon(
                CupertinoIcons.mail,
                color: CupertinoColors.systemRed.resolveFrom(context),
              ),
              title: const Text('Found Events'),
              description: const Text(
                'Siri suggests events found in Mail, Messages, and Safari, so you can add them easily, such as flight reservations and hotel bookings.',
              ),
            ),
            WhatsNewFeature(
              icon: Icon(
                CupertinoIcons.time,
                color: CupertinoColors.systemRed.resolveFrom(context),
              ),
              title: const Text('Time to Leave'),
              description: const Text(
                "Calendar uses Apple Maps to look up locations, traffic conditions, and transit options to tell you when it's time to leave.",
              ),
            ),
            WhatsNewFeature(
              icon: Icon(
                CupertinoIcons.location,
                color: CupertinoColors.systemRed.resolveFrom(context),
              ),
              title: const Text('Location Suggestions'),
              description: const Text(
                'Calendar suggests locations based on your past events and significant locations.',
              ),
            ),
          ],
        ),
      ],
    );
  }
}
```
</details>