Repository navigation
Description
Steps to reproduce
- Call
showCupertinoSheet(context: context, showDragHandle: true, scrollableBuilder: (ctx, sc) => MyContent(scrollController: sc))from a button'sonPressed. - Tap the button to present the sheet.
- Observe the top edge of the presented sheet.
Expected results
A native-styled drag handle (small grey pill) appears at the top of the sheet, matching the behavior documented for CupertinoSheetRoute.showDragHandle and shown in the screenshots from issue #179358 / PR #179962.
Actual results
No drag handle is rendered — showDragHandle: true has no visible effect when passed through showCupertinoSheet.
Root cause: showCupertinoSheet accepts a showDragHandle parameter (default false) but never forwards it when constructing the underlying CupertinoSheetRoute, in both code branches:
https://github.com/flutter/flutter/blob/559ffa3f75/packages/flutter/lib/src/cupertino/sheet.dart#L202-L208
https://github.com/flutter/flutter/blob/559ffa3f75/packages/flutter/lib/src/cupertino/sheet.dart#L242-L251
Since CupertinoSheetRoute.showDragHandle defaults to false, the value is silently dropped and _sheetWithDragHandle (https://github.com/flutter/flutter/blob/559ffa3f75/packages/flutter/lib/src/cupertino/sheet.dart#L699-L702), which paints the handle, is never invoked.
Workaround: bypass showCupertinoSheet and push CupertinoSheetRoute directly — this correctly shows the handle, confirming the bug is isolated to the showCupertinoSheet convenience wrapper:
Navigator.of(context, rootNavigator: true).push(
CupertinoSheetRoute<void>(
showDragHandle: true,
scrollableBuilder: (ctx, sc) => MyContent(scrollController: sc),
),
);
### Code sample
**Code sample:**
```dart
<details open><summary>Code sample</summary>
```dart
import 'package:flutter/cupertino.dart';
void main() => runApp(const CupertinoApp(home: _Demo()));
class _Demo extends StatelessWidget {
const _Demo();
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: Center(
child: CupertinoButton.filled(
child: const Text('Open sheet'),
onPressed: () => showCupertinoSheet<void>(
context: context,
showDragHandle: true, // <-- has no effect; no handle is shown
scrollableBuilder: (ctx, sc) => ListView(
controller: sc,
children: const [
SizedBox(height: 40),
Center(child: Text('No drag handle visible above this text')),
],
),
),
),
),
);
}
}
### Screenshots or Video
<img width="568" height="1084" alt="Image" src="https://github.com/user-attachments/assets/da0e6af7-ab1c-450a-82c5-136a16eeb3ce" />
<img width="568" height="1084" alt="Image" src="https://github.com/user-attachments/assets/9d5ac043-e4ca-4ba7-ba53-7b5be74b9b0c" />
<details open>
<summary>Screenshots / Video demonstration</summary>
[Upload media here]
</details>
### Logs
<details open><summary>Logs</summary>
```console
[Paste your logs here]Flutter Doctor output
Doctor output
theo@Theos-MacBook-Pro xyz % flutter doctor -v
[✓] Flutter (Channel stable, 3.44.0, on macOS 26.5.1 25F80 darwin-arm64, locale en-US) [496ms]
• Flutter version 3.44.0 on channel stable at /Users/theo/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 559ffa3f75 (3 weeks ago), 2026-05-15 14:13:13 -0700
• Engine revision 4c525dac5e
• Dart version 3.12.0
• DevTools version 2.57.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
enable-uiscene-migration
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [3.6s]
• Android SDK at /Users/theo/Library/Android/sdk
• Emulator version 36.5.11.0 (build_id 15261927) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• ANDROID_HOME = /Users/theo/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.10+-117844308-b1163.108)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.4.1) [1,064ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17E202
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [4ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (3 available) [7.1s]
• iPhone 17 Pro (mobile) • C86719DB-BF57-4694-AA94-61AA93AC2CB5 • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 26.5.1 25F80 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 148.0.7778.217
[✓] Network resources [1,017ms]
• All expected network resources are available.
• No issues found!
theo@Theos-MacBook-Pro xyz %
Activity
mbcorona commentedon Jun 8, 2026
Hi @art-sparrow , thanks for reporting and pointing out the exact code lines, routing to the design team.
theprantadutta commentedon Jun 10, 2026
I can take this one if nobody's on it. The fix looks straightforward since the issue already points at the exact spots: forward
showDragHandletoCupertinoSheetRoutein both branches ofshowCupertinoSheetinsheet.dart, plus a widget test verifying the drag handle actually appears when the parameter is set through the wrapper. Keeping #187697 (drag handle with stacked sheets) out of scope.dkwingsmt commentedon Jun 10, 2026
Thank you for the investigation!
@theprantadutta Yes, thank you for volunteering. LMK when the PR is ready.
theprantadutta commentedon Jun 10, 2026
PR is ready: #187803 — forwards the parameter in both branches, with a regression test covering both
useNestedNavigationmodes (fails without the fix). Kept #187697 out of scope as discussed.art-sparrow commentedon Jun 10, 2026
Awesome work on the PR and channeling - @mbcorona, @theprantadutta, and @dkwingsmt.
[cupertino_ui] Forward showDragHandle from showCupertinoSheet to Cupe…
github-actions commentedon Oct 16, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.