didUnregisterListener method Null safety

void didUnregisterListener()

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

See also:

Implementation

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