About flutter cancelPointer method

时间:2019-03-18 08:27:15

标签: flutter

In flutter source file gestures/binding.dart, there is a method named cancelPointer,I have a question about its implement.

  void cancelPointer(int pointer) {
    if (_pendingPointerEvents.isEmpty && !locked)
      scheduleMicrotask(_flushPointerEventQueue);
    _pendingPointerEvents.addFirst(PointerCancelEvent(pointer: pointer));
  }

why flush an empty _pendingPointeEvents queue?

0 个答案:

没有答案