addTarget method

void addTarget(
  1. Element element,
  2. {bool drag = true,
  3. bool over = true,
  4. bool out = true}
)

Add a target to the set

Implementation

void addTarget(Element element, {bool drag: true, bool over: true, bool out: true}) {
  if(drag && !_targets.contains(element)) {
    _targets.add(element);
    if(enabled) {
      _logger.finer("adding mouse down to ${element.hashCode}");
      _listen("mouseDown", element);
    }
  }
  if(over && !_overTargets.contains(element)) {
    _overTargets.add(element);
    if(enabled && (_dragging || _dragStartPending)) {
      _logger.finer("adding mouse over to ${element.hashCode}");
      _listen("mouseOver", element, true);
    }
  }
  if(out && !_outTargets.contains(element)) {
    _outTargets.add(element);
    if(enabled && (_dragging || _dragStartPending)) {
      _logger.finer("adding mouse out to ${element.hashCode}");
      _listen("mouseOut", element, true);
    }
  }
}