hasEventListener method

bool hasEventListener(
  1. String eventType,
  2. {bool useCapture = false}

Returns true if the EventDispatcher has event listeners. The useCapture paramenter defines if the event listeners should be registered for the capturing event phase or not.


bool hasEventListener(String eventType, {bool useCapture = false}) {
  final eventStream = _eventStreams[eventType];
  if (eventStream == null) return false;

  return useCapture
      ? eventStream.hasCapturingSubscriptions
      : eventStream.hasBubblingSubscriptions;