WidgetTexture class Widgets

Hosts a live widget subtree and streams its visual output into a WidgetTextureController's texture for sampling inside a scene.

The child stays fully live (state, tickers, and animations run normally) but is never painted to the screen; this widget occupies zero layout space in its host tree. The child is laid out at the fixed logical size width x height, and captures render at that size times pixelRatio.

A capture is recorded whenever the child repaints, so a static subtree costs nothing per frame. Captures are asynchronous and throttled to one in flight; when the child repaints faster than captures complete, intermediate frames are skipped and the texture always converges on the latest content.

Pointer input does not reach the child (the subtree never appears on screen).

Inheritance

Constructors

WidgetTexture({Key? key, required WidgetTextureController controller, required double width, required double height, double pixelRatio = 1.0, WidgetUpdatePolicy update = WidgetUpdatePolicy.everyFrame, required Widget child})
Creates a widget-texture host capturing child at width x height logical pixels into controller.
const

Properties

child Widget?
The widget below this widget in the tree.
finalinherited
controller WidgetTextureController
Receives the captured texture.
final
hashCode int
The hash code for this object.
no setterinherited
height double
The child's logical layout height.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
pixelRatio double
Texels per logical pixel in the captured texture.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
update WidgetUpdatePolicy
When the child is re-captured; see WidgetUpdatePolicy.
final
width double
The child's logical layout width.
final

Methods

createElement() SingleChildRenderObjectElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
createRenderObject(BuildContext context) RenderObject
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
didUnmountRenderObject(covariant RenderObject renderObject) → void
This method is called when a RenderObject that was previously associated with this widget is removed from the render tree. The provided RenderObject will be of the same type as the one created by this widget's createRenderObject method.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited
updateRenderObject(BuildContext context, covariant _RenderWidgetTexture renderObject) → void
Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.
override

Operators

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