WidgetTextureController class
Owns the gpu.Texture a WidgetTexture streams its child into.
Bind texture to any material texture slot (for example
PhysicallyBasedMaterial.baseColorTexture). It is null until the first
capture completes; listen for changes to pick it up, and expect the
texture object itself to be replaced across captures.
A capture rasterizes the child and wraps the resulting image's backing
GPU texture directly (gpu.Texture.fromImage), so no pixel data crosses
the CPU. On backends where the image cannot be wrapped (the web backend,
software rendering) it falls back to reading the bytes back and uploading
them. Captures are throttled to one in flight either way.
- Inheritance
-
- Object
- ChangeNotifier
- WidgetTextureController
Constructors
Properties
- captureCount → int
-
Total completed captures, for diagnostics.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- lastCaptureDuration → Duration
-
Wall-clock duration of the last capture (rasterize and wrap, plus the
readback and upload on the fallback path), for diagnostics.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- texture → Texture?
-
The most recent capture, or null before the first one completes.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
pointerCancel(
{int pointer = 0}) → void - Cancels an active pointer interaction, if any.
-
pointerDown(
Offset uv, {int pointer = 0}) → void -
Sends a pointer down at
uv. Follow with pointerMove and pointerUp (or pointerCancel) to complete the interaction. -
pointerMove(
Offset uv, {int pointer = 0}) → void -
Moves an active pointer to
uv. -
pointerScroll(
Offset uv, Offset scrollDelta) → void -
Sends a scroll at
uvofscrollDeltalogical pixels (positive y scrolls down), driving scrollables under that point. -
pointerUp(
Offset uv, {int pointer = 0}) → void -
Releases an active pointer at
uv. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
requestCapture(
) → void - Captures the child's latest recorded content now. The trigger for WidgetUpdatePolicy.manual; under other policies it forces an immediate capture (subject to one-in-flight throttling).
-
tapAt(
Offset uv, {int pointer = 0}) → void -
Sends a complete tap (down then up) at
uv. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited