Picture class Null safety

An object representing a sequence of recorded graphical operations.

To create a Picture, use a PictureRecorder.

A Picture can be placed in a Scene using a SceneBuilder, via the SceneBuilder.addPicture method. A Picture can also be drawn into a Canvas, using the Canvas.drawPicture method.


approximateBytesUsed int
Returns the approximate number of bytes allocated for this object.
debugDisposed bool
Whether this reference to the underlying picture is disposed.
hashCode int
The hash code for this object.
runtimeType Type
A representation of the runtime type of the object.


dispose() → void
Release the resources used by this object. The object is no longer usable after this method is called.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toImage(int width, int height) Future<Image>
Creates an image from this picture.
toImageSync(int width, int height) Image
Synchronously creates a handle to an image of this picture.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.

Static Properties

onCreate PictureEventCallback?
A callback that is invoked to report a picture creation.
read / write
onDispose PictureEventCallback?
A callback that is invoked to report the picture disposal.
read / write