ImageListener typedef Null safety

ImageListener = void Function(ImageInfo image, bool synchronousCall)

Signature for callbacks reporting that an image is available.

Used in ImageStreamListener.

The image argument contains information about the image to be rendered. The implementer of ImageStreamListener.onImage is expected to call dispose on the ui.Image it receives.

The synchronousCall argument is true if the listener is being invoked during the call to addListener. This can be useful if, for example, ImageStream.addListener is invoked during a frame, so that a new rendering frame is requested if the call was asynchronous (after the current frame) and no rendering frame is requested if the call was synchronous (within the same stack frame as the call to ImageStream.addListener).

Implementation

typedef ImageListener = void Function(ImageInfo image, bool synchronousCall);