removeListener method

void removeListener(
  1. ImageStreamListener listener
)

Stops listening for events from this stream's ImageStreamCompleter.

If listener has been added multiple times, this removes the first instance of the listener.

Implementation

void removeListener(ImageStreamListener listener) {
  if (_completer != null) {
    return _completer!.removeListener(listener);
  }
  assert(_listeners != null);
  for (int i = 0; i < _listeners!.length; i += 1) {
    if (_listeners![i] == listener) {
      _listeners!.removeAt(i);
      break;
    }
  }
}