removeListener method

void removeListener(
  1. ImageStreamListener listener

Stops the specified listener from receiving image stream events.

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

Once all listeners have been removed and all keepAlive handles have been disposed, this image stream is no longer usable.


void removeListener(ImageStreamListener listener) {
  for (int i = 0; i < _listeners.length; i += 1) {
    if (_listeners[i] == listener) {
  if (_listeners.isEmpty) {
    final List<VoidCallback> callbacks = _onLastListenerRemovedCallbacks.toList();
    for (final VoidCallback callback in callbacks) {