WidgetTexture class final

Draws widgets into textures on one device.

Holds nothing between calls but the device: each draw builds its pipeline, uses it, and lets it go. Keeping one alive between draws would mean keeping a BuildOwner and its element tree alive too, which is a caching decision a caller who draws twice a second should make and a caller who draws once should not pay for.

Constructors

WidgetTexture(GraphicsDevice device)
const

Properties

device → GraphicsDevice
Where the pixels end up.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

draw(Widget widget, {required int width, required int height, double pixelRatio = 1.0}) → Future<TextureHandle?>
Rasterises widget at width by height and uploads it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

rasterise(Widget widget, {required int width, required int height, double pixelRatio = 1.0}) → Future<Image>
The widget as a ui.Image, for a caller that wants the image itself.