setImage method

  1. @protected
void setImage (
  1. ImageInfo image
)
@protected, inherited

Calls all the registered listeners to notify them of a new image.

Implementation

@protected
void setImage(ImageInfo image) {
  _currentImage = image;
  if (_listeners.isEmpty)
    return;
  // Make a copy to allow for concurrent modification.
  final List<ImageStreamListener> localListeners =
      List<ImageStreamListener>.from(_listeners);
  for (final ImageStreamListener listener in localListeners) {
    try {
      listener.onImage(image, false);
    } catch (exception, stack) {
      reportError(
        context: ErrorDescription('by an image listener'),
        exception: exception,
        stack: stack,
      );
    }
  }
}