didStopTrackingLastPointer method Null safety

  1. @override
void didStopTrackingLastPointer(
  1. int pointer
)
override

Called when the number of pointers this recognizer is tracking changes from one to zero.

The given pointer ID is the ID of the last pointer this recognizer was tracking.

Implementation

@override
void didStopTrackingLastPointer(int pointer) {
  assert(_state != _DragState.ready);
  switch(_state) {
    case _DragState.ready:
      break;

    case _DragState.possible:
      resolve(GestureDisposition.rejected);
      _checkCancel();
      break;

    case _DragState.accepted:
      _checkEnd(pointer);
      break;
  }
  _velocityTrackers.clear();
  _initialButtons = null;
  _state = _DragState.ready;
}