removeAncestorPointer static method

void removeAncestorPointer(
  1. dynamic id
)

以传入的指针为原点,移除祖先绑定的指针事件,保留后代指针事件

Implementation

static void removeAncestorPointer(dynamic id) {
  Set removeList = {};
  bool flag = false;

  for (final item in pointers) {
    if (item == id) {
      flag = true;
      continue;
    } else {
      if (flag) {
        removeList.add(item);
      }
    }
  }
  pointers.removeAll(removeList);
}