@@ -142,6 +142,9 @@ class TransformableBox extends StatefulWidget {
142142 /// or the flip.
143143 final RectChangeEvent ? onChanged;
144144
145+ /// A callback that is called every time the [TransformableBox] is tapped.
146+ final TapEvent ? onTap;
147+
145148 /// A callback that is called when [TransformableBox] triggers a pointer down
146149 /// event to begin a drag operation.
147150 final RectDragStartEvent ? onDragStart;
@@ -247,6 +250,9 @@ class TransformableBox extends StatefulWidget {
247250 this .draggable = true ,
248251 this .allowFlippingWhileResizing = true ,
249252
253+ // Tap events
254+ this .onTap,
255+
250256 // Either resize or drag triggers.
251257 this .onChanged,
252258
@@ -489,6 +495,9 @@ class _TransformableBoxState extends State<TransformableBox> {
489495 widget.onTerminalSizeReached? .call (false , false , false , false );
490496 }
491497
498+ /// Called when the box is tapped.
499+ void onTap () => widget.onTap? .call ();
500+
492501 /// Called when the box drag event starts.
493502 void onDragPanStart (DragStartDetails event) {
494503 // Two fingers were used to start the drag. This produces issues with
@@ -545,6 +554,7 @@ class _TransformableBoxState extends State<TransformableBox> {
545554 if (widget.draggable) {
546555 content = GestureDetector (
547556 behavior: HitTestBehavior .translucent,
557+ onTap: onTap,
548558 onPanStart: onDragPanStart,
549559 onPanUpdate: onDragPanUpdate,
550560 onPanEnd: onDragPanEnd,
0 commit comments