OffscreenWidget class

Mounts a widget in its own build/layout/paint pipeline, attached to no screen — the capture's way to render a widget that is not (and never will be) part of the running app's tree.

The widget gets a minimal environment: tight constraints at size, a MediaQuery and left-to-right Directionality. Anything more — theme, localizations — is the widget's own wrapping to bring.

One synchronous pass builds, lays out and paints. Content that arrives asynchronously (a network image, a deferred font) is not waited for: call pump after the wait the caller owns.

Properties

boundary → RenderRepaintBoundary
The laid-out root, ready for the capture (or RenderRepaintBoundary's own toImage).
final
flutterErrors → List<FlutterErrorDetails>
What the framework caught while building, laying out or painting: the engine substitutes its error box and carries on, so without this list a throwing builder would render as a clean-looking success.
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

dispose() → void
Unmounts the tree so every State disposes, then releases the pipeline.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pump() → void
One build + layout + paint pass over whatever is dirty.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

mount(Widget widget, {required Size size}) → OffscreenWidget