hasListeners property

  1. @protected
bool get hasListeners

Whether any listeners are currently registered.

Clients should not depend on this value for their behavior, because having one listener's logic change when another listener happens to start or stop listening will lead to extremely hard-to-track bugs.

This method returns false if dispose has been called.

Implementation

@protected
bool get hasListeners => _count > 0;