全画面の画像ビューアを、下にドラッグすると指に追従して縮みながら閉じられるようにして。背景は距離に応じて透明に。閾値未満で離したら元に戻る。
# Drag to Dismiss / ドラッグで閉じる
- id: `drag_to_dismiss_sheet` URL: https://uizukan.dev/entry/drag_to_dismiss_sheet/
- 種別: アクション / Gestures
- 別名: Swipe Down to Close, Interactive Dismiss, Pull Down to Dismiss
- 呼び名: Material 3=Bottom sheets(drag to dismiss) / Material 2=Sheets: bottom(drag to dismiss) / Android (Compose)=ModalBottomSheet(既定でドラッグで閉じる) / iOS (HIG)=Sheets(drag to dismiss) / SwiftUI=.sheet(.interactiveDismissDisabled で制御) / Web=該当なし(Pointer Events で自作) / Flutter=showModalBottomSheet(enableDrag: true) / 自作(GestureDetector + Transform)
- Flutter: `showModalBottomSheet(enableDrag: true) / 自作(GestureDetector + Transform)`
- 関連: modal_bottom_sheet, slide_up_modal, pinch_zoom
**説明**: モーダルを指の動きに追従させて閉じる。途中で離すと戻る、一定距離を超えると閉じる。写真ビューアでは背景が徐々に透明になる。
**使いどころ**: Bottom Sheet、全画面の画像ビューア、iOS 風の sheet。
**AI への伝え方(日本語)**: 全画面の画像ビューアを、下にドラッグすると指に追従して縮みながら閉じられるようにして。背景は距離に応じて透明に。閾値未満で離したら元に戻る。
**Prompt (English)**: Let the full-screen image viewer be dismissed by dragging down: the image follows the finger and shrinks, the background fades with distance, and it snaps back if released below the threshold.
詳細プロンプト は Pro
開発者向け Pro(準備中)で、AI が MCP から直接取りに行けるようになります。名前・デモ・プロンプト・Markdown は無料のままです。
Pro の案内を見る
Flutter コード は Pro
開発者向け Pro(準備中)で、AI が MCP から直接取りに行けるようになります。名前・デモ・プロンプト・Markdown は無料のままです。
Pro の案内を見る