@@ -222,6 +222,24 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
222
222
late OffsetPair _initialPosition;
223
223
late OffsetPair _pendingDragOffset;
224
224
Duration ? _lastPendingEventTimestamp;
225
+
226
+ /// When asserts are enabled, returns the last tracked pending event timestamp
227
+ /// for this recognizer.
228
+ ///
229
+ /// Otherwise, returns null.
230
+ ///
231
+ /// This getter is intended for use in framework unit tests. Applications must
232
+ /// not depend on its value.
233
+ @visibleForTesting
234
+ Duration ? get debugLastPendingEventTimestamp {
235
+ Duration ? lastPendingEventTimestamp;
236
+ assert (() {
237
+ lastPendingEventTimestamp = _lastPendingEventTimestamp;
238
+ return true ;
239
+ }());
240
+ return lastPendingEventTimestamp;
241
+ }
242
+
225
243
// The buttons sent by `PointerDownEvent`. If a `PointerMoveEvent` comes with a
226
244
// different set of buttons, the gesture is canceled.
227
245
int ? _initialButtons;
@@ -363,7 +381,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
363
381
if (_state != _DragState .accepted) {
364
382
_state = _DragState .accepted;
365
383
final OffsetPair delta = _pendingDragOffset;
366
- final Duration timestamp = _lastPendingEventTimestamp! ;
384
+ final Duration ? timestamp = _lastPendingEventTimestamp;
367
385
final Matrix4 ? transform = _lastTransform;
368
386
final Offset localUpdateDelta;
369
387
switch (dragStartBehavior) {
@@ -449,7 +467,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
449
467
}
450
468
}
451
469
452
- void _checkStart (Duration timestamp, int pointer) {
470
+ void _checkStart (Duration ? timestamp, int pointer) {
453
471
if (onStart != null ) {
454
472
final DragStartDetails details = DragStartDetails (
455
473
sourceTimeStamp: timestamp,
0 commit comments