Skip to content

Commit 4803b84

Browse files
author
Renzo Olivares
committed
updates
1 parent 79251a7 commit 4803b84

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/flutter/lib/src/gestures/selection_recognizers.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,16 @@ class TapAndDragGestureRecognizer extends OneSequenceGestureRecognizer with _Con
241241
void acceptGesture(int pointer) {
242242
assert(!_acceptedActivePointers.contains(pointer));
243243
if (pointer == _primaryPointer) {
244+
_stopDeadlineTimer();
244245
print('is primary pointer');
245246
// _checkTapDown(event);
246247
if (_down != null) {
247248
_checkTapDown(_down!);
248249
// _checkTapUp(_up!);
249250
}
250-
_stopDeadlineTimer();
251+
if (_up != null) {
252+
_checkTapUp(_up!);
253+
}
251254
}
252255
_acceptedActivePointers.add(pointer);
253256
print('accept gesture $pointer');
@@ -256,6 +259,7 @@ class TapAndDragGestureRecognizer extends OneSequenceGestureRecognizer with _Con
256259
@override
257260
void didStopTrackingLastPointer(int pointer) {
258261
print('didStopTrackingLastPointer $_state $pointer');
262+
_stopDeadlineTimer();
259263
switch (_state) {
260264
case _DragState.ready:
261265
resolve(GestureDisposition.rejected);
@@ -277,7 +281,6 @@ class TapAndDragGestureRecognizer extends OneSequenceGestureRecognizer with _Con
277281
_checkEnd();
278282
break;
279283
}
280-
_stopDeadlineTimer();
281284
_up = null;
282285
_down = null;
283286
_initialButtons = null;
@@ -351,6 +354,9 @@ class TapAndDragGestureRecognizer extends OneSequenceGestureRecognizer with _Con
351354
void rejectGesture(int pointer) {
352355
print('reject gesture $pointer');
353356
print('cancel from reject');
357+
if (pointer == _primaryPointer) {
358+
_stopDeadlineTimer();
359+
}
354360
_giveUpPointer(pointer);
355361
}
356362

0 commit comments

Comments
 (0)