@@ -154,6 +154,11 @@ enum DragAnchor {
154
154
/// user lifts their finger while on top of a [DragTarget] , that target is given
155
155
/// the opportunity to accept the [data] carried by the draggable.
156
156
///
157
+ /// The [ignoringFeedbackPointer] defaults to true, which means that
158
+ /// the [feedback] widget ignores the pointer during hit testing. Similarly,
159
+ /// [ignoringFeedbackSemantics] defaults to true, and the [feedback] also ignores
160
+ /// semantics when building the semantics tree.
161
+ ///
157
162
/// On multitouch devices, multiple drags can occur simultaneously because there
158
163
/// can be multiple pointers in contact with the device at once. To limit the
159
164
/// number of simultaneous drags, use the [maxSimultaneousDrags] property. The
@@ -207,11 +212,13 @@ class Draggable<T extends Object> extends StatefulWidget {
207
212
this .onDragEnd,
208
213
this .onDragCompleted,
209
214
this .ignoringFeedbackSemantics = true ,
215
+ this .ignoringFeedbackPointer = true ,
210
216
this .rootOverlay = false ,
211
217
this .hitTestBehavior = HitTestBehavior .deferToChild,
212
218
}) : assert (child != null ),
213
219
assert (feedback != null ),
214
220
assert (ignoringFeedbackSemantics != null ),
221
+ assert (ignoringFeedbackPointer != null ),
215
222
assert (maxSimultaneousDrags == null || maxSimultaneousDrags >= 0 );
216
223
217
224
/// The data that will be dropped by this draggable.
@@ -310,6 +317,14 @@ class Draggable<T extends Object> extends StatefulWidget {
310
317
/// Defaults to true.
311
318
final bool ignoringFeedbackSemantics;
312
319
320
+ /// Whether the [feedback] widget is ignored during hit testing.
321
+ ///
322
+ /// Regardless of whether this widget is ignored during hit testing, it will
323
+ /// still consume space during layout and be visible during painting.
324
+ ///
325
+ /// Defaults to true.
326
+ final bool ignoringFeedbackPointer;
327
+
313
328
/// Controls how this widget competes with other gestures to initiate a drag.
314
329
///
315
330
/// If affinity is null, this widget initiates a drag as soon as it recognizes
@@ -447,6 +462,7 @@ class LongPressDraggable<T extends Object> extends Draggable<T> {
447
462
super .onDragCompleted,
448
463
this .hapticFeedbackOnStart = true ,
449
464
super .ignoringFeedbackSemantics,
465
+ super .ignoringFeedbackPointer,
450
466
this .delay = kLongPressTimeout,
451
467
});
452
468
@@ -542,6 +558,7 @@ class _DraggableState<T extends Object> extends State<Draggable<T>> {
542
558
feedback: widget.feedback,
543
559
feedbackOffset: widget.feedbackOffset,
544
560
ignoringFeedbackSemantics: widget.ignoringFeedbackSemantics,
561
+ ignoringFeedbackPointer: widget.ignoringFeedbackPointer,
545
562
onDragUpdate: (DragUpdateDetails details) {
546
563
if (mounted && widget.onDragUpdate != null ) {
547
564
widget.onDragUpdate !(details);
@@ -796,8 +813,10 @@ class _DragAvatar<T extends Object> extends Drag {
796
813
this .onDragUpdate,
797
814
this .onDragEnd,
798
815
required this .ignoringFeedbackSemantics,
816
+ required this .ignoringFeedbackPointer,
799
817
}) : assert (overlayState != null ),
800
818
assert (ignoringFeedbackSemantics != null ),
819
+ assert (ignoringFeedbackPointer != null ),
801
820
assert (dragStartPoint != null ),
802
821
assert (feedbackOffset != null ),
803
822
_position = initialPosition {
@@ -815,6 +834,7 @@ class _DragAvatar<T extends Object> extends Drag {
815
834
final _OnDragEnd ? onDragEnd;
816
835
final OverlayState overlayState;
817
836
final bool ignoringFeedbackSemantics;
837
+ final bool ignoringFeedbackPointer;
818
838
819
839
_DragTargetState <Object >? _activeTarget;
820
840
final List <_DragTargetState <Object >> _enteredTargets = < _DragTargetState <Object >> [];
@@ -937,6 +957,7 @@ class _DragAvatar<T extends Object> extends Drag {
937
957
left: _lastOffset! .dx - overlayTopLeft.dx,
938
958
top: _lastOffset! .dy - overlayTopLeft.dy,
939
959
child: IgnorePointer (
960
+ ignoring: ignoringFeedbackPointer,
940
961
ignoringSemantics: ignoringFeedbackSemantics,
941
962
child: feedback,
942
963
),
0 commit comments