setImage method

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

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

Implementation

@protected
void setImage(ImageInfo image) {
  _currentImage = image;
  if (_listeners.isEmpty)
    return;
  final List<ImageListener> localListeners = _listeners.map<ImageListener>(
    (_ImageListenerPair listenerPair) => listenerPair.listener
  ).toList();
  for (ImageListener listener in localListeners) {
    try {
      listener(image, false);
    } catch (exception, stack) {
      reportError(
        context: 'by an image listener',
        exception: exception,
        stack: stack,
      );
    }
  }
}