didUnregisterListener method Null safety

  1. @protected
void didUnregisterListener()
protected">@protected

Calls didStopListening when an only remaining listener is unregistered, thus making the list empty.

See also:

Implementation

@protected
void didUnregisterListener() {
  assert(_listenerCounter >= 1);
  _listenerCounter -= 1;
  if (_listenerCounter == 0) {
    didStopListening();
  }
}