Skip to content

Commit ac0d9c6

Browse files
AndersKlintBirjuVachhani
authored andcommitted
feat: add tapThrough property to allow tap passthrough
1 parent 2dcc34c commit ac0d9c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/flutter_box_transform/lib/src/transformable_box.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ class TransformableBox extends StatefulWidget {
125125
/// all moving operations.
126126
final bool draggable;
127127

128+
/// Whether the box ignores tap events and allows them to pass through to widgets
129+
/// behind it. Dragging and resizing interactions are still possible.
130+
final bool tapThrough;
131+
128132
/// Whether to allow flipping of the box while resizing. If this is set to
129133
/// true, the box will flip when the user drags the handles to opposite
130134
/// corners of the rect.
@@ -255,6 +259,7 @@ class TransformableBox extends StatefulWidget {
255259
// Additional controls.
256260
this.resizable = true,
257261
this.draggable = true,
262+
this.tapThrough = false,
258263
this.allowFlippingWhileResizing = true,
259264

260265
// Tap events
@@ -597,7 +602,7 @@ class _TransformableBoxState extends State<TransformableBox> {
597602
content = GestureDetector(
598603
behavior: HitTestBehavior.translucent,
599604
supportedDevices: widget.supportedDragDevices,
600-
onTap: onTap,
605+
onTap: widget.tapThrough ? null : onTap,
601606
onPanStart: onDragPanStart,
602607
onPanUpdate: onDragPanUpdate,
603608
onPanEnd: onDragPanEnd,

0 commit comments

Comments
 (0)