didRegisterListener method Null safety

  1. @protected
void didRegisterListener()

Calls didStartListening every time a registration of a listener causes an empty list of listeners to become non-empty.

See also:

Implementation

@protected
void didRegisterListener() {
  assert(_listenerCounter >= 0);
  if (_listenerCounter == 0)
    didStartListening();
  _listenerCounter += 1;
}