addOnLastListenerRemovedCallback method Null safety
- VoidCallback callback
Adds a callback to call when removeListener results in an empty list of listeners and there are no keepAlive handles outstanding.
This callback will never fire if removeListener is never called.
Implementation
void addOnLastListenerRemovedCallback(VoidCallback callback) {
assert(callback != null);
_checkDisposed();
_onLastListenerRemovedCallbacks.add(callback);
}